Ifan03 with tasmota to ha

how to configure the sonoff ifan03 with tasmota with me HA , i am unable to configure it with my Home Assostant hassio .

I have the ifan02, have your tried the example configs on the Tasmota page? https://github.com/arendst/Sonoff-Tasmota/wiki/Home-Assistant-‐-Manual-Config#ifan02---example-1

I tried but didnt understand what changes do i have to do in those mqtt entries as per my configuration ?

Which firmware version did you flash and what was the sonoff module type that you selected?

Latest tasmota dev firmware in which ifan03 is supported

And module is also ifan03 selected .

If you’re using MQTT discovery it will configure itself and create all the sensors you need as well.

the MQTT auto discovery is on and it shows 5 entities , 1 light switch, 3 fan switch and 1 sensor.

but when i integrate those entities with my HA then only light switch is working fine but all the other 3 fan switches does not work properly ,

can you post the information for your entities (entity_id’s, mqtt topics that they publish and/or subscribe to, etc)?

sonoff information page

MQTT Client	DVES_AA309A
MQTT Topic	ifan
MQTT Group Topic	sonoffs
MQTT Full Topic	ifan/cmnd/
MQTT Fallback Topic	cmnd/DVES_AA309A_fb/

sonoff console logs

06:36:14 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"0T12:00:31","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:04","MqttCount":5,"BootCount":15,"SaveCount":351,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
06:40:54 MQT: ifan/tele/STATE = {"Time":"2019-07-23T06:40:54","Epoch":1563860454,"Uptime":"0T12:05:11","UptimeSec":43511,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":2,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:04"}}
06:41:14 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"0T12:05:31","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:04","MqttCount":5,"BootCount":15,"SaveCount":351,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
06:45:26 MQT: ifan/tele/STATE = {"Time":"2019-07-23T06:45:26","Epoch":1563860726,"Uptime":"0T12:09:43","UptimeSec":43783,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":4,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:04"}}
06:45:34 MQT: ifan/tele/STATE = {"Time":"2019-07-23T06:45:34","Epoch":1563860734,"Uptime":"0T12:09:51","UptimeSec":43791,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":4,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:04"}}
06:45:39 MQT: ifan/tele/STATE = {"Time":"2019-07-23T06:45:39","Epoch":1563860739,"Uptime":"0T12:09:56","UptimeSec":43796,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":4,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:04"}}
06:45:54 MQT: ifan/tele/STATE = {"Time":"2019-07-23T06:45:54","Epoch":1563860754,"Uptime":"0T12:10:11","UptimeSec":43811,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":4,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:04"}}
06:46:14 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"0T12:10:31","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:04","MqttCount":5,"BootCount":15,"SaveCount":352,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
06:47:10 MQT: ifan/stat/RESULT = {"FanSpeed":0}
06:47:12 MQT: ifan/stat/RESULT = {"FanSpeed":3}
06:48:19 MQT: ifan/stat/RESULT = {"FanSpeed":0}
06:50:54 MQT: ifan/tele/STATE = {"Time":"2019-07-23T06:50:54","Epoch":1563861054,"Uptime":"0T12:15:11","UptimeSec":44111,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":0,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:04"}}
06:51:14 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"0T12:15:31","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:04","MqttCount":5,"BootCount":15,"SaveCount":357,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}

home assistant - integration - MQTT

2019-07-23%2011_25_32-Home%20Assistant

It’s still not clear what the sonoff2, sonoff3 and sonoff4 switches do.

And just to be clear it looks like the ifan03 has 4 fan speeds (1 thru 4 with speed 0 being off)?

yes there are four speed buttons in the remote too,
0-1-2-3

but here i get only three sonoff switches and those also does not works properly, they works randomly .

if u need any more log then where from ?

this link is having many details about this ifan03

Do you have a MQTT sniffer program (MQTTFx or MQTT Explorer)?

if so then subscribe to “ifan/#” and post the contents of that log when you push the buttons on the remote control for each of the buttons one by one.

I saw that other thread you posted about on the Tasmota site. I’ve looked at it a bit. I’ll try to drill down into it to see what other info I can find out.

