finity69x2 / fan-percent-button-row

Frontend plugin to control fans in Home Assistant using percent values for speeds
32 stars 19 forks source link

Fan speed is set to fixed values, even CustomSetpoints are used #21

Closed skipper22hassio closed 2 years ago

skipper22hassio commented 2 years ago

Hi,

when I press the High, Med, Low Butttons the speed is set to 100, 66, 33 respectively, even I've activated and defined custom Setpoints. What am I missing?

type: entities
entities:
  - entity: fan.airflow_remote_control
    type: custom:fan-percent-button-row
    name: Airflow Power
    customTheme: false
    sendStateWithSpeed: true
    customSetpoints: true
    lowPercent: 50
    medPercent: 60
    hiPercent: 95
  - entity: input_boolean.fan_auto

Pressing the Low button sets the speed to 33%, not 50% as expected.

speed_list:
  - 'off'
  - low
  - medium
  - high
preset_modes: []
speed: medium
percentage: 33
percentage_step: 1
preset_mode: null
friendly_name: Airflow Remote Control
supported_features: 1

Setting the fan speed to the developer tools works

service: fan.set_percentage
data:
  percentage: 53
target:
  entity_id: fan.airflow_remote_control

The state attributes in developer Tools then look like this:

speed_list:
  - 'off'
  - low
  - medium
  - high
preset_modes: []
speed: medium
percentage: 53
percentage_step: 1
preset_mode: null
friendly_name: Airflow Remote Control
supported_features: 1

Here is my ESBHome setting for the fan control

Output variable
output:
  - platform: esp8266_pwm
    pin: D7
    frequency: 600 Hz
    id: fan_control_1
fan:
  - platform: speed
    output: fan_control_1
    name: "Airflow Remote Control"
    speed_count: 100

Running HA Core 2021.11.1

wimb0 commented 2 years ago

I am having the same issue.

Config is like this, but the buttons only send 33%, 66% or 100%.

type: custom:fan-percent-button-row
entity: fan.nrg_itho_1234_fan
name: Itho Fan
state_color: true
reverseButtons: true
lowPercentage: 26
medPercentage: 63
hiPercentage: 94

EDIT: Nevermind, it seems that the latest update required customSetpoints: true to be added for custom setpoints to work.

wimb0 commented 2 years ago

Hi,

when I press the High, Med, Low Butttons the speed is set to 100, 66, 33 respectively, even I've activated and defined custom Setpoints. What am I missing?

type: entities
entities:
  - entity: fan.airflow_remote_control
    type: custom:fan-percent-button-row
    name: Airflow Power
    customTheme: false
    sendStateWithSpeed: true
    customSetpoints: true
    lowPercent: 50
    medPercent: 60
    hiPercent: 95
  - entity: input_boolean.fan_auto

Pressing the Low button sets the speed to 33%, not 50% as expected.

speed_list:
  - 'off'
  - low
  - medium
  - high
preset_modes: []
speed: medium
percentage: 33
percentage_step: 1
preset_mode: null
friendly_name: Airflow Remote Control
supported_features: 1

Setting the fan speed to the developer tools works

service: fan.set_percentage
data:
  percentage: 53
target:
  entity_id: fan.airflow_remote_control

The state attributes in developer Tools then look like this:

speed_list:
  - 'off'
  - low
  - medium
  - high
preset_modes: []
speed: medium
percentage: 53
percentage_step: 1
preset_mode: null
friendly_name: Airflow Remote Control
supported_features: 1

Here is my ESBHome setting for the fan control

Output variable
output:
  - platform: esp8266_pwm
    pin: D7
    frequency: 600 Hz
    id: fan_control_1
fan:
  - platform: speed
    output: fan_control_1
    name: "Airflow Remote Control"
    speed_count: 100

Running HA Core 2021.11.1

I think you need to use lowPercentage instead of lowPercent and the same for med and hi in the card config.

skipper22hassio commented 2 years ago

I think you need to use lowPercentage instead of lowPercent and the same for med and hi in the card config.

That did the trick, thank you. I did copy the sample code from the readme some time ago, don't know how I messed this up.