I have an embedded esp8266 device configured as a homie device that monitors pool temperatures and controls pool lights, heater, and pool valves. After 5.1.x, homie devices were separated from MQTT and have its own binding. Since then, some of the switch items no longer have the capability to function as a switch. The item properties says it is a switch but switch toggle doesn’t appear. I read in some other posts, that the inherit function can be override using the state description. I added a state description with a pattern %s and adding a space in the Options section but I still can’t get the switch to display.
I get the switch toggle when I unlink it from the homie channel but I can’t figure how to override the setting. Any suggestions?
Update 1:
Besides a valve position losing the switch toggle, the pool heater switch no longer turns on the heater. The switch gets turned out but I don’t see the corresponding mqtt message on mosquitto. I guess I need to turn on the debug messages on the homie binding and the mqtt binding to see what, if any, payload is sent to mosquitto. I know there is a connection between the homie thing and the mosquitto because I am getting temperature readings and I’m able to toggle the suction valve.
Update 2:
I deleted the logs and screenshots for update 1 because I ended up creating a new discovered homie thing and I was able to successfully link my items to the new thing channels. However, I’m still having the original issue with the valve return switch not showing the switch toggle.
Also make sure it’s not read only, toggle that on and then off in the stateDescription.
Also check the semantic tags. The widget MainUI tried to choose is based on the Item Type, stateDescription, and the semantic tags. For example, of the tags include something like “Measurement” MainUI is going to assume it’s a sensor.
In the worst case scenario you can define the default list item widget yourself.
Thanks @rlkoshak for the suggestions. While waiting for a response, I created a new homie thing and I mapped just the valve return item that kept becoming a string item in the old homie thing and viola, it was a switch item in the new homie thing. So I decided to remap the valve return item in the old homie thing and this time, it was a switch item. So I’m confused. So far, I haven’t been able to consistently replicate the issue. So I’ll summarize what I did and hopefully help someone else.
Issue
homie read items continued to function after the upgrade
homie switch items switched but didn’t get passed to mosquito
Troubleshooting steps
removed and added switch item but this time it showed up as string value
Unable to change to switch mode
Created a new homie thing from the discovered inbox
added one valve suction switch item and that worked
added one valve return string item to valve return channel and then removed it to add the valve return switch item but it kept showing up as string. Unable to change it via the state description
Moved all the other switched items first and it worked. At this point, only the valve return item is not showing up as switch item
Created another new homie thing but this time manually
added the value return switch item and this time it work on the latest homie thing
decide to test again the valve switch return item on the second homie thing to verify it fails but this time it work.
Don’t know if it respected the switch status since it was already mapped to another homie thing.
Verified that all switch items are now being passed to mosquito.
At this time, I have three homie thing instances for the same item
The first one has the string items for the valve suction and valve return channels. I do a mapping of ON to SPA and OFF to pool
The second on has all string and switch items and it is currently working.
The third homie thing has only the valve return item mapped to the valve return channel.