#Philips Hue Automation difficulty

1 messages · Page 1 of 1 (latest)

rare topaz
#

I have two separate automations where I want to detect when either of the two Hue scenes have been activated. I don't see any way to set a scene as a trigger so I am trying to use a specific state change as the trigger. One scene sets the lights to 100% while the other scene sets the lights to 60%. For one of the automations, I am triggering on "state". I am using "Brightness" as the attribute, and I have the "to:" set to 255. I am using a helper group with two lights in it as the entity but I have tried this with individual lights with same results. I can watch the current state of the light group in Developer Tools->State got from 0 to 255 and back to 0 and the automation never triggers. Here is what the automation looks like:

- id: '1744875188393'
  alias: Dawn's Office Lights - Sun - State is On
  description: ''
  triggers:
  - trigger: state
    entity_id:
    - light.dawn_s_office_lights
    attribute: brightness
    to: '255'
  conditions: []
  actions:
  - type: turn_on
    device_id: dbb066af37189bacda72013ac5a47d50
    entity_id: 358e8d7f3256c72fb3aac8f2eb70b2c7
    domain: switch
  - type: turn_off
    device_id: dbb066af37189bacda72013ac5a47d50
    entity_id: 93bd76e40135fee192f34f2e757d5e75
    domain: switch
  - type: turn_off
    device_id: dbb066af37189bacda72013ac5a47d50
    entity_id: 7a4e19073463201f760de198bd896f44
    domain: switch
  mode: single

where am I going wrong? Is there a better way to do this? Thanks!

gaunt pagoda
#

In HA, states are always stored as strings (i.e. '255') but attributes are stored as their native data type (i.e. 255). If you entered 255 for to: in the UI, it would treat it as a string which won't match the number 255. Just edit the trigger in yaml and remove the quotes.

rare topaz
#

@gaunt pagoda Thanks for the suggestion. I updated the to: value to the number 255 and that cleared up the issue. Then I set my other scene to a brightness level of 67% or 170 and that seems to work now for both. Even though this currently works, it feels fragile. I'll keep searching for a more robust solution. Thanks for your help! Much appreciated.