Ifan03 with tasmota to ha

I doubt that’s the problem. It’s my understanding that there’s not much functional difference between the two chips. I’m pretty sure that even the “board:” setting is the same between the two. But I haven’t checked that to be sure…

But it’s more likely that the two devices use different GPIO’s to control different functions.

Did you get this working eventually? I have the same problem with the lovelace error

This doesn’t work for me for ifan03 with latest tasmota. I see the same error about the missing .js file but the file is there. Home assistant is showing me some warnings in the .js file when I open it with the configurator, could it have smth to do? Any pointers would be appreciated.

If I understand your problem correctly, Tasmota shouldn’t have anything to do with what you are experiencing.

What are the errors and warnings you are seeing?

How did you install the custom component? HACS? Manually?

I installed the custom component by creating a www folder in the config directory and copying the .js file there. I also copied the resources part at the top of of the page when clicked on raw config editor. This is the error.

!

How did you copy the file from github? Did you click on “raw” from the top of the code box and copy the code from there?

What does the code you put in the resources: section of lovelace look like?

And did you restart HA after you added the js file and added the code to the resources: section?

My recommendation is to use HACS to install any custom component. It makes installing a breeze and it always installs things correctly.

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