Home Assistant - 2nd Gen Switch RGB working!

I don’t recall there being a color value for 0. Are you trying to get white? White is 255 I believe, while red is 1. White is only supported on firmware 1.47+.

Also if you use my automation above, you can customize it by opening the subflow like so:

I use 50268712 for my forever yellow chase automation, but if you want a different effect check the link here and click the notification section. Then select Fan/Light Combo dimmer, set your color options, brightness preferences, duration preferences and effect type of your choice. Then Copy the below value and replace my value 50268712 with your new value. Also, if you use the Fan/light switch you will need to change my parameter value of 16 with 24, since that is the option for fan/light switches :slight_smile:

Also don’t forget to do the same for the other two subflows. Again, this is just for my automation above though. It should work with those minor adjustments for the Fan/Light switch (I don’t have one so I cannot test it unfortunately).

1 Like

0 is pure red, 1 is red with a tinge toward orange. You are correct that 255 is white.

Gotcha, did not know that sorry about that! Looks like that can be calculated still though. Click on here, go to notifications, set up your automation as you want but set the color to 1 and configure your other preferred options. Once set up, just reduce your value by 1. So if you end up with a value of 17107457 (this is color value 1, brightness 10, for 5 seconds with a solid effect), to get color of 0 it should just be 17107456 assuming I follow the number calculations correctly. :slight_smile:

1 Like

I’m getting an API Error using this, and I’ve eliminated server name as the issue. I’m using ZwaveJS, is it possible that this node isn’t compatible?

Here are the nodes in question:

Flow StatusMgr

See any issue here?

This is sending a signal to the Z-wave integration, not the Z-wave JS integration.

So far they have not developed the ability to set parameters through Z-wave JS yet. Z-waveJS2MQTT does have this ability through MQTT, but I am holding out for the developers to make this available via Zwave JS server integration.

So basically RIGHT NOW (2/24/21) you are out of luck unless you roll back to 1.4 integration (Z-wave). Development is moving forward with replicating this feature in Zwave JS but it might take a few months.

And believe me, all of my switches are purple because it was snowing when I swapped over. I usually have them white. I can’t wait either.

I was just looking around and realized… yeah, this is probably setting ozw.set_config_parameter, which I don’t have.

I haven’t played with MQTT. I’m hoping I can avoid having to learn another protocol. I’m not a programmer, so just stringing together some working JSON is a stretch for me.

Purple = snow? I just look out the window! :grin:

Haha, yes rain is cyan and snow is purple based on forecast, not current conditions!

ozw.set_config_parameter is actually a THIRD integration for the OpenZwave (beta) integration. That was what I came from and it worked just fine, but is NOT the same as Zwave JS.

Confused yet? Hope I’m adding some clarity.

Hey @pdong I opened a pull request some time ago for allowing 0 as a color (true red), is that something you would entertain incorporaing?

Also, if possible (I know this is asking a bunch) could you make a dropdown for z-wave integration and incorporate the new zwave_js.set_config_parameter event passing? They have abandoned the node_id strategy and replaced it with entity_id or device_id:

Not sure if you are watching here anymore, but figured i would ask.

Kevin

@nappyjim @harmfulmushroom have either of you figured out or developed a subflow node for the new zwave_js.set_config_paremeter? I’m no coding expert but my switch bars are very lonely right now.

Hey there, I do actually have one working with ZWaveJS! I’ve been trying to make a swiss army knife type subflow for the switches, so in addition to being able to set notifications, it could also set the on/off brightness and the permanent color if desired. Still working out a couple last things, and then I can post it here.

It could probably use some optimization though, and it only works with dimmers right now… Might work with the LZW36’s, I added support, but I don’t have a switch to test it with… It also can’t set values above 83823359 for some reason, not sure why since zwavejs2mqtt now accepts those values just fine… I hardcoded a set value if the calculation ends up being above that number for now to avoid errors.

Hope to have it finished up very soon, I’ll let you know once I post it!

2 Likes

@kreene1987 seems like mushroom is making a more in depth one. Heres a rather simple one. I havent messed with too much with JS yet aside from a test rig.

Note you cant set parameter 16 past 83823359 with this setup, you would have to set through MQTTJS to do this. @petro can better explain why this is the case if you care.

But here it is. Will split whatever parameter and value you put into the change node, and send it to every switch that you have connected to the split node.

Nice thing about JS is it uses entity_id instead of node_id. So even if you remove and then re-add a switch, you dont have to remember to go into the service node and change the node_id; as long as you make sure to just rename it the same when you re-add it, that is.

