I have a Tuya electric blanket that I want to be able to say turn on/up/down to Google. Since it integrates as a switch plus various select entities, I thought creating an MQTT Fan would be helpful for Google. The only alternative seemed to be MQTT HVAC where I’d have to somehow deal with temperatures.
It has 6 heat settings, which I translated into 6 fan settings using speed_range_min=1 and speed_range_max=6. I was expecting the 6 levels to translate to percentages for the MQTT messages, but the payloads for the percent are the level numbers.
I feel like I haven’t explained that very well. If the level select entity is set to 2, I was expecting to publish to percentage_state_topic with a payload of 33 (percent), but I need to publish 2 - so not a percentage at all. Similarly, if I set the MQTT fan to 33% in Dev Tools, the percentage_state_topic receives the value of 2, not 33.
This is my first MQTT fan, so maybe I’ve screwed up the yaml:
fan:
- name: "Blanket"
state_topic: "mb/+/device/blanket/state"
command_topic: "mb/mqtt.yaml/device/blanket/set"
percentage_state_topic: "mb/nr/device/blanket-percent/state"
percentage_command_topic: "mb/mqtt.yaml/device/blanket-percent/set"
payload_on: "on"
payload_off: "off"
speed_range_min: 1
speed_range_max: 6
qos: 0
optimistic: true
And fwiw it’s from Goldair and doesn’t integrate very well with the core Tuya, so I’m using Tuya Local.