Hi Folks,
I’m controlling a fan with MQTT. That fan only supports 4 states: 0 (=off), 1, 2 and 3.
Those are also the states reported back via MQTT, so basicially I can work with the preset modes.
I’m able to set the desired state via my fan integration, but it doesn’t show the current state of the fan, it shows state always off, however the preset_mode is the correct one.
So how can I get that fan state to be similar to the preset mode state?
I guess I have to work with the value_template thing, but I don’t have any glue how…
Here is my config:
fan:
- platform: mqtt
name: "THZ_Fan_Day-Stage"
unique_id: "THZ_Fan_Day-Stage"
availability_topic: "fhem/connection/status"
payload_available: "connected"
payload_not_available: "disconnected"
qos: 2
retain: true
payload_off: "0"
state_topic: "fhem/THZ_FanStage_Day/state"
command_topic: "fhem/FanSelectorDay/set"
preset_mode_state_topic: "fhem/THZ_FanStage_Day/state"
preset_mode_command_topic: "fhem/FanSelectorDay/set"
preset_modes:
- "0"
- "1"
- "2"
- "3"