Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Philips Hue Rules in LightScript #28

Closed
StartAutomating opened this issue Oct 3, 2022 · 0 comments · Fixed by #33
Closed

Making Philips Hue Rules in LightScript #28

StartAutomating opened this issue Oct 3, 2022 · 0 comments · Fixed by #33
Assignees
Labels
enhancement New feature or request Post Issues that should become posts

Comments

@StartAutomating
Copy link
Owner

StartAutomating commented Oct 3, 2022

Hue Rule expressions take the format /resource/id/...

This isn't exactly the most "user friendly" option. When was the last time you memorized dozens of numeric ids?

Set-HueRule was recently updated to make this a lot easier.

Now, when you Set-HueRule, you can provide the name of a sensor instead of the numeric ID in a condition:

    Set-HueRule -Condition {
        "/sensors/SunroomDimmerSwitch/state/buttonevent" -eq "3003"
    } -Action {
        Set-HueLight -RoomName "Sunroom" -BrightnessIncrement -.1
    } -Name SunroomDimmerHoldDarken

Because "sensors" is followed by a non-integer, we can interpret it as a name.

We can do so by providing the resource and name to Get-HueBridge, and then appending on the rest of the uri.

For flexibility, we actually consider two possible names: The literal name, and de-CamelCased version of the name. Thus even though my dimmer switch is actually called "Sunroom Dimmer Switch", Set-HueRule figures it out and sets the right rule for the right switch.

Custom Rules are an incredibly powerful part of the Hue ecosystem, and this makes much easier to set up.

Happy LightScripting

@StartAutomating StartAutomating added the enhancement New feature or request label Oct 3, 2022
@StartAutomating StartAutomating self-assigned this Oct 3, 2022
@StartAutomating StartAutomating changed the title Set-HueRule should allow for names in addresses LightScript makes it easy to Set-HueRule Oct 12, 2022
@StartAutomating StartAutomating changed the title LightScript makes it easy to Set-HueRule Making Hue Rules in LightScript Oct 12, 2022
@StartAutomating StartAutomating added the Post Issues that should become posts label Oct 12, 2022
@StartAutomating StartAutomating changed the title Making Hue Rules in LightScript Making Phillips Hue Rules in LightScript Oct 12, 2022
@StartAutomating StartAutomating changed the title Making Phillips Hue Rules in LightScript Making Philips Hue Rules in LightScript Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Post Issues that should become posts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant