finity69x2 / fan-percent-button-row

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

Buttons don't work, but actual entity works okay #5

Closed vajonam closed 3 years ago

vajonam commented 3 years ago

I am testing this for new new preset based Sonoff iFan (w/ tasmota installed). The dropdowns when i click on the entity works, but the buttons on the fan-percent-button-row doesn't seem to do anything. What am I missing here?


fan:
  - platform: mqtt
    name: "Office Fan"
    command_topic: "cmnd/fan_01/FanSpeed"
    state_topic: "stat/fan_01/RESULT"
    state_value_template: >
      {% if value_json.FanSpeed is defined %}
        {% if value_json.FanSpeed == 0 -%}off{%- elif value_json.FanSpeed > 0 -%}on{%- endif %}
      {% else %}
        {% if states.fan.office_fan.state == 'off' -%}off{%- elif states.fan.office_fan.state == 'on' -%}on{%- endif %}
      {% endif %}
    availability_topic: tele/fan_01/LWT
    payload_off: "off"
    payload_on: "on"
    payload_available: Online
    payload_not_available: Offline
    preset_modes:
      - "off"
      - "low"
      - "medium"
      - "high"
    preset_mode_command_topic: "cmnd/fan_01/FanSpeed"
    preset_mode_command_template: >
      {% if value == 'low' %}
        1
      {% elif value == 'medium' %}
        2
      {% elif value == 'high' %}
        3
      {% else %}
        0 
      {% endif %}
    preset_mode_state_topic: "stat/fan_01/RESULT"
    preset_mode_value_template: >
      {% if value_json.FanSpeed == 1 %}
        low
      {% elif value_json.FanSpeed == 2 %}
        medium
      {% elif value_json.FanSpeed == 3 %}
        high
      {% else %}
        off
      {% endif %}
finity69x2 commented 3 years ago

Thats because the fan config you are using uses presets and not percentages.

Where did you find that config for your fan? Was it from HA forum from a post of mine?

If so I should have posted a fan config using percentages as well.

Or if you want to use presets I am working on a plugin to use those as well so if you want to wait till I get that done then you can try that one.

vajonam commented 3 years ago

yeah. I figured natively the fan uses presets so that will be the right one, the config is from yours from HA forum. I can test the new control when available.