[{"id":"489e3fe7.a92bc","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"e96290d.8579b7","type":"inject","z":"489e3fe7.a92bc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":160,"wires":[["5a1b552a.bb24ec"]]},{"id":"e453250c.a3a398","type":"change","z":"489e3fe7.a92bc","name":"Chase green","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"parameter","pt":"msg","to":"16","tot":"str"},{"t":"set","p":"value","pt":"msg","to":"50268771","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":220,"wires":[["2b42b783.e45af8"]]},{"id":"2b42b783.e45af8","type":"split","z":"489e3fe7.a92bc","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":730,"y":200,"wires":[["a247bf87.d839d","3299ba73.3da836","715dbfb0.fa9f9","d7c5820f.f090c","f70f3a33.1a7788"]]},{"id":"5a1b552a.bb24ec","type":"change","z":"489e3fe7.a92bc","name":"Solid magneta","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"parameter","pt":"msg","to":"16","tot":"str"},{"t":"set","p":"value","pt":"msg","to":"33491677","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":160,"wires":[["2b42b783.e45af8"]]},{"id":"3be19a96.349f66","type":"change","z":"489e3fe7.a92bc","name":"Fast blink red","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"set","p":"parameter","pt":"msg","to":"16","tot":"str"},{"t":"set","p":"value","pt":"msg","to":"67045888","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":280,"wires":[["2b42b783.e45af8"]]},{"id":"a247bf87.d839d","type":"api-call-service","z":"489e3fe7.a92bc","name":"Office","server":"456659de.370498","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"light.red_series_dimmer","data":"{    \"parameter\": {{parameter}},    \"value\": \"{{value}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":990,"y":120,"wires":[[]]},{"id":"8629a43f.9971f8","type":"inject","z":"489e3fe7.a92bc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":220,"wires":[["e453250c.a3a398"]]},{"id":"e30a9b8e.e619a8","type":"inject","z":"489e3fe7.a92bc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":280,"wires":[["3be19a96.349f66"]]},{"id":"3299ba73.3da836","type":"api-call-service","z":"489e3fe7.a92bc","name":"Bedroom","server":"456659de.370498","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"light.bedroom","data":"{    \"parameter\": {{parameter}},    \"value\": \"{{value}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":180,"wires":[[]]},{"id":"715dbfb0.fa9f9","type":"api-call-service","z":"489e3fe7.a92bc","name":"Kitchen","server":"456659de.370498","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"light.kitchen","data":"{    \"parameter\": {{parameter}},    \"value\": \"{{value}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":240,"wires":[[]]},{"id":"d7c5820f.f090c","type":"api-call-service","z":"489e3fe7.a92bc","name":"Basement","server":"456659de.370498","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"light.basement","data":"{    \"parameter\": {{parameter}},    \"value\": \"{{value}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":300,"wires":[[]]},{"id":"f70f3a33.1a7788","type":"api-call-service","z":"489e3fe7.a92bc","name":"Living room","server":"456659de.370498","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"light.living_room","data":"{    \"parameter\": {{parameter}},    \"value\": \"{{value}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":360,"wires":[[]]},{"id":"e2f8dd9a.bf115","type":"comment","z":"489e3fe7.a92bc","name":"Note: Parameter 16 value cant be any higher than 83823359.  So anything with pulse effect cant be used","info":"","x":460,"y":60,"wires":[]},{"id":"456659de.370498","type":"server","name":"AvilaSmartHome","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]`
1 Like

This works for me. I added a “clear” node to set the parameter to zero and clear the notification.

@kreene1987 I posted my subflow here if you’re still interested:

1 Like

I’m now using this in Node-RED to set the status LED parameters and it’s working well. The only thing I don’t like is that when I tap the physical switch, the notification goes away. I suppose that’s by design, but I wonder if there’s a way to allow the notification to persist without doing a bunch of Node-RED gymnastics to reset the parameters.

@DeltaNu1142 I had the same issue then switched over to just changing the led default color for certain scenes and then switching it back when that was over. You don’t get the cool animated effects, but for something like ‘movie time’, it turns the default colors from blue to white. Then I just use the notifications for temporary alerts that are meant to be seen but once 'acknowledged goes away.

Later firmware 1.42+ fixed this. If you are able/willing, z2m has the UI to enable this, ZJS is coming out soon with this feature as well.

Make sure you follow the support documentation and update both targets!

I’m on v1.21 on my switches and v1.48 on my dimmers, yet I’m not seeing an option for it. Z2M is 0.13.0 as of this morning. Maybe I’m missing it in the config…

It’s not a setting, it’s firmware related. If you properly send a notification to the switch with indefinite length, then hit the switch it will temporarily go to it’s color set and do what you ask, then afterwards bring the notification back.

If it’s not doing that then it might not have taken the firmware update OR you might not be sending as notification, but rather an LED color and intensity change?

I meant to come back to this… it is in fact working correctly! The last time I attempted it, it didn’t work and it must have been due to an earlier version of ZwaveJS to MQTT. I haven’t updated firmware in any of my switches in quite a long time.

Thanks.

1 Like