Sunricher (friends of hue) switches not triggering automations

Hello!

I have Sunricher switches with Friends of Hue functionality and am using Deconz to integrate them to hassio.
After adding them to/with deconz I can find them as devices in Hassio and add them as triggers in automations, but they do not trigger the automation. They do not show up as entities or under developer tools. I cannot, or do not know how to see if the signal from them is even registered.
How do I get them to work with automations or become entities?

With ZHA you have to use “event triggers” to catch the switch press. It is not shown as a entity.

In “developer tools”, “Events” I listen for “ZHA_event”, and it will show up. You then have to trigger the automation, based on the event created. Think it is the same for Deconz, but not sure.

I tried listening to “deconz_event” but button presses on the switch doesnt show anything. If i put “deconz_event” in event type i get

Event 0 fired 1:55 PM:

{
    "event_type": "deconz_event",
    "data": {},
    "origin": "REMOTE",
    "time_fired": "2021-12-29T12:55:53.669769+00:00",
    "context": {
        "id": "63b7612600f4e9b5d12e709fefa92f22",
        "parent_id": null,
       "user_id": "cdffe43abc9e4988a08145d106d4cd99"
    }
}

but i dont see how that is useful. Do you have any clue on what/how to get it to create an event from the actual button press?

You can probably use device in automations also.
I think all my devices in ZHA integration are listed as devices in automations.

That is the easy way.
But yes the events is if you want to make something more advanced.

It need to go in the “listen to” boks. The event above is you triggering a event, and not the switch. Maybe it is not called deconz_event"? The listernes are listed in the right side of the screen. Remember there will not be a “event” before you actually press a button.

Also look at the answer from Hellis81, if that works, it will be much easier.

when using the as devices to trigger the automations nothing happens.

I have tried resetting the entire thing to a backup as i messed up some stuff in my testing. Still no response in the automations when using the switch.

The automation is set up as:

trigger:
SwitchNAME
“fourth button” button pressed

event:
LightNAME
turn off LightNAME

Try this as the trigger then

trigger:
  - platform: event
    event_type: deconz_event
    event_data:
      context:
        id: 63b7612600f4e9b5d12e709fefa92f22

But this will probably trigger on any button push.
You need to see what each button gives and have these as separate trigger.id’s

do i need to add anything to it? i get error:

Message malformed: expected a dictionary @ data['trigger'][0]

I can’t save the automation since I don’t have the integration.
You need to show how you pasted the code.
Is indentation correct?

EDIT:

Sorry, I forgot to add an action.
The automation saves fine even with an integration I don’t have.

alias: AAAAAAA
description: ''
trigger:
  - platform: event
    event_data:
      context:
        id: 63b7612600f4e9b5d12e709fefa92f22
    event_type: deconz_event
condition: []
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
mode: single

I pasted it like this.

You are pasting a complete automation in a trigger section.
You need to go up to the top right corner and press the three dots then switch to yaml mode.

that makes more sense! It did not seem to work though.

this is how my automation is in YAML.

alias: test
description: ''
trigger:
  - device_id: 15e776f3eaa6d86c1f6ef40869a3693e
    domain: deconz
    platform: device
    type: remote_button_short_press
    subtype: button_4
condition: []
action:
  - type: turn_off
    device_id: 2868aefd11e5b330e94daaf9ac6505db
    entity_id: light.bedroom
    domain: light
mode: single

And it works?

The automation when “running action” works, it does not work using the switch.

The trigger is not something you have posted previously.

The device_id does not match what you posted earlier.
Where did you get this trigger from?

from the YAML of the automation.

I messed some stuff up yesterday and all things went unavailable so i had to roll back to a backup, i dont know if that changed the id.

I’m confused wether you have a device for this remote or not.
Look in the devices of configuration and see if there is a device listed that could be this remote.


this is the device i am using for the automation.

That seems correct.
The automation panel says there is an automation called test liked with this device and the automation you posted was called test.
Seems correct so far.

The only thing that could be the issue is the type and subtype.
Look in the GUI automation editor and see what options you have with this device.
Perhaps one of the other buttons work.

Are you editing the automation through GUI or file editor?

I am editing in GUI. it looks like this, with a couple more alternatives when scrolling down the list.
I have 2 switches and have tried changing which device is used to trigger the automation with no difference in the result, nothing happens no matter which switch i try to trigger it with.