05:07:20 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"1T10:31:37","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:05","MqttCount":7,"BootCount":15,"SaveCount":421,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
05:12:00 MQT: ifan/tele/STATE = {"Time":"2019-07-24T05:12:00","Epoch":1563941520,"Uptime":"1T10:36:17","UptimeSec":124577,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":2,"Downtime":"0T00:00:05"}}
05:12:20 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"1T10:36:37","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:05","MqttCount":7,"BootCount":15,"SaveCount":421,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
05:17:00 MQT: ifan/tele/STATE = {"Time":"2019-07-24T05:17:00","Epoch":1563941820,"Uptime":"1T10:41:17","UptimeSec":124877,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":2,"Downtime":"0T00:00:05"}}
05:17:20 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"1T10:41:37","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:05","MqttCount":7,"BootCount":15,"SaveCount":421,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
05:22:00 MQT: ifan/tele/STATE = {"Time":"2019-07-24T05:22:00","Epoch":1563942120,"Uptime":"1T10:46:17","UptimeSec":125177,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":2,"Downtime":"0T00:00:05"}}
05:22:20 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"1T10:46:37","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:05","MqttCount":7,"BootCount":15,"SaveCount":421,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
05:27:00 MQT: ifan/tele/STATE = {"Time":"2019-07-24T05:27:00","Epoch":1563942420,"Uptime":"1T10:51:17","UptimeSec":125477,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"OFF","FanSpeed":0,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":2,"Downtime":"0T00:00:05"}}
05:27:05 MQT: ifan/stat/RESULT = {"FanSpeed":0}
05:27:08 MQT: ifan/stat/RESULT = {"FanSpeed":1}
05:27:11 MQT: ifan/stat/RESULT = {"FanSpeed":2}
05:27:13 MQT: ifan/stat/RESULT = {"FanSpeed":3}
05:27:18 MQT: ifan/tele/STATE = {"Time":"2019-07-24T05:27:18","Epoch":1563942438,"Uptime":"1T10:51:35","UptimeSec":125495,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","FanSpeed":3,"Wifi":{"AP":1,"SSId":"NETGEAR","BSSId":"C8:3A:35:5C:26:62","Channel":11,"RSSI":100,"LinkCount":2,"Downtime":"0T00:00:05"}}
05:27:18 MQT: ifan/stat/RESULT = {"POWER1":"ON"}
05:27:18 MQT: ifan/stat/POWER1 = ON
05:27:20 MQT: ifan/tele/HASS_STATE = {"Version":"6.6.0.2(5953b8b-sonoff)","BuildDateTime":"2019-07-18T15:01:51","Core":"2_4_2","SDK":"2.2.1(cfd48f3)","Module":"Sonoff iFan03","RestartReason":"Software/System restart","Uptime":"1T10:51:37","WiFi LinkCount":2,"WiFi Downtime":"0T00:00:05","MqttCount":7,"BootCount":15,"SaveCount":424,"IPAddress":"192.168.9.132","RSSI":"100","LoadAvg":19}
05:28:41 MQT: ifan/stat/RESULT = {"FanSpeed":0}
05:28:49 MQT: ifan/stat/RESULT = {"FanSpeed":1}
05:29:06 MQT: ifan/stat/RESULT = {"FanSpeed":3}
05:30:01 MQT: ifan/stat/RESULT = {"FanSpeed":0}
05:30:20 MQT: ifan/stat/RESULT = {"FanSpeed":1}
05:30:32 MQT: ifan/stat/RESULT = {"FanSpeed":2}
05:30:43 MQT: ifan/stat/RESULT = {"FanSpeed":3}

try this and see what happens:

fan:
  - platform: mqtt  
    name: "the name of your fan"
    command_topic: "ifan/cmnd/FanSpeed"
    speed_command_topic: "ifan/cmnd/FanSpeed"    
    state_topic: "ifan/stat/RESULT"
    speed_state_topic: "ifan/stat/RESULT"
    state_value_template: >
      {% if value_json.FanSpeed is defined %}
        {% if value_json.FanSpeed == 0 -%}0{%- elif value_json.FanSpeed > 0 -%}4{%- endif %}
      {% else %}
        {% if states.fan.the_name_of_your_fan.state == 'off' -%}0{%- elif states.fan.the_name_of_your_fan.state == 'on' -%}4{%- endif %}
      {% endif %}
    speed_value_template: "{{ value_json.FanSpeed }}"
    availability_topic: ifan/tele/LWT
    payload_off: "0"
    payload_on: "4"
    payload_low_speed: "1"
    payload_medium_speed: "2"
    payload_high_speed: "3"
    payload_available: Online
    payload_not_available: Offline
    speeds:
      - off
      - low
      - medium
      - high

make sure you set the name of your fan in the “name:” section and in the “state_value_template:”

1 Like

thanks now it is working

now i have modify the buttons using customUI

good to hear. If you could please mark my post above as the solution to make it easier for others to find.

are you going to be using my fan control row? It was designed specifically for these so it works good and looks decent too. it can also be easily installed thru HACS.

i tried that fan control row , but i was not able to get it run in my overview window , installed successfully but does not shows anything in my HA overview window,

only from yesterday i am trying to install customUI and trying lovelace frontend.

I’m assuming you’re running Lovelace already. Did you “take control” of the ui yet (top right corner menu)?

If so then you need to follow the instructions on the github repo and add it to a card in your lovelace and set all of the configuration options for the controls.

i am getting the above screenshot error , where is the problem ?

2019-07-27%2021_38_44-Home%20Assistant 2019-07-27%2021_36_23-fan-control-entity-row


2019-07-27%2021_44_23-Home%20Assistant

Two things:

1 did you restart HA after you installed the card?

2 I’ve never used the UI editor for anything but I’m not 100% sure it supports custom cards (and the error kind of says that). you probably will have to go into the raw editor and add it there.

Otherwise the config in the screen shot looks OK.

EDIT: are you using lovelace thru yaml mode or thru the ui editor?