Hello,
I am trying to set-up a light in a room with this configuration and where the following should happen.
Anything marked with (X) has already been accomplished and i do not need help setting that up.
Wall Switch (Not momentary) connected to a Shelly.
An ikea smart bulb connected to mains through the Shelly.
The Shelly obviously runs ESPHome.
A zigbee PIR movement sensor to detect motion in the room.
When the PIR sensor detects motion it should turn on the light dimly through zigbee (X).
When someone toggles the switch and the lights are either off or dimly activated through it should turn on light af tull brightness (X).
In the case when the server does not respond or wifi is dead or for any reason whatsoever. If a user toggles the switch a certain amount of times it should toggle the state of the Relay in the Shelly.
So the main Question is: How do i make esp execute different actions depending on how many times it has been toggled. e.g.: When i toggle it twice it will toggle the state of the relay once.
This might sound very similar to a button with double click, but then for a wall switch.
I hope you guys will be able to help me.
Thank you.