Using MQTT HVAC to control my ACs at home, I managed to get them configured with some workaround previously posted (to make them work with slightly different commands that need to be published).
It’s currently running in optimistic for power and modes. The AC currently publishes to 2 seperate topics
/Mode and /Power
How can I combine these 2 and then feed it back into MQTT HVAC? I tried adding another Automation as such:
- alias: ACmode controller
trigger:
platform: mqtt
topic: MHI-AC-Ctrl-GYGYAC/Mode
trigger:
platform:mqtt
topic: MHI-AC-Ctrl-GYGYAC/Power
action:
service: mqtt.publish
data_template:
topic: MHI-AC-Ctrl-GYGYAC/Mode/HVAC
payload: >
{% set values = { "Auto":"auto", "Fan":"fan_only", "Cool":"cool", "Dry":"dry", "Off","off"} %}
{{ values[trigger.payload] if trigger.payload in values.keys() else "Auto" }}
The logic is not quite right, as I’m thinking I’m triggering on anything that’s changing. How do I make it such that it only publishes a payload when /Power is “On” and at the same time ‘convert’ the values to something that MQTT HVAC expects.
This would hopefully solve another side issue that I have, which is that I still sometimes run the ACs with their remotes (horrors). /Power will update accordingly, however I’d still need to feed that into MQTT HVAC so I don’t have to say toggle it on and then off as it’s in an unknown state.