Good afternoon everyone.
I recently bought an iFan03 to control a ceiling fan.
Flashed it with Tasmota v8.5 and set it up in Rpi3b HA with this code in yaml:
- platform: mqtt
name: "Fan Stop"
command_topic: "cmnd/iFan03/FanSpeed"
payload_on: "0"
payload_off: ""
state_topic: "stat/iFan03/RESULT"
state_on: ""
state_off: "0"
availability_topic: "tele/iFan03/LWT"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: false
retain: false
qos: 1
- platform: mqtt
name: "Fan Slow"
command_topic: "cmnd/iFan03/FanSpeed"
payload_on: "1"
payload_off: "0"
state_topic: "stat/iFan03/RESULT"
value_template: '{{ value_json.FanSpeed }}'
state_on: "1"
state_off: "0"
availability_topic: "tele/iFan03/LWT"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: false
retain: false
qos: 1
- platform: mqtt
name: "Fan Medium"
command_topic: "cmnd/iFan03/FanSpeed"
payload_on: "2"
payload_off: "0"
state_topic: "stat/iFan03/RESULT"
value_template: '{{ value_json.FanSpeed }}'
state_on: "2"
state_off: "0"
availability_topic: "tele/iFan03/LWT"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: false
retain: false
qos: 1
- platform: mqtt
name: "Fan Fast"
command_topic: "cmnd/iFan03/FanSpeed"
payload_on: "3"
payload_off: "0"
state_topic: "stat/iFan03/RESULT"
value_template: '{{ value_json.FanSpeed }}'
state_on: "3"
state_off: "0"
availability_topic: "tele/iFan03/LWT"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: false
retain: false
qos: 1
- platform: mqtt
name: "Ventilation Fan"
command_topic: "cmnd/iFan03/POWER1"
payload_on: "ON"
payload_off: "OFF"
state_topic: "stat/iFan03/POWER1"
state_on: "ON"
state_off: "OFF"
availability_topic: "tele/iFan03/LWT"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: false
retain: false
qos: 1
This created 4 independent switches on HA the way I like them that turn on and off fine and states are reporting correctly for each one.
So I turn on Fan Slow and state changes to on just fine.
What I would like to happen, is when I turn on Fan Medium the state of Fan Slow changes to off and when Fan Fast turns on the states of Fan Slow and Fast Medium changes to off respectively.
So I would like only one state to be highlighted at each time, the one that the fan is turning.
On iFan03 Tasmota 8.5 console I use the following 2 rules:
rule1 on Mqtt#Connected do publish cmnd/iFan03/POWER1 endon
rule2 on Mqtt#Connected do publish cmnd/iFan03/FanSpeed endon
and status is:
stat/iFan03/STATUS = {âStatusâ:{âModuleâ:71,âDeviceNameâ:âiFan03â,âFriendlyNameâ:[âiFan03â],âTopicâ:âiFan03â,âButtonTopicâ:"",âPowerâ:2,âPowerOnStateâ:3,âLedStateâ:8,âLedMaskâ:âFFFFâ,âSaveDataâ:1,âSaveStateâ:1,âSwitchTopicâ:"",âSwitchModeâ:[0,0,0,0,0,0,0,0],âButtonRetainâ:0,âSwitchRetainâ:0,âSensorRetainâ:0,âPowerRetainâ:1}}
The problem is that if HA is restarted the status of iFan03 switches is not synchronised.
Same settings in a number of Sonoff basics with fw 6.x synchronise correctly.
Thank you
George