Controling notification LED as if it was an independant light entity

Hi all,

I’m looking for a way to configure my red series switch notification LEDs in a more user friendly way than writing scripts to interact with zwave.js switch parameters. Ideally it would all be doable in the UI without writing a single line of code. Exactly as with light entity which, in essence, the notification LEDs are : RGB lights. Has anyone thought of creating independent light entity mapped to the right switch parameters?

I found this script : Inovelli Z-Wave Dimmer Status LED in Home Assistant | Brian Hanifin to work for controlling notifications but I’d like to take it a step further and I’m looking for help.

My programming skills are limited but not absent so any pointer to help me start would be appreciated.

Have you seen this tool by Nathan?
https://nathanfiscus.github.io/inovelli-notification-calc/

You can use it to figure out the parameter values that you can use to directly control the LED bar color, intensity, and effects (notification patterns)

When you have the values then you just set the related parameter to the desired value. I don’t know specifically how to do that in HA, but its very easy in Hubitat and SmartThings and I suspect its similarly simple in HA with whatever method it uses to ‘set parameter = value’

1 Like

thanks, I did not see that tool before but the maths are already part of the script in the link I provided “{# Preform the Inovelli mind bending mathmatics automatically for us! :slight_smile: #}
{{ colors[color|title] + (level * 256) + (durations[duration|title] * 65536) + (effects[effect|title] * 16777216) }}”

Its also easy to control parameters in HA manually but it is not so easy to control multiple parameter on multiple switch simultaneously without writing some code and this is where I am looking for a way to abstract that complexity into an HA specific concept called an entity. It would be nice for a generic solution to exist but my focus is on the notification LED parameters which could be mapped to an already existing entity class for lights.

You’ve seen the template light entity, right? I’d think that’s what you’d want to build, but I really don’t know how. Maybe with it and Brian’s stuff you can come up with the values for each item for the template light.

It’d probably not be very easy to do fully. To change brightness you should read parameter 16, pull out the 3 parts not changing (color, effect duration and effect type) and then write it back with the new brightness ( brightness / 255 * 10)|int )

But, you could start with trying brightness and color temperature by fixing the effect duration to forever = 255 and the effect to solid = 1 and then templating the color temp and level into light and see what happens. Get the values from the switch only if it’s necessary.

1 Like

Who is deciding what data point gets presented as an Entity and which is presented in some other manner? I’d think it’s the creator of the HASS integration and not the manufacturer?

I didn’t know there was a light templating option in HA. That’s probably what I was looking for. I’ll look into it but I agree that it doesnt look simple. Thanks.

Maybe first start with something simple like turn_on send 255 + brightness / 25.5 * 256 + 255 * 65536 + 1 * 16777216 to parameter 16 and turn_off send 255 + 0 * 256 + 255 * 65536 + 1 * 16777216 to parameter 16.

This would set the LED to the brightness of the light or to 0 brightness which is off. Color would be white.

Then, expand on that if you get it working.

A light doesn’t have a duration or effect so duration would always be 255 = infinite and effect would be 1 = solid.

You aren’t changing it any other way than using HA, so you really shouldn’t have to pull the current brightness and color and such from it.

Another option might be to bring the zwave devices into HA with MQTT (zwavejs2MQTT) and then use the MQTT light platform. Probably not ideal though, you’d have to disable all the duplicate entities that’d create that you don’t want, but then you also might be able to do that in zjs2MQTT.