I have installed my first zwave device (GE 3-way dimmer) and it seems to be working fine in HA as a “light” that I can turn on and off…so far so good. What I can’t seem to figure out is how to modify the brightness level in HA. I would like to just ad a few light.turn_on cards to lovelace…say one at 25%, one at 50% and one at 75% just so I could get a feel for how that works. After that I can start working the skill into my automations. I’ve looked and looked and can’t seem to find a way to make that work. I feel like i’m missing something obvious but still can’t seem to put my finger on it. I can’t be the only one who wants to use HA to adjust the brightness of a z-wave dimmer switch. Thanks in advance for any help!
Here is my Dimmer Manager
Basic config
Data Config
![image](http://community-assets.home-assistant.io/original/3X/c/8/c8caed1f5defdc32ae3965c7f9230dcd7241aeaf.png)
data config shows how to set the dimmer value directly. It’ll turn on to its last value then immediately change to its new set value.
You aren’t, but you don’t need to specify GE. You’re inadvertently filtering out all the relevant posts.
All lights work the same way. They all have a brightness attribute that can be passed when turned on.
If you call the turn_on service without a brightness, the lights will resume to a previous level:
service: light.turn_on
entity_id: light.my_ge_light
If you want to add a brightness
#Turn on light to 25%
service: light.turn_on
data:
entity_id: light.my_ge_light
brightness: 64
Now you’ll notice that 64 == 25%, what gives? Well all lights in home assistant have a brightness range from 0 to 255. So if i want 25%, i have to do math. 255 * 0.25 = 63.75.
But that sucks doesn’t it? Why can’t we just place a percent.
Well you can, with a different attribute brightness_pct
#Turn on light to 25%
service: light.turn_on
data:
entity_id: light.my_ge_light
brightness_pct: 25
All of this is covered in the light documentation. You should get used to using the documentation. It’s 100% better than the forums. The forums have outdated information where as the documentation is spot on and usually has basic examples.
Now getting it as a button is a little more challenging. I’d say, start out looking at lovelace, watch the video to figure out how to adjust your interface. Then attempt to make a button-card using a call service with the correct information to turn on a light to 25%.
Ok, thank you both for the examples, I look forward to trying them out. My feeble defense is that I’m merely a hobby/closet geek and am only 3 months new to home automation and 2 weeks new to my (one) Z-wave device. I have read a lot and learned about Hassio, Sonoff, Flashing Tasmota, ESPHome, ESP8266 flashing, YAML, HA, Shelly1, Z-wave, Attributes, Devices, Services, Automations, MQTT etc., etc. mostly by reading and only posted to a forum twice as a last resort.
Petro, thanks for the link to the HA //Light Integrations page. That would not be the first place I would have thought to look for configuring a Z-wave dimmer but I’ll read it and try to figure out how to get the results I’m looking for.
I was unaware that (apparently) all z-wave devices are the same as to available states and attributes and that setting up a z-wave dimmer for brightness is (what I’m gathering) the same regardless of brand. That may explain why I could not find a GE Z-Wave Dimmer Integration (I looked).
Doranagun, your Node-Red page is very impressive and I have not learned that tool yet. I will try to implement the “basic config” you offered, thank you.
While trying to find the answer to Zwave dimming on my own, I noticed that other folks were asking similar questions about how to make z-wave dimmers turn on at a certain brightness (other than what they were turned off at) and that there were few, if any, answers so this is the most information I have seen so far. I understand the difference w/ the 0-255 and 1-100% situation, so no worries there.
I know everyone is working here for free but I think a document section on Z-wave dimming would be helpful. I would be happy to write it myself but I’m so new to this it’s beyond my current skill level.
Again, I am looking forward to trying out the suggestions I have received so far and would love more information on how to configure a Lovelace card to turn on dimming at a certain specified level.
Thanks to all!
Petro, thank you very much, I was able to get your code to work in the "Developer Tools" >> Service section of HA, thank you very much! At least it is nice to see it working.
At the risk of asking a really stupid question, where do I use that code? I mean it works in the Developer Tools >> Service section of HA, but if I want to change of brightness in an automation…do I put it into a script, a template, or just write it directly into the automation? Again, sorry for the stupid question, I’m a total noob to all this.
services can go in the action section of an automation or inside a script.
You don’t so much have lovelace do it unless you want multiple ON buttons each with a different value. You can use automations to do it based on time similar to my node-red flow. just in automation. Trigger is state OFF changes to >0 (greater than 0)
Condititions would be a time window X to Y. resulting in the brightness_pct: XX being run against the light entity.
WHen I started getting into HA 3 months ago i looked into automation methods I found the “Automations” needlessly… difficult. NR is easier once you work out its idiosyncrasies. Its by no means simple… but you can make it do things with many more steps and actions than the automation screen allows. Programming it in YAML is for the ubernerds around here.
I come out of PLC and DCS programming so the NR mechanic is easy to comprehend.
If you’ve installed the HACS custom component, there’s a new card available called Light Brightness Preset Row. It is configured to offer low, medium, high and off buttons for a prescribed light.
Saves creating different scripts
OOhh nice. I did not know about that card… Also good for fans.
I think it only made it into HACs yesterday
Ahh… looking at those they only work under full YAML edit mode… Ubernerd Mode. that is beyond me as of yet.
I’l stick to my nodered time windowed dimmer manager.