I’m not sure why it would go back to off.
I’m using that same config and mine doesn’t do that.
you can try removing the off preset mode and try it tho.
I’m not sure why it would go back to off.
I’m using that same config and mine doesn’t do that.
you can try removing the off preset mode and try it tho.
I removed the ‘off’ preset and this has now resolved the issue. The last preset shows in the device state attributes, the but the state is off, then it moves to on and whichever preset has been selected.
Not sure if that’s a bug in the new HA code or the way it’s designed to work?
This is the way mine works using the preset mode code I posted in post #1 above:
Is that not the way yours works?
Yes that’s right it does/was working just the same, but after some time, it was showing with the slider as on and preset as off. I’ve set one of my two fans back to have a preset of off and left the other without the preset of off so I can hopefully show more.
Sorry it took a while, but I built a test view in HA to show the issue. The fan shown here has this config in preset;
preset_modes:
- 'off'
- 'low'
- 'medium'
- 'high'
Here’s what can happen with that config - this is your awesome fan-mode-button-row card and a simple entity card for the same fan. The fan at the time was on medium, but after a short period shows as preset = off but still ‘on’. Another fan with the preset ‘off’ removed in the config doesn’t show any issues now, so that’s a simple fix, but thought I’d let you know the details.
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!
Anyone know why my MQTT commands are not changing the state of the entity?
are you having issues with the fan entity itself in HA because of the fan template or are the MQTT commands not working to change the state of the device even if you send the MQTT commands externally to HA?
IOW, if you send the MQTT commands directly to the device thru an external program (MQTTFx, etc) do they work there?
The commands are being sent and received by the ifan via MQTT (tried several devices, they all work). The issue is the ifan doesn’t to recognize the “stat/sonoff_ifan02_1/RESULT” or “tele/sonoff_ifan02_1/LWT” commands. I get “unknown” in the Tasmota console. Because of this despite the MQTT command turning the fan or fan light on, the actual entity in HA does not think its on and change the state, even though it did change.
More detailed info in post #41 above.
Hey all, I’m having an issue with this that I’m hoping someone here can help me with.
Setting the fan speed works well, however, if turning the light on or off then the fan speed preset goes to off. The fan itself is still running at the correct preset speed but HA thinks the fan is now off. This happens when switching the light on or off.
I’m hoping I just missed something obvious but it looks like others are having the same issue with the preset going back to off but I’m not sure anyone found out why. Removing the ‘off’ preset helped as suggested above but that leads to other unwanted behavior with automations.
Hi Finity & Gang,
I had (again with help from Finity) everything working fine prior to deprecated day …
I’m trying to enter the new world using the new YAML and Preset modes.
Issue is that when I use the suggested YAML in the first post here for Preset mode … I get an error in my configuration.yaml saying
"Misssing Property “Speeds”
I am using my own names for the topics, but I still get the error what ever topic name I use.
Any idea’s?
Kind Regards
Jason
By far, the easiest way to fix this currently is to use the HA Tasmota Integration, All this yaml is gone, and it just works…
Tasmota needs to be 9.2+(9.5 is current) and HA should be one of the current versions as well.
Totally agree … went down this path.
Now the issue is calling the fan speeds from the UI … or the cards that finity has generated.
It seems that all the speeds are the same … does anyone else have that ?
my finity icons work great.
You can look at my implementation on my config, I have the lovelace showing there.
GitHub - SirGoodenough/Home-Assistant-Config: My HA Configuration... This is what I run for production in my house..
I use the percentage in 3 places and some of the others.
@Sir_Goodenough - I use Tasmota and the new Tasmota integration for HA.
Also, I set up the fan in HA using the instructions here.
I am reading this entire forum topic page and I am also looking at your Github repo. But I am not able to understand what you guys are trying to achieve, as compared to the link I have posted above. Could you please explain?
Before the Tasmota Integration, there was a lot of yaml to make the fan work at all. I was suggesting they use the Tas-integ like you are and eliminate that YAML hassle converting 0-1-2-3 into percentages for happy HA…
Then, in your lovelace you have a bunch of manual yaml to give you buttons.
I use a HACS enabled integration to do that from finity.
{
"entity": "fan.office_fan",
"IsOffColor": "#F88416",
"IsOnLowColor": "#E78E85",
"IsOnMedColor": "#E54234",
"IsOnHiColor": "red",
"customTheme": true,
"customSetpoints": true,
"hiPercentage": 100,
"name": "Office Fan",
"type": "custom:fan-percent-button-row"
},
Is all that’s in my lovelace.
@Sir_Goodenough - Thanks for that. Your comment was really helpful in confirming to me that I am on the correct path.
@finity - thanks for your HACS plugins. I am using the “fan-percent-button-row” like mentioned above. The only point which tripped me up was: after installing the plugin, when I tried to use it in Lovelace, it said that the type was not found. This was reported here. Like you suggested there, it was solved by force-reloading the browser using Ctrl-Shift-R or Cmd-Shift-R.
I am so happy that the plugin shows the currently selected speed of the fan.
Now, is there a way to enable the speed selection via Alexa?
EDIT: I just realised that, having exposed the fan to Alexa via emulated_hue, I am able to control the speed of the fan in Alexa just like controlling the brightness of lights. That is, by saying things like “Alexa, Set the Living Fan to 66%” or “Alexa, Set the Living Fan to High” (Saying “Medium” does not work, though). This is good enough for now, I guess.
Thanks James C … I’ll scan thru … really appreciate your reply !
Relating to the wiring, I have it working, but I need to turn the fan on before I am able to turn the light on? This can’t be right, right?
Fan and light should be acting independently.