Using Shelly switch to control another light

I have a Shelly 2.5 switch with double switch connected to it. One of the channels controls a traditional light so it’s set to momentary.

I’d like the other channel to control another light via Home Assistant (which happens to be controlled by Shelly 1).

I’d like to avoid using Node Red or calling rest endpoints directly from Shelly. Ideally I would like to define something like event trigger that toggles the light whenever Shelly switch is pressed. It would be nice to differentiate between short and long press etc.

I can see in the logbook that whenever I press the button I see events being fired

How could I capture these events and use them to drive the other light?

Here’s my solution that worked for me using automation. I found the event details by subscribing to shelly.click event in Developer tools.

alias: Shelly Kitchen channel 2 toggles Kitchen Island
description: ""
trigger:
  - platform: event
    event_type: shelly.click
    event_data:
      click_type: single
      device: shellyswitch25-XXYYZZ
      channel: 2
condition: []
action:
  - service: light.toggle
    data: {}
    target:
      entity_id: light.kitchen_island_light
mode: single
1 Like