I have used this code and it is a great way to control my fans. I installed two controllers and this card works great for one, but the other doesn’t work fully.
With the dodgy one, if I press one of the buttons it will send the command and the fan will change speed, plus I see the command in the tasmota console of the related device, however the button that is pressed does not highlight. When I press the button you can see an outline around the button but that is it.
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.
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.
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 !
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