You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
Configuration options for payload ON and OFF strings are independent of each other. For example, if Home Assistant configuration uses payload ON as "1", relay payload needs to be updated too. Otherwise, configuration generator would show a different value from the one that is actually sent.
Steps to reproduce
Update HOMEASSISTANT_PAYLOAD_ON
Run ha.config in terminal, see payload_on
Try to subscribe to the relay topic and toggle the relay. Actual value is from RELAY_MQTT_ON
Expected behavior
Dependant MQTT messages should have a single configuration entry
Perhaps, there should be a global setting for every "boolean" payload.
- remove "platform" key, see #1440. this implicitly sets schema to "basic". pending some other clean-up regarding json and mqtt queueing, other schema can be added down the line
- updated ws module queue elem to capture callbacks list, allows to pass more than one callback (for example, when they are generated on the fly as lambdas, see ha wsPost usage)
- modified method to send ha config to use global ws queue, fix#1762 problem with empty topics and ensure json allocation is consistent.
- use existing defines to set mqtt payload options. amend #1085, #1188, #1883 to use the set payload value. drop HOMEASSISTANT_PAYLOAD... defines.
- update MQTT_STATUS_ONLINE/OFFLINE and RELAY_MQTT_ON/OFF with runtime configuration
- filter payload strings so that the resulting yaml value is not interpreted as bool (python True, False)
- helper method for settings to streamline string values manipulation
Bug description
Configuration options for payload ON and OFF strings are independent of each other. For example, if Home Assistant configuration uses payload ON as "1", relay payload needs to be updated too. Otherwise, configuration generator would show a different value from the one that is actually sent.
Steps to reproduce
Update HOMEASSISTANT_PAYLOAD_ON
Run
ha.config
in terminal, seepayload_on
Try to subscribe to the relay topic and toggle the relay. Actual value is from RELAY_MQTT_ON
Expected behavior
Dependant MQTT messages should have a single configuration entry
Perhaps, there should be a global setting for every "boolean" payload.
Tools used
Additional context
As mentioned in the #1762 (comment), if HA config generator omits payload_on/off, Home Assistant will expect default ON and OFF strings. However, these are used:
https://github.com/xoseperez/espurna/blob/dev/code/espurna/config/general.h#L1280-L1294
But they need to be in sync with these:
espurna/code/espurna/config/general.h
Lines 407 to 413 in 35ce687
Because that's what is actually used by mqtt send in relay module:
espurna/code/espurna/relay.ino
Line 879 in 35ce687
So there should also be an option to optionally omit certain key-value pairs in the configuration.
The text was updated successfully, but these errors were encountered: