#Need help with first hue automation

1 messages · Page 1 of 1 (latest)

fast marsh
#

Hi all, new to ha, and trying to migrate a few options from Hue to home assistant. I added all my Hue stuff at once, adding the hub (still have it running).
I have a hue dimmer. I’m using the gui for the automation.
I want to turn on 3 lights in de Woonkamer when pressing the on/off button (top) on the dimmer, specific the Honolulu scene from hue.
This works. See image 1.

#

But I also want to turn off all lights in de woonkamer, if I press the on/off button again, when they are already on. Can’t seem to make this work. If I add this second automation, the lights go on, and off directly. So something is off.
See pic 2/3.

fiery thicket
#

Please share the YAML of your automation, it will make it easier to understand what you're doing

barren acornBOT
#

Please use a code share site to share code or logs, for example:

Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.

fiery thicket
#

Whoops, I meant

barren acornBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

fast marsh
#

So i have got it work, kinda.
The hue dimmer has 4 button. Top (first on and off), second is the Plus (+), third is the Minus (-) and fourth is the Hue Button.
I have made an automation turning on the Woonkamer Lights, using the Honolulu Scene:

alias: HonoluluOnWoonkamer
description: ""
triggers:
  - device_id: 14a1e087c87ffca8264ff47db8ed1f23
    domain: hue
    type: initial_press
    subtype: 1
    unique_id: d5199f64-3dd8-459b-88a0-64b93a434df2
    trigger: device
conditions:
  - condition: device
    type: is_off
    device_id: 1ad5c2b84e27381da444e6334d4bc672
    entity_id: 6058da0897486f2f3d99f5182bb26c06
    domain: light
actions:
  - action: hue.activate_scene
    metadata: {}
    target:
      entity_id: scene.woonkamer_honolulu
    data: {}
mode: single

Second is turning off the scene, repressing the on/off button:

alias: HonoluluOff
description: ""
triggers:
  - device_id: 14a1e087c87ffca8264ff47db8ed1f23
    domain: hue
    type: initial_press
    subtype: 1
    unique_id: d5199f64-3dd8-459b-88a0-64b93a434df2
    trigger: device
conditions:
  - condition: device
    type: is_on
    device_id: 1ad5c2b84e27381da444e6334d4bc672
    entity_id: 6058da0897486f2f3d99f5182bb26c06
    domain: light
actions:
  - type: turn_off
    device_id: 1ad5c2b84e27381da444e6334d4bc672
    entity_id: 6058da0897486f2f3d99f5182bb26c06
    domain: light
mode: single

Then i added the Plus and Minus brightness, this also works:

alias: WoonkamerBrightnessHoger
description: ""
triggers:
  - trigger: state
    entity_id:
      - event.hue_dimmer_switch_1_button_2
    attribute: event_type
conditions:
  - condition: device
    type: is_on
    device_id: 1ad5c2b84e27381da444e6334d4bc672
    entity_id: 6058da0897486f2f3d99f5182bb26c06
    domain: light
actions:
  - device_id: 1ad5c2b84e27381da444e6334d4bc672
    domain: light
    entity_id: 6058da0897486f2f3d99f5182bb26c06
    type: brightness_increase
mode: single
#

So far so good, but now i want to change the scenes, pressing the on and off button, holding it, or smething like that. Directly using Hue, if a quickyl press on/off and the Lights are on, it changes to other scenes. But i cant get this to work.
If i long press on/off button, the light also goes off. I dont want to this happen. In the end i would like to add a few scenes, but for now i just want to switch to the hue scene "Lezen".
This i what i have now, but this doesnt work, because it also sets the light to Off if i long press the on/off button.

alias: SwitchScenesWoonkamerLampen
description: ""
triggers:
  - device_id: 14a1e087c87ffca8264ff47db8ed1f23
    domain: hue
    type: repeat
    subtype: 1
    unique_id: d5199f64-3dd8-459b-88a0-64b93a434df2
    trigger: device
conditions:
  - condition: device
    type: is_on
    device_id: 1ad5c2b84e27381da444e6334d4bc672
    entity_id: 6058da0897486f2f3d99f5182bb26c06
    domain: light
actions:
  - action: scene.turn_on
    metadata: {}
    target:
      entity_id: scene.woonkamer_lezen
    data: {}
mode: single
#

If i long press the on/off button, the light go off (triggering automation HonoluluOff)and then i see in the gui of home assistant, that the SwitchScenesWoonkamperLampen is triggered, but it doesnt work, because the light are off already.