Ifan03 with tasmota to ha

I have tried it the “raw” way too from your github page, doesn’t seem to make a difference :slight_smile:
This is the code I inserted at the top section of the lovelace editor, have restarted multiple times.

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

HACS looks promising, will definitely check it out!

You definitely have to use the “raw” code from the github to make it work but try using this:

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

The js file is now here, restarted hassio again, error annoyingly prevails.Home%20Assistant

It’s hard to know what the problem could be without knowing all of the details of everything involved. I know it has worked for others and it works for me. And I haven’t changed anything in the code to make it fail. It has to be either where/how you have the file installed and/or where you are telling lovelace to find the file.

I think the best advice is to just try to get HACS running and install it from there. If you do just make sure you follow the instructions on the HACS installation page about what to put in the resources section. it’s different if you use HACS to install things instead of manually.

there IS NO /local folder… it is www folder. BUT in lovelace, that is referenced by the /local ENDPOINT, not www.

So rename the local directory to www
In lovelace, reference the file as /local

In other words, like all custom cards…

Cool, I’ll check it out but this baffles me. This is my config if it helps, in case you have a minute. Thanks.

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

What if there is both a local and a www folder?

You’ve f’ked up and should delete /local

Ok there was slight confusion with the folders, I thought I was meant to create the local folder. Anyhow the fan row works now in the UI but I still can’t control the fan. None of the speeds or the on/off do anything. Any insight would be very welcome.

Yeah, the instructions at the github tell you to put it into www and then to reference it in resources as /local.

But at least you got that part worked out.

as far as the fan control issue you might (probably…) need to check that the MQTT topics are correct.

Otherwise, the code looks fine as it is.

Yeah, my bad I couldn’t understand the continuity in the github tutorial. So i figured if there is a path there must be a folder to correspond to that path. We live and learn. Could the fact that I’m running auto discovery be interfering with it. I changed “FanSpeed” to “FANSPEED” as per your instructions on github, or is this another fail on my part? Thanks for your help so far.

Ok, found the problem! I had the topics formatted like this:

command_topic: "cmnd/iFan03/FanSpeed"

But it prefers it like this:

command_topic: "iFan03/cmnd/FanSpeed"

Cheers

It’s not your fault. It’s bloody confusing!

Directory                      Endpoint Referenced as                   Used by
www                            /local/                                  normal manuallovelace
www/community                  /community_plugin/                       HACS
www                            /customcards/                            custom updater

So yeah... confusing.

MQTT Discovery reverses the order of the topics… yeah another trap!

1 Like

Really? I had no idea since i dont use discovery but that’s good to know. I’ve had a couple of other people ask questions about similar things using tasmota for the fans and it ended up being the topics were screwed up. I was wondering how the topics could be different using the same firmware but now it makes more sense.

Yeah see here…

The docs there aren’t exactly clear (to say the least)

Do you guys think there is any way to get this working in Google Home, or is it too much too ask, too early on? I could hack around it by utilizing the 4 sonoff switches that get created with the fan, changing their names and triggering that from Google Home, for low, medium, or high speed. Not entirely sure how the voice command would go yet. If anybody has any other form of inspiration, shoot away.

I don’t use Google but I do use Amazon and voice control for the fan works fine. The fan device gets exposed to Alexa as a “fan” entity and I just say “alexa, turn on the master bedroom fan to medium speed” and it does. So I can’t imagine Google not working similarly.

Just had to expose fan to google, works like a charm :slight_smile:

finity, thanks for your HA config posting for the iFan03. I have been lurking for a couple weeks and waiting because my ifan03 has tasmota on it but autodiscovery does not work. I would prefer to use ESPhome anyways. You mentioned you created code that worked for iFan03 in ESPhome.

Would you please paste that in here too, instead of just the HA config yaml for Tasmota?