openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.56k forks source link

[hue] Managing automations #16904

Open jlaur opened 1 week ago

jlaur commented 1 week ago

I see some use-cases in being able to manage automations from openHAB:

image

It would be useful if openHAB could turn these automations on or off.

I imagine exposing each automation as a Switch channel. These channels could be on the Bridge thing, since there would be only once instance of them, and they do not represent any physical devices. This would be similar to automations on the Hunter Douglas PowerView Hub. They should belong to a channel group, and they could be marked as advanced.

The resource type representing these automations is behavior_instance.

Getting all instances: GET https://{{host}}/clip/v2/resource/behavior_instance (also included in GET https://{{host}}/clip/v2/resource)

Example for enabling an automation:

PUT https://{{host}}/clip/v2/resource/behavior_instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Payload:

{
    "enabled": true
}
jlaur commented 1 week ago

@andrewfg - WDYT?

andrewfg commented 1 week ago

Yes.

andrewfg commented 3 hours ago

@jlaur I will create a PR for this