Help with automation in Home Assistant not recognizing/allowing selection of red dimmer

Hello again -

My Red Series Dimmers made it to me, and I installed a few over the weekend. As I’m creating automations in Home Assistant I can’t find the option to toggle anything with the dimmer in any of the call service options. I’m not sure if I haven’t enabled something somewhere, but my dimmers are added to zwave JS and I can toggle them just fine from the dashboard. Any ideas?

My goal is to create an automation that toggles the dimmer to a certain level based on time of day when motion sensor is tripped. I would love any experience or tips you guys might have in that direction.

Thank you!

light.turn_on

Here is what I used in an automation. It puts the lights bright during the day and dim over night.

  - service: light.turn_on
    data_template:
      entity_id: light.bathroom_vanity
      brightness: >
        {% if now().strftime("%H")|int * 3600 + 60 * now().strftime("%M")|int > state_attr('input_datetime.bathroom_night_start', 'timestamp')|int %}
          20
        {% elif now().strftime("%H")|int * 3600 + 60 * now().strftime("%M")|int > state_attr('input_datetime.bathroom_day_start', 'timestamp')|int %}
          250
        {% else %}
          20
        {% endif %}

Brightness goes from 1 to 255. I believe there is a brightness_pct: that could be used instead as 0-100 in %.

If you use the developer services tool you could create one to see the yaml it creates.

1 Like

You can use two types of automations. The built in HA automations or use the add-on Node Red. I personally prefer Node Red but I started doing automations before the HA automation engine was as robust as it is now.

Point is, play around, find a tool you like and enjoy!

1 Like

Thank you!

Now that I’ve had a few days to play around, how do I format the percentage I want? I’m sorry if that’s a stupid question, I’m starting at the beginning.

When you’re creating an automation like this in Node Red, I have it working just fine with motion detection and my hang up right now is getting the level set correctly. If I understand correctly it goes into the data field of the call service node, but I can’t get it formatted correctly or something and now I’m getting an error when I try to trigger the automation.

I’ve never used percentage before. I’ve seen it in examples but they didn’t work. I haven’t tried that brightness_pct yet though, the examples had stuff like brightness: 75%. It appears you just use a number 1 to 100 with it, no percentage sign. Try things in the developer tools until it works. Sometimes, data needs quotes around it.

Create and automation that results in the effect you want.

Run the actions of the automation.

If it works, look at the .yaml of the automation and see what the exact text/string/number is.

No need to create an automation. Use the Services in the developer tools. Pick the light.turn_on from the drop down and click entity and find the light.xxx where xxx represents the name of the light. Fill in various values you want to test. Hit the call service button to try it, which you can do as often as you need until you get it working how you want. When it works, click the switch to yaml button to see the code you need.

They did a lot of work on that services tab fairly recently, and it’s so, so much easier to test things there now.

3 Likes

Oh nice. I’ll have to check that out.

I’ve been running through different scenarios today with this tab (thank you very much, btw) and I haven’t been able to change the brightness of the red series dimmer at all. I can turn it on/off but I when I turn it on it only reverts back to its last state. Any other areas that I could investigate? Any way to change the brightness level inside Node Red would work for me, I just haven’t found any yet.

Thank you!

Can you control your dimmer level from the paddles? It almost sounds like there is an issue with the setup of it.

The service tab works for me, so it’s not broken in general. I tried it using “pick entity”, “pick device” and “pick area” combined with clicking the box beside the brightness value or brightness (but not both at the same time) and they all worked. I didn’t try any other options because I’m fairly certain none of the other options except transition time are valid for a red dimmer.

Take a screenshot of the call.

Should be light.turn_on with the device selected and brightness_pct slider set in order to set to that brightness. If no brightness is specified, the dimmer will dim to the default level as set by parameters, default is 99.

This worked for me in testing right now:

Finally got this to work! Thank you! What do I do with the yaml now that I have it? How do I convert that into the json expression I need in order to trigger the correct action?

I think you were right - I went through and reset all of my settings to default, still couldn’t get it to work, excluded the dimmer and re included it. I can control it from that panel now. I have the yaml from the settings with the dimmer setting I want, but I’m struggling now to format it correctly for the call services tab in Node-Red. Any success in that area? Thanks again for your help.

I’ve never done it before. I think you just need the data part from the yaml, so you’d need the brightness_pct: 53 for example. Maybe {} brackets around it?