Lately, i’m having way too many problems with my HA. Trying to fix something with my zigbee switch i rolled back and then more problems started.
I have two sonoff basics and 3 sonoff in wall switches. I can turn on everything from HA, the status changes to on and after a second back to off. The lights/devices stays on thought. From all these devices only one of the sonoff basic works and shows everything correct. This is how i have the light configured. Mosquitto is updated to latest version and Hassio as well.
I figure that it would be something like this but why? I mean I didn’t change a thing. And even I copied the back up from the one sonoff basic that works to the other one (I changed of course the names) and it didn’t work.
So with mqtt.fx i found that it for stat/lamp/POWER is the one for the status. I have the same in my lights.yaml under platform: mqtt. I even changed the topics because with mqtt.fx i found also other similar topics from older installations but still no luck, after a second it goes back to off.
Can you paste the yaml from your current configuration (formatted using the instructions in the blue box at the top of the page) and the output from MQTT.FX showing the command and status messages for the light.
That’s interesting because the command being sent doesn’t actually correlate with the yaml. The payload in the yaml is all uppercase, but the output is “On”.
Are you sure the file is being loaded by HA correctly? Things like the correct file name is being included (if you are using more than one configuration file) and that HA is restarting after you have changed it.
It definitely is. The command was not generated by that yaml configuration.
Tasmota accepts the command in any case, so will turn the light on. However HA is case sensitive, so will not match ON as it is not the same as the command that was sent.
So, I copied on of the lights to the switch.yaml and it worked. When i looked the light entities i have in the attributes it says “supported_features: 0”.
I am completely confused. I have two flux_led lights and they work which means that the lights.yaml is ok and it loads correctly.
The easy workaround is to put all of them under the switches.yaml and change the icon but I want to make it work…
You need to find the place where it has the payload defined as “On” and replace it with “ON”. This is not the place where you posted your first configuration, as that will send “ON”, and that is not happening.
Don’t know if you read the previous comment but when i copied the everything from lights.yaml to switch.yaml it worked. So, don’t think that “On”, “ON” etc has something to do with my problem. Also, even if it was the probelm it would be only for one of them as i changed the settings only from one sonoff device.
Yes, because at that point it would have sent “ON”, because it is reading that file. In the original location, it wasn’t being used, and is not sending “ON”.
Now you lost me. what is the difference of running the same code in 2 different files (not simultaneously)? Of course there is no difference as long as they files are being loaded correctly.
PS: of course i don’t have the same code to 2 files the same time
The original file is not being used, otherwise it would send “ON” not “On”. When you copied that configuration to a file that is being used, it worked fine.
Somewhere in your configuration, you have a light setting that is sending “On”. It may be in a different file, which is being used by HA rather than the one you think you are using.
I’ve checked all files and I have nothing that sends ON, instead of On. The On command you saw on mqtt.fx it wasn’t from HA but a command I send. I’m pretty positive that it’s not case sensitive because firstly I haven’t changed anything and it was working before the rollback and secondly in the automaton I have for the water heating I’m sending on and off commands and it works.
I changed also the name of the yaml with the lights but the problem remains… Not sure what the hell is going on.
If you had said this earlier, I would have come to completely different conclusions.
I think we need to erase the last few posts and start again with some good data. Use the MQTT.FX tool to capture the messages sent when you change the switch on HA from off to on. Then we can see the messages that HA sends, and the response it gets.