Zwave fan speed control script

I asked some time ago how I could control a zwave fan with home assistant by voice (with the google assistant).

I can turn the fan on and off but for some reason it won’t let me do any speed control… on SmartThings this was as simple as saying “set fan to 50%”… it would control the fan switch just like any other dimmer… it seems like that’s the way it used to be in HA and I’m not quite sure why it was changed as that would have been superior to the low,medium,high options that we seem to have now…

Anyway, to get around the inability to do speed control by voice… I am trying to set up scripts for a couple of different pre-set speeds… opting for the low,medium,high method right now since trying to script for a percentage would be a nightmare…

My problem is that I have no idea what commands to use since there is very little (read none) documentation on zwave fan attributes that I can find. Anyone have any idea how I would create a simple script to set my fan to a low,medium, or high speed?

Did saying “turn on the fan to low” or something close not work?

@eric10k93 I don’t know what fan switch you are using, but the GE Zwave fan controls have 3-speed steps. I don’t think they can do infinite speeds. Check the switch documentation for what the different steps on your device approximate to as a percentage. Medium may, in fact, be 50% but it may be some other value.

It does not work unfortunately

…the GE Zwave fan switch definitely supports anything between 0 and 100… This was how it was done on SmartThings… There may be a limitation with HA that only allows certain pre-set speeds however. I am fine with pre-set speeds. The problem I am having is getting even those to work with voice controls. I can see the pre-set speeds in the HA UI but Google Assistant doesn’t allow me to reference those… So I was going to write a script to do it but I can’t figure out what the proper HA service calls are since there doesn’t seem to be any documentation on this…

I have found a LOT of discussions around fans in HA that seem to suggest HA used to use percentages by default and everybody was trying to figure out how to do the pre-set speeds… Not sure why since percentages work great… But now it seems everything has been moved away from the ability to control it like a dimmer…

I’m just hoping someone can provide me an example of a service call to adjust the fan.

Your investigation may have found references before there was actual support for the device in openzwave and HA. I went through that period and it was great when HA finally got fan support. If you are wanting to make real-time Zwave service changes to the device for adjusting speed, do remember, it will require restarting every time. I don’t have the Plus version of the device, so I do not know what might be possible with the new version. Looking through the Zwave options on my device, I don’t see anything necessarily promising.
Perhaps someone has.

You’re saying to adjust the fan speed while it is already running requires turning the fan off and back on again at the desired speed? I must be misunderstanding because that makes no sense and definitely isn’t required if the software supports it. Granted, HA may not support this… But if that’s the case, I may have to dig into the code to fix this myself.

To clarify, when I say “service” call I am simply referring to the built in functions within home Assistant such as “homeassistant.turn_on”

The whole reason I started this thread is just to find out what the call is for fan speeds… All I am looking for is something like “homeassistant.set_fan_speed” and an example of how I would pass a value such as “low” to that…

I couldn’t find anything in the docs that described this.

I was saying if you were wanting to change Zwave node values within the device, it requires restarting HA.

You should be able to get enough information by using tail against the OZW_Log.txt file. You should be able to construct something using the changed values. Have a look at https://www.home-assistant.io/components/fan.template/

I think the issue is that Home Assistant is presenting the fan to Google Assistant as a switch, not a fan. I have a couple of zigbee fan controllers and when I look in the home control section of the Google Home app they show as switches, whereas in Alexa they show as fans… for my zigbee fans the service call is fan.set_speed I believe. You should be able to find the appropriate service by clicking on the services icon under developer tools and then looking through the fan services…

Version 0.82 changed the device type to fan. There is a PR to expose the fanSpeed trait that has been merged to dev.

Do you have a link to any of the documentation on that or the PR? or the merge?

https://github.com/home-assistant/home-assistant/pull/18373

Could anyone, please, confirm if this has been resolved? I am unable to control fan speed via Google Assistant as of Oct 2019.

Definitely been resolved as of quite a few versions ago. What version are you on? I used to have to set up specific automations for the different percentages… but now I just connect the fan as a device in Google Home. It doesn’t use percentages, it’s “high” “low” and “medium”… now I just say something like “Hey Google, set bedroom fan speed to high”

I am on the latest version 101. Are you able to see fan speeds in the google home app interface?

No, for some reason they have never enabled physical fan controls in the Google Home app… It just shows up as a linked fan and I can put it in a room and control it by voice.

If I need to be quiet about turning on a fan, I just use the HASS web interface on mobile.