You need it set up in both places. Currently, your map in the speed template is getting values from brighness. Brightness is a int that spans 0 to 255. You set up your map as a flat list. It spans ints 0 to 7. So, when your brightness is set above 7, your speed template will fail. That will occur when you set your speed to any value other than off.
said it worked using first code posted up that was reason for posting incase anyone still needed a working route. i tried every other bit of could i could find after a few “by the book” tries doin it myself this way didnt look right but still works pretty good
so due to ocd i got it to work as per ur suggestion and seems to work pretty well thank you
not sure why it was also working before definately some typo or uncleared setting
Thanks for your OCD @pedzp14
I’ve got almost the same issue you’ve experienced. I’ve connected a bathroom fan to a zigbee dimmer and want to use that dimmer to regulate my bathroom fan. Deconz is propagting it to HA as a light, which in it;s essence is of course correct. I’ve searched the community’s and google for it and came across your post. I guess this fixes my problem. Especially the part with presets.
I do feel kind of a NooB now, because I can’t figure out where to put this code. Is it a sensor, is it anautomation, or??? Because when I adjust it to my own situation, no matter where I put in my config, I always get errors while checking the config.
So a slight push in the right direction would be greatly appreciated!
Im lost! I have tried this I feel like a million ways. I’m sure its something simple i am over looking here.
I have a Leviton wifi fan controller that shows up as a light and not a fan. so i tried to wrap fan config around it but I can only turn on/off the fan I cannot set any speed using the brightness. If I change the brightness of the light it does work but trying to change it on the fan entity fails.
You’re lost because this thread is 2 years old and there have been changes to template fan. set_speed and speeds has been deprecated. You should use the examples in the documentation page.
did you get this figured out? i am looking at the fan template page and see the changes from set_speed to set_percentage… tried changing the word speed to percentage in my config… it did not work… there is mroe to change i dunno what.
I am also here from the year 2022 trying to use the latest version of HA and not having much luck. It looks like low/med/high speeds are automatically calculated but I’m not even messing with that, I just want to convert to/from the number values. I think my fan entity is converting from the switch’s 255 value to the fan’s percentage correctly but when I set the percentage on the fan it doesn’t update my switch.
data_template is deprecated, set percentage passes a percentage variable when used. And 255 is already an int. You need to apply int to the entire expression.