Automation with Shelly 1

Hi.

I’m configurating a shelly one switch. Works great, but I’d like to execute two different automations depending on if I turn it on via the wall switch or via home assistant (mqtt). Is it possible?

Via the wall switch I want to turn on the light attached to the shelly and another light connected to a sonoff device.
Via home assistant I want to turn on only the light attached to the shelly.

With this automation there’s no way to switch on only the “livingroom_light_shelly”.

- alias: Switch on living room lights
  trigger:
    platform: state
    entity_id: switch.livingroom_light_shelly
    from: 'off'
    to: 'on'
  action:
   - service: switch.turn_on
     data:
        entity_id: switch.livingroom_light_sonoff

Any ideas?

shellies/<model>-<deviceid>/input/0 topic informs about state of phisical switch connected to Shelly. You have to do an automation based on changing the state of the input binary_sensor (pressing the physical switch).

I’ll try this. Thanks!!!

Do you kknow if there’s a similar topic with Tasmota firmware?

Thanks!

I don’t use Tasmota with Shellies. If you have problems with MQTT configuration try Shellies Discovery script. It supports input topic.

Thanks again!