-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT enum index option leads to error in HA #1280
Comments
if the _data MQTT topics are showing the index numbers (0,1,2...) then the associated MQTT discovery topics will also need to map in the |
fixed in 3.6.1-dev.2 |
Just tested - getting now less errors but still some (there are more than posted here in the list). String vs Number ....
2023-09-08 22:20:42.124 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_dhw_disinfection_day: '1' (valid options: [0, 1, 2, 3, 4, 5, 6, 7])
2023-09-08 22:20:42.138 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_hc1_mode: '0' (valid options: [0, 1])
2023-09-08 22:20:42.139 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_hc1_nofrost_mode: '1' (valid options: [0, 1, 2])
2023-09-08 22:20:42.139 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_hc1_control_mode: '0' (valid options: [0, 1, 2, 3, 4, 5])
2023-09-08 22:20:42.140 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_hc1_program: '0' (valid options: [0, 1])
2023-09-08 22:20:42.140 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_hc1_reduce_mode: '2' (valid options: [0, 1, 2])
2023-09-08 22:20:42.141 ERROR (MainThread) [homeassistant.components.mqtt.select] Invalid option for select.thermostat_hc1_hp_mode: '1' (valid options: [0, 1, 2])
.... |
Thanks for testing. I think we need to rethink the logic. Although there is probably a use case to use enum index values instead of the string value in the mqtt payload, but it messes up the loveliness of home assistant. Perhaps we should publish both enum index & string values in the _data payload? |
made a fix, so the indexes are seen as strings. I still think it looks strange, but now no errors hopefully. |
fix for MQTT enum index option leads to error in HA #1280
#1280 sample value is a string for enums
You will need to create a template yourself and code the logic. But can you remind me why you wanted to use Index's in the first place?
I'm not sure anymore. Probably you'll see all the data in HA as separate heating circuits? |
PROBLEM DESCRIPTION
I have set enum format to index but it seems that HA doesn´t like it. The discovery option for HA should not be affected by this setting but from logs I get the following error which seems that the index is been used instead of value?
Example
@proddy mentioned: Setting the enum format to Index doesn't change the MQTT Discovery topics (the options attribute). Would it work for you if we fix this and use the index's as well here instead of the real values?
I am currently not too familiar with HA if this is a good idea :-D From OH perspective I definitly love the index version as a mapping of enum is pretty simple and well implemented.
REQUESTED INFORMATION
The text was updated successfully, but these errors were encountered: