Hi everybody,
I recently bought a couple if Sonoff iFan04-H
(which actually show up as Sonoff iFan04-L
) devices to control ceiling fans in my home. I already found this post and tried to configure things accordingly, but multiple options of template_fan
have changed since then. I tried to adapt to it, but it did not work.
Below is a screenshot of how the device shows up in Home Assistant:
The first switch (Arbeitszimmer/Deckenfan
) shows up as switch.arbeitszimmer_deckenfan
. The other three switches just have names such as switch.mqtt_77dcba_rl_2
. The don’t have a friendly_name
at all. This is what they look like in the tasmota webUI:
On the left is what shows up as switch.arbeitszimmer_deckenfan
(which is actually the light bulb connected to my ceiling fan); 0
does not show up in Home Assistant at all, then 1
- 3
are the unnamed switches from above. They control the fan speed.
I have enabled setoption19 1
in tasmota
so that the device would be automatically discovered by Home Assistant. It reports states like these
19:28:32.893 MQT: tele/tasmota_ifanaz00/HASS_STATE = {"Version":"10.1.0(tasmota)","BuildDateTime":"2021.12.08 14:47:39","Module or Template":"iFan04-L","RestartReason":"Software/System restart","Uptime":"0T10:49:51","Hostname":"tasmota-ifanaz00-7354","IPAddress":"10.0.20.62","RSSI":"90","Signal (dBm)":"-55","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:26","MqttCount":12,"LoadAvg":19}
and
19:32:11.898 MQT: tele/tasmota_ifanaz00/STATE = {"Time":"1970-01-01T19:32:11","Uptime":"0T10:51:42","UptimeSec":39102,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":12,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"","BSSId":"","Channel":1,"Mode":"11n","RSSI":86,"Signal":-57,"LinkCount":2,"Downtime":"0T00:00:26"}}
I can control the fanspeed
attribute from the tasmota console
19:33:01.899 CMD: fanspeed 1
19:33:01.907 MQT: stat/tasmota_ifanaz00/RESULT = {"FanSpeed":1}
However, I don’t know how to set this up as a single entity instead of having multiple -unnamed- switches. Also, turning off the device is not possible through Home Assistant at all! The unnamed switches don’t report their status back to Home Assistant, so they are always off
(even when switched on
via Home Assistant). Since the switch for 0
is missing, the only way is to turn one of the three unnamed switches off, which is impossible when they already are off (I can toggle them on, then off, but this seems to require very precise timing, otherwise won’t do anything at all).
I have seen a custom ESPHome
solution for this device as well. However, I have no experience with including custom .h
files in ESPHome, so I am kinda hesitant. If something went wrong, I’d have to manually flash the device, which would require me to (once again) uninstall the ceiling fan to get to the iFan-module. So while I’d try it for the next ceiling fan, I’d really like to keep tasmota on this device.
Can you recommend anything to make this work? Thank you in advance for your help