Lovelace Fan Control Entity Row

What kind of fan is the second one that doesn’t work? zigbee/mqtt/other?

Does the fan work fully using the built-in controls?

The remote is identical, one works, one doesn’t. The controls work, it is just the status that is wrong.

They are being controlled via MQTT, I am using the Mosquito addon.

What is the model of the fan? iFan03 or something else?

could you post the configuration code for the fan in yaml text?

and show me the card config too please?

If they are truly fully identical then there should be no reason for one to work and not the other.

Thanks for getting back to me so quickly, I appreciate how confusing it is that one works and the other doesn’t.

Cancel everything!

It is now working. I am not sure what I did to fix.

Things I have done since I had looked at it last was that the units were both running off the same channel with the remotes. I had to re-pair each remote back to each unit. I have also created some other Lovelace tabs to split up my rooms, but that was simply copy and pasting code.

I really appreciate your reaching out so quickly and apologies for the false alarm.

Great work.

1 Like

No problem…Glad I could fix it for you. :wink:

:laughing:

1 Like

If anyone is interested in using the updated fan control modes for their iFan03 or iFan02 (or probably any MQTT fan) then check this thread I started:

I’ve noticed over the past few days that the “low” speed setting on my fan is staying medium. I checked the actual speed and it’s set to 33. That’s when I noticed an error in my log files indicating that set_speed has been deprecated. All good, I set my configs in NR to be set_percentage instead.

However, when I use this configuration, it’s still defaulting to 33 for low instead of 32. Medium is 66 and high is 100, so that’s working like it should.

I dug through the code and can’t find a reference to the percentage. Anyone else experiencing this and maybe have an idea on how to address?

I don’t use MQTT, either - I just use the jasco z-wave fan switch using the zwave integration with the HUSBZB-1.

There is a new plugin I made that uses the set_percentage service instead of the set_speed service.

here is the repo for it (not in HACS yet but should be soon):

finity. Please advise how this affects your coding in your fan_package.yaml examples ?

unfortunately probably a lot.

I haven’t actually got all of my fans updated yet to the new control scheme. I’ve only got some of my test setups done.

Once I get everything finalized and cleaned up I post the updates to the github repo.

Which portions are you interested in?

the MQTT fans or the dumb fan conversion portions?

Thanks. The section for using a Broadlink RF controller to control a dumb fan.

try this code as an example of what you need until I get things uploaded to GH.

All of the automations or broadlink switch code shouldn’t need changed.

fan:
  - platform: template
    fans:
      sunroom_fan_percent_template:
        friendly_name: "Sunroom Fan Percent Template"
        value_template: "{{ states('input_boolean.sunroom_fan_state_percent') }}"
        percentage_template: "{{ states('input_number.sunroom_fan_speed_percent') | float }}"
        turn_on:
          service: script.sunroom_fan_on_percent
        turn_off:
          service: script.sunroom_fan_off_percent
        set_percentage:
          service: script.sunroom_fan_set_speed_percent
          data:
            percentage: "{{ percentage }}"
        speed_count: 3

input_number:
  sunroom_fan_speed_percent:
    name: Sunroom Fan Speed Percent
    min: 0
    max: 100
    step: 1

input_boolean:
  sunroom_fan_state_percent:
    name: Sunroom Fan State Using Percents
    
script:
  sunroom_fan_off_percent:
    alias: Sunroom Fan Off
    sequence:
      - service: switch.turn_on
        entity_id: switch.sunroom_fan_0
      - service: input_boolean.turn_off
        data:
          entity_id: input_boolean.sunroom_fan_state_percent
        
  sunroom_fan_on_percent:
    alias: Sunroom Fan On
    sequence:
      - service: input_boolean.turn_on
        entity_id: input_boolean.sunroom_fan_state_percent
      - service: script.sunroom_fan_set_speed_percent
   
  sunroom_fan_set_speed_percent:
    alias: Sunroom Fan Set Percentage
    sequence:
      - service: input_number.set_value
        entity_id: input_number.sunroom_fan_speed_percent
        data:
          value: "{{ percentage }}"
      - delay:
          milliseconds: 500
      - service: >
          {% if states("input_number.sunroom_fan_speed_percent") | int == 33 %}
            script.sunroom_fan_low
          {% elif states("input_number.sunroom_fan_speed_percent") | int == 66 %}
            script.sunroom_fan_med
          {% elif states("input_number.sunroom_fan_speed_percent") | int == 100 %}
            script.sunroom_fan_high
          {% else %}
            script.sunroom_fan_off_percent
          {% endif %}
      - service: >
          {% if states("input_number.sunroom_fan_speed_percent") | int == 33 %}
            input_boolean.turn_on
          {% elif states("input_number.sunroom_fan_speed_percent") | int == 66 %}
            input_boolean.turn_on
          {% elif states("input_number.sunroom_fan_speed_percent") | int == 100 %}
            input_boolean.turn_on
          {% else %}
            input_boolean.turn_off
          {% endif %}
        entity_id: input_boolean.sunroom_fan_state_percent
   
  sunroom_fan_low:
    alias: Sunroom Fan Low
    sequence:
      - service: switch.turn_on
        entity_id:  switch.sunroom_fan_1

  sunroom_fan_med:
    alias: Sunroom Fan Medium
    sequence:
      - service: switch.turn_on
        entity_id:  switch.sunroom_fan_2

  sunroom_fan_high:
    alias: Sunroom Fan High
    sequence:
      - service: switch.turn_on
        entity_id:  switch.sunroom_fan_3

