Ifan03 with tasmota to ha

No, I’m sorry if I gave that impression somewhere but as of right now I don’t know of any ESPHome code for the iFan03.

1 Like

Hi guys! I´ve got an ifan03 with last tasmota firmware. I used the code posted here and the fan works ok in the three spedds. but the off button is snot working. in the menu i dont see the off option but a “false”. what I´m doing wrong? thanks alot!

Try putting quotes around the ‘off’ (like that…) and see if that works.

thanks for your answer… do you mean in the speeds off? the one in the if section already has quotes. this is my code

fan:
  - platform: mqtt  
    name: "Bedroom fan"
    command_topic: "iFan03-1/cmnd/FANSPEED"
    speed_command_topic: "iFan03-1/cmnd/FANSPEED"    
    state_topic: "iFan03-1/stat/FANSPEED"
    speed_state_topic: "iFan03-1/stat/FANSPEED"
    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.bedroom_fan.state == 'off' -%}0{%- elif states.fan.bedroom_fan.state == 'on' -%}4{%- endif %}
      {% endif %}
    speed_value_template: "{{ value_json.FANSPEED }}"
    availability_topic: "iFan03-1/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

this one…

speeds:
  - 'off'
  - low
  - medium
  - high

So… no I´m not seeing the false option anymore and the off speed it´s showing up.
But my problem is still there.

Let me see if i can describe it for you.

I have the device and the custom card on my gui.
If I turn on the fan in any of the three speeds, it turns on, and this works in boths cards.
The toggle switch on the device card does not turns on

fan%20default

fan%20custom

If i try tu select the off speed or click the off button nothing happens.

If I click on toggle on the device card its stay “on” for two second and it goes of again (meanwhile the fan is still spinning), but if i toggle it wile is still on, the fan turns off

and at last, i have the nabu casa integrated with Alexa, and if I tell alexa to turn the fn of it works.

I don´t know how to go on!

Thanks in advance!

Ok I understand now.

My custom fan card and the standard fan control switch use different configurations.

the one you have posted is the one that works with my custom fan control row.

if you want to use it with the standard fan control toggle switch and the pop-up card to set the speeds then this is the code you need to use:

- platform: mqtt  
  name: "Master Bedroom Fan Popup"
  command_topic: "cmnd/iFan03-2/FanSpeed"
  speed_command_topic: "cmnd/iFan03-2/FanSpeed"    
  state_topic: "stat/iFan03-2/RESULT"
  speed_state_topic: "stat/iFan03-2/RESULT"
  state_value_template: >
    {% if value_json.FanSpeed is defined %}
      {% if value_json.FanSpeed == 0 -%}0{%- elif value_json.FanSpeed > 0 -%}ON{%- endif %}
    {% else %}
      {% if states.fan.master_bedroom_fan_popup.state == 'off' -%}0{%- elif states.fan.master_bedroom_fan_popup.state == 'on' -%}ON{%- endif %}
    {% endif %}
  speed_value_template: "{{ value_json.FanSpeed }}"
  availability_topic: tele/iFan03-2/LWT
  payload_off: "0"
  payload_on: "ON"
  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 substitute your entities for mine.

You can use them both at the same time (as long as you name them something different) but you will end up having two fan entities in HA that control the same fan device.

Or just use one or the other.

1 Like

should i enable mqtt if i want to use it with alexa ?

I’m not sure what you are asking…

You need to have mqttt enabled to be able to use tasmota flashed devices in general. It has nothing specifically to do with Alexa.

1 Like

Howdy, I have been reading a lot on this forum as I just got into HA in the past month. Many thanks to the people working on HA and this forum, it has been a gold mine of information.

I got an iFan03, and I have it configured and can see the fan controller in lovelace, however the UI is clunky (having to tap on the card, select speed and it will go to that speed).

My configuration.yaml:

fan:
  - platform: mqtt  
    name: "iFan03"
    command_topic: "iFan03/cmnd/FanSpeed"
    speed_command_topic: "iFan03/cmnd/FanSpeed"    
    state_topic: "iFan03/stat/RESULT"
    speed_state_topic: "iFan03/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.iFan03.state == 'off' -%}0{%- elif states.fan.iFan03.state == 'on' -%}4{%- endif %}
      {% endif %}
    speed_value_template: "{{ value_json.FanSpeed }}"
    availability_topic: iFan03/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

I want to get the fan-control-entity-row.js card working. I have placed the card in my /config/www/ directory (I will likely move it later, but am trying to keep this as simple as possible until I get it working.

I added the file location to the top of my lovelace using Raw Config Editor

resources:
 - type: js
   url: /local/fan-control-entity-row.js

I have restarted HA (many times)

When I create a custom entity card using this code:

Title: iFan03
entities:
  - entity: fan.iFan03
    name: iFan03
    type: 'custom:fan-control-entity-row'
type: entities

I still get this error

image

I also tried this in lovelace yaml mode and got the same results.

What am I missing? I am not sure why Lovelace is not finding the custom card.

two things…

  1. change the entity_id of your fan to “fan.ifan03”. all entity_ids should be all lower case. To verify this you can look at the states tab in the developer tools section.

  2. if that still doesn’t work then try to force refresh the cache on your browser (ctrl-F5 on Chrome).

Thanks for taking the time to look through this, you are correct, entity should be lower case, I changed that, cleared browser cache and history in IE and logged in again, no change.

I then went to Chrome, loaded the page, did a force refresh as you recommended and still no change.

When you say “I have placed the card in my /config/www/ directory” how did you do that?

Did you copy and paste the code from the github repo? Or did you download the repo and copy the unzipped file into that location?

If you did a copy/paste of the code did you copy the contents from the file using the “raw” button?

If you didn’t copy the “raw” code then it won’t work because the code box puts in some extra formatting stuff that will cause you to get errors.

1 Like

I downloaded the .js file from gtihub (fan-control-entity-row/dist at master · finity69x2/fan-control-entity-row · GitHub) it did not download as a .zip.

This file was then copied from my download directory and placed in //hassio/config/www/ directory using SAMBA.

hmm… :thinking:

OK, then I think everything should be working so let’s try something else…

you have a couple of options at this point.

  1. you can try to install HACS which will be a big benefit later since it streamlines installing custom components (like my fan row) so it minimizes the chances of making mistakes when installing these kinds of things.

  2. you can delete the current file that you now have and try to re-install manually again.

My recommendation would be to go with option 1. It will be a big benefit in the long run.

if you go route 2 I would try to clone the entire repo with the big green button on the main page:

ex4

then re-copy the file to your www folder.

restart HA, clear the cache, hit the “refresh” button from the top right three dot menu and see if it works.

Have you been able to successfully install and use any other custom cards?

1 Like

I had not yet installed HACS, but I got that installed and used that to install the custom card for the fan control entity row, and low and behold IT WORKED!

Many thanks finity! :beer:

I still wish I knew what was wrong with my old install, but not going to complain now that it is working.

1 Like

Hi all.

So I have Tasmota loaded on the Sonoff iFan03.

I just can’t get it integrated into HA.

I am likely missing something simple, but cannot figure it out. I was trying to use the custom fan control entity but at this point I just want it to work outside of the tasmota menu

I actually think I have the HA integration done, but can’t get the Fan Control Entity Row to work :frowning:

I say that I think it is integrated into HA because when I go to Integrations, then my Mosquitto MQTT integration, there is the iFan03 listed, and when I click on it I see:

However, trying to use the Fan Control Entity Row custom card from HACS, and I get:

image

Here is my raw config for lovelace UI:

SOLVED. Sorry all. Got it figured out.

Sorry, I’m late to the party but I’m glad you got it figured out! :slightly_smiling_face:

Would you mind posting what the problem was so that it helps others who might have the same issue?