Hello is it possible to show switch state in opposite way (talking about tasmota switch)? If tasmota is ON to show OFF in HA and vice versa.
Thanks
Hello is it possible to show switch state in opposite way (talking about tasmota switch)? If tasmota is ON to show OFF in HA and vice versa.
Thanks
Create a template switch
please could you explain what you mean?
Yes, create your template so when the tasmota switch is on, your template switch is off, and vice versa.
And if I´ll use this switch to turn ON (in HA GUI) it will turn OFF tasmota?
Yes it will.
Thank you will try
Please could anyone help with switch template?
My standard switch is:
- platform: mqtt
name: "Switch 1 "
state_topic: "stat/sonoff2/POWER"
command_topic: "cmnd/sonoff2/POWER"
availability_topic: "tele/sonoff2/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
Please how to show and control this switch in HASS GUI in opposite way? ON=OFF switch OFF=ON switch. Thank you.
Just swap these over
OOu. So easy? Without template switch?
Dunno, not tried it, never used anything like this as I’m happy (generally) to work with raw states. But this seems pretty clear.
Why don’t you just try it and see if it works? Don’t want to offend you and maybe my assumptions are incorrect, but it feels like you want others to give you solutions to your problems on a silver plate, which you can just copy/paste. In case this is true, this is not the way it works, you should do it yourself and people here help you to solve your problems but you can’t expect them to provide a ready-to-use solution for your problem.
Nope sir, check my posts. Sometimes I ask. I find a solution. And I post it for others.
The only reason I can´t try it right now on my own is that I don´t have a free switch to use. I need to create one. All others are now in work and I can make testing on them. I ask because there is a probability that someone going around will tell that this is impossible or will offer another solution which finally leads to time spare for me in next work…
As opposed to free time for us ?
Thanks for that, I shall bear it in mind
What do you mean with you don’t have a free switch?
Sorry but this is also a part of “community life”. You help others ( to spare time, to make something…) and they will help you next time (to buy beer, to rob a bank etc…)
I don’t agree on this it’s not part of the “community life” to spare time for you, the community is meant to help you with your problems and not to sacrifice our time to save you some time. It might be the result of the help, that you save some time.I don’t see why I should test something for you in my production system, because you don’t want to do it on your production system. I may test it in my environment, if you did it first and it did not work, but you need to test it yourself.
OK OK radio silence till I´ll make a test…
tested and works. I can confirm that this simple change cause switch to work opposite way (talking about mqtt switch). Thanks to @Mutt - he is a genius of simplicity.
Working code (tasmota switch):
- platform: mqtt
name: "Channel 1"
state_topic: "stat/muttisagenius/POWER1"
command_topic: "cmnd/muttisagenius/POWER1"
availability_topic: "tele/muttisagenius/LWT"
qos: 1
payload_on: "OFF"
payload_off: "ON"
payload_available: "Online"
payload_not_available: "Offline"
retain: false