Oh nice! Glad to hear there’s already a solution. I’ll probably just wait for the update in HACS.

Thanks. But been too busy outdoors to try this. Maybe this weekend ! :slightly_smiling_face:

Using your new code but revised for my fan and switch nomenclature, can turn fan on and change speed. However, cannot turn fan off. Thought it might be because I left out the automation: section of your fan_package.yaml. But when included, still cannot turn fan off. Apologises, but I am an extreme novice with yaml - I just copy and modify others code !

Just to clarify…

you are using the fan percent button row (not the fan control entity row) plugin?

and have you updated to the latest version?

there was an issue that I made a change for recently so if not on the latest try that first to see if it’s resolved.

Definitely using fan-percent-button-row 1.3. (I did reload as on my PC the timestamp was different). Also by using call service I have checked that the coding of my Broadlink turn off switches still work - they do.

But still off not working. As before have tried both with and without your automation: section but makes no difference, i.e. still not working.

fan:
  - platform: template
    fans:
      landing_fan:
        friendly_name: "Landing Fan"
        value_template: "{{ states('input_boolean.landing_fan_state_percent') }}"
        percentage_template: "{{ states('input_number.landing_fan_speed_percent') | float }}"
        turn_on:
          service: script.landing_fan_on_percent
        turn_off:
          service: script.landing_fan_off_percent
        set_percentage:
          service: script.landing_fan_set_speed_percent
          data:
            percentage: "{{ percentage }}"
        speed_count: 3

input_number:
  landing_fan_speed_percent:
    name: Landing Fan Speed Percent
    min: 0
    max: 100
    step: 1

input_boolean:
  landing_fan_state_percent:
    name: Landing Fan State Using Percents

script:
  landing_fan_off_percent:
    alias: Landing Fan Off
    sequence:
      - service: switch.turn_on
        entity_id: switch.off_lf
      - service: input_boolean.turn_off
        data:
          entity_id: input_boolean.landing_fan_state_percent
        
  landing_fan_on_percent:
    alias: Landing Fan On
    sequence:
      - service: input_boolean.turn_on
        entity_id: input_boolean.landing_fan_state_percent
      - service: script.landing_fan_set_speed_percent
   
  landing_fan_set_speed_percent:
    alias: Landing Fan Set Percentage
    sequence:
      - service: input_number.set_value
        entity_id: input_number.landing_fan_speed_percent
        data:
          value: "{{ percentage }}"
      - delay:
          milliseconds: 500
      - service: >
          {% if states("input_number.landing_fan_speed_percent") | int == 33 %}
            script.landing_fan_low
          {% elif states("input_number.landing_fan_speed_percent") | int == 66 %}
            script.landing_fan_med
          {% elif states("input_number.landing_fan_speed_percent") | int == 100 %}
            script.landing_fan_high
          {% else %}
            script.landing_fan_off_percent
          {% endif %}
      - service: >
          {% if states("input_number.landing_fan_speed_percent") | int == 33 %}
            input_boolean.turn_on
          {% elif states("input_number.landing_fan_speed_percent") | int == 66 %}
            input_boolean.turn_on
          {% elif states("input_number.landing_fan_speed_percent") | int == 100 %}
            input_boolean.turn_on
          {% else %}
            input_boolean.turn_off
          {% endif %}
        entity_id: input_boolean.landing_fan_state_percent
   
  landing_fan_low:
    alias: Landing Fan Low
    sequence:
      - service: switch.turn_on
        entity_id:  switch.low_lf

  landing_fan_med:
    alias: Landing Fan Medium
    sequence:
      - service: switch.turn_on
        entity_id:  switch.medium_lf

  landing_fan_high:
    alias: Landing Fan High
    sequence:
      - service: switch.turn_on
        entity_id:  switch.high_lf

Honestly I’m not sure why it isn’t working. It works using my own fan here.

At this point the only thing I know to try is to:

first, try removing the fan-percent-button-row.js file completely. restart HA. Clear your cache (ctrl-F5 in chrome browser) and re-install the fan-percent-button-row.js file.

next if that doesn’t work then you can look at the updated fan percent package that I just uploaded to github: Home-Assistant/fan_package_percents_broadlink.yaml at 7d20332015e3b903e1c7c5221b8700fd4b8ff07f · finity69x2/Home-Assistant · GitHub

and check that file to see where your config might be different (aside from all the entities obviously).

Let me know if it works and if not we can go from there but I’m not sure what to do next if all of that fails.

For anyone who wants the old speed list functionality reinstated.

I’ve requested that the old speed list options should be kept and I’ve had a suggestion from a dev that if a FR gets enough votes they would implement it.

Here is the FR. Please go there and vote it up.

Finally got all the 3 fans I have to turn off. My problem maybe was because of the way I have the Broadlink commands set up, i.e using command_on and command_off switches. Therefore instead of :

landing_fan_off_percent:
    alias: Landing Fan Off
    sequence:
      - service: **switch.turn_on**
        entity_id: switch.off_lf

what works for me is:

 landing_fan_off_percent:
      alias: Landing Fan Off
      sequence:
       - service: **switch.turn_off**
         entity_id: switch.off_lf
1 Like