Light state with Shelly 1 in Edge Switch configuration

Hi, I have dimmable ceiling LED light that was modified by the company installing the lighting in the house to work with an Osram Dali PCU module that takes inputs from a momentary button light switch to control on/off and dimming functions. After looking for a solution to the get the light work with HA later on, I decided to go with Shelly 1 due to its size and the fact that it has a dry contact. Other Shellies wouldn’t cut it as in order for this to work the Osram Dali PCU unit would need to take input via a dry contact with no voltage. It mostly works as intended with Shelly in Edge Switch configuration (changes state on every hit) in order to mimic the way Osram Dali PCU would take input from a momentary button switch:

  • quick on/off burst to turn on or off
  • long press for dimming

I also set up an automation for a quick double-toggle in HA to control it via my wall panel. I’m not that bothered with integrating the dimming function into HA as we normally just use the light at its max brightness.

However I’m struggling to set it up as a switch (possibly a template switch) in HA (for HomeKit and Alexa) due to the following:

  • how do I tie a switch toggle action in HA to a double-click automation mentioned above?
  • how do I produce its state in HA when a double-click required to turn the light on or off always ends in an “off” state as reported to HA by the Shelly integration (since its a quick on/off sequence)?

Thanks in advance for any tips on how to address this :slight_smile:

I can’t say about the native Shelly firmware, because my Shellys are all flashed with ESPHome. But with that it is relatively simple, to mimic the behaviour you want.

Take a look here for the different actions available with the binary_sensor component (on_release, on_press…), combine this with a switch to act with an ESPHome automation. Use a light component in ESPHome and it will show up in HA as a simple light on/off switch.