Hi, I am having trouble getting the ifan02 to respond correctly. It is on Tasmota 9.1.0. Setup as an iFan02 per the Tasmota wiki:
I’ve copied the code from post #1 above for the fan, here is my configuration.yaml for both the light and fan:
light:
- platform: mqtt
name: "Living Room Fan Light"
state_topic: "stat/sonoff_ifan02_1/POWER1"
state_value_template: "{{ value_json['values']['POWER1'] }}"
command_topic: "cmnd/sonoff_ifan02_1/POWER1"
availability_topic: "tele/sonoff_ifan02_1/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
fan:
- platform: mqtt
name: "Living Room Fan"
command_topic: "cmnd/sonoff_ifan02_1/FanSpeed"
state_topic: "stat/sonoff_ifan02_1/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.master_bedroom_fan.state == 'off' -%}off{%- elif states.fan.master_bedroom_fan.state == 'on' -%}on{%- endif %}
{% endif %}
availability_topic: "tele/sonoff_ifan02_1/LWT"
payload_off: "off"
payload_on: "on"
payload_available: Online
payload_not_available: Offline
percentage_command_template: >
{% if value == 33 %}
1
{% elif value == 66 %}
2
{% elif value == 100 %}
3
{% else %}
0
{% endif %}
percentage_command_topic: "cmnd/sonoff_ifan02_1/FanSpeed"
percentage_state_topic: "stat/sonoff_ifan02_1/RESULT"
percentage_value_template: >
{% if value_json.FanSpeed == 1 %}
33
{% elif value_json.FanSpeed == 2 %}
66
{% elif value_json.FanSpeed == 3 %}
100
{% else %}
0
{% endif %}
qos: 1
I have a Lovelace card using the fan-percent-button-row.js from your GitHub dated 5-June, with the fan and light:
type: entities
entities:
- entity: fan.living_room_fan
type: custom:fan-percent-button-row
secondary_info: last-changed
- entity: light.living_room_fan_light
icon: hass:ceiling-light
secondary_info: last-changed
That gives me a card that looks like this:
So here is the PROBLEM:
Fan: If I click the “HIGH” button on the Lovelace card the fan turns on high but I get no response on the card, the “OFF” button remains highlighted blue. The “MED” and “LOW” buttons also change the speed, but again, they don’t highlight, the “OFF” button stay blue. Pressing the “OFF” button does nothing. It doesn’t respond at all. I have to click on the words ‘Living Room Fan’, the slider is at ‘0’ even through the fan is on high, med, or low. I have to drag it right a little and then back to 0 to get it to turn off.
Light: similar problem. If click the toggle next to the ‘Living Room Fan Light’ it momentarily slides right and blue, the light turns on, but then the toggle goes back to off even though the light is on. Subsequent actuations of the toggle do nothing since the light is already on. No way to turn it off.
I think the problem is my iFan02 Tasmota does not recognize the commands “RESULT” nor “LWT” for the ‘state_topic’, ‘percentage_state_topic’, and ‘availability_topic’ MQTT commands. I get ‘{“Command”:“Unknown”}’ for both in the Tasmota console when I try “stat/sonoff_ifan02_1/RESULT” or “tele/sonoff_ifan02_1/LWT” in the console. However, changing the word to ‘FanSpeed’ gives a result. See below:
Any insights onto why “RESULT” and “LWT” are not recognized or why I can send commands but not receive feedback from the device is greatly appreciated, thanks!