I have managed to connect my sonoff wall switch using sonofflan from hacs.
everything works well in lovelace. I am trying to create an automation that would '‘çopy’ the ‘‘toggle’’ function of a switch device.
At the moment i have 2 separate automation one to turn on if lights are off and another to turn off if the lights are on. The reason is that the sonoff device/integration does not support TOGGLE.
Your template seems like it should work. Is it referencing the correct entities? Verify in Developer tools that the entity names are correct.
Also check your logs and see if there are related errors.
Post the whole automation you are testing.
This is the last one i have - i am not actually using light.wallswitch in the automation (should have probably posted it in OP, i cant cant seem to adjust to fit the -call service
You still need light.wallswitch_channel1 for the condition, so I’m not sure why you don’t want to just use the light.turn_on and light.turn_off services.
Thank you I didn’t know i could actually uses call services on entities!!! just used lights.toggle and works well. Will still experiment with using templates in config yaml to check how they work…