I have an MQTT controlled heating controller that publishes the following state topics for each room:
heating/living/valve_state [0 or 1] // Current state of valve
heating/living/enabled [0 or 1] // Generally enabled
heating/living/temp 19.50 // Target temp
heating/living/valve_level [0-255] // How open the valve is
All channels have corresponding …/set command topics. valve_level isn’t particularly important to me, but if there is place, why not add it. In the old style, this was working:
power_state_topic just reports back the value from power_command_topic, so it is “0” or “1”. I don’t like optimistic modes but want real feedback from the device.
Here is the mosquitto_sub output from a switch-off event:
heating/living/enabled/set 0 // Event coming in
heating/living/valve_state 0 // From device: Valve closed
heating/living/valve_state/set 0 // From device: Valve set state for persistence
heating/living/enabled 0 // From device: Disabled
heating/living/enabled/set 0 // From device: Disabled set state for persitence
reported, so if power isn’t managed by something else, there might be the issue. Still don’t understand why the power button from state OFF issues 0, not 1.
The behavior is the same when power_state_template is completely removed. Originally, I would have though that the payload covered both, but as that did not work, I added that template because the rest of the component seems to like strings more.
Just had a closer look at the code and it looks like the power state is retrieved from the mode_state.
Either the documentation is incomplete or there is a code issue.
And you’re right that the power_state_topic is never subscribed.
You may have to open an issue on github. At least for documentation clarification.
EDIT
It seems that it is just about the climate card.
Pressing the power button seems to be only to turn off the hvac.
Pressing the heat button turns on the hvac.
You are right, that seems to be the behavior … I could account for that, as I have another binary_sensor for the mode anyway, but I find it rather unfortunate …