Shelly - Trigger on switch pressed?

I’m currently making automations for our roller shutters. I would like to add a condition to them that when someone used the physical buttons the automation does not get triggered so it does not override whatever a person manually set it to (by checking boolean most likely).

What I would like is to turn a binary sensor ‘boolean.cover_bedroom_manual’ to true when the switch in the bedroom was pressed to control the roller shutter manually. In this way the roller shutter automation which is triggered by time/sun is not activated the next time the sun entity is updated.

I’m currently using the ShellyForHASS integration and my shelly’s show up as sensor.shelly_shsw_25_68ecf2_1_consumption which I’m not sure I can use in the trigger’s event_data’s entity_id.

Anyone has done this before in this way?

Which Shelly model do you have?

According to the ShellyForHASS documentation I just scanned you should have a switch sensor associated with the Shelly. Do you?

Whether or not you can dissociate the switch from controlling the relay… I’m not sure but I could not find anything in the API reference, https://shelly-api-docs.shelly.cloud/#shelly1pm-settings

Shelly 2.5

Only sensors appearing are the following:


And the Cover entity for it.

So no switch entity which could display whether it is pressed/toggled/…

Not sure what you mean here, I don’t need to split it up per se, I just want HA to know whether the relay/swtich has triggered.

I use the Shelly Discovery python_script (https://github.com/bieniu/ha-shellies-discovery), and, for me the switches show up as binary_sensors.

However, since the switch also controls the load (light bulb, or whatever) I don’t use these binary_sensors and just rely on the switch provided. However, in the shelly configuration under Settings -> Button Type there is the option for “Detached Switch”. This means that the switch will NOT control the load. With this mode enabled, the binary_sensor becomes useful because it will tell me if the switch on the wall is in the “on” or “off” position.

Though I don’t use it, I’ve tested it and it does change when I toggle the switch on the wall.

1 Like