LZW42 Color Prestaging - Zwave JS

Has anyone found out how to properly implement color prestaging for the 42’s such that when the lights are turned on they are already set at the proper color?

I use adaptive lighting integration, but haven’t been able to get this to set the lights properly without turning them on, even using the turn_on as false in the service call.

Just looking to see if anyone has figured this out? Thanks.

1 Like

This is more of a Home Assistant limitation and not a zwaveJS limitation. I use zjwavejs2mqtt, and can set the bulb color even if the bulbs are off

1 Like

Hi,

Just wondering how you accomplished this? I’m interested to do the same

I just use MQTT to publish the message (the exact topic may vary depending on how you set up zwavejs2mqtt) Here is what mine would look like to set Node 8 to the color green. This works even if the bulb is off:

topic: zwavejs/nodeID_8/color/endpoint_0/targetColor/set
Payload:{ "warmWhite": 0, "coldWhite": 0, "red": 0, "green": 255, "blue": 0 }

Thank you for sharing! I’m not using the MQTT part of Zwavejs2mqtt, but I’ll see if I can figure out how to do something similar.

No, I gave up on it but will revisit! Tag me if you figure it out :D!

1 Like

@kylesmittie @kreene1987 this may work. Just ran across it in the HA FB group

DEFAULT TURN-ON VALUES

To set the default color, brightness and transition values when the light is turned on, create a custom light_profiles.csv, normally located in the default configuration folder where you find configuration.

1 Like

I think that would work for a constant start, but I rely heavily on circadian rhythym via adaptive lighting integration. I’d like to pre-stage the color changes (2700K to 6500K) throughout the day.

There is a way to set the color via the ZWaveJSMQTT control panel (under the “Color Switch” settings, targetColor). You can pass a value like jtronicus mentioned: { "warmWhite": 0, "coldWhite": 0, "red": 0, "green": 255, "blue": 0 }. I believe the HA service zwave_js.set_value can be used to accomplish this… just need to figure out the proper parameters for things like Command Class ID and all that. I’m fiddling with it now, will report back if I figure it out.

Command Class ID is 51. Though I can’t figure out the value format for “targetColor”, but was able to get things working with hexColor. Here is an example service call.

service: zwave_js.set_value
data:
  command_class: '51'
  endpoint: '0'
  property: hexColor
  value: '#FF0000'
target:
  device_id: xxxxyyyyzzzz

The targetColor service call would be something like:

service: zwave_js.set_value
data:
  command_class: '51'
  endpoint: '0'
  property: targetColor
  value: ???????????? (not sure on the proper format here)
target:
  device_id: xxxxyyyyzzzz
2 Likes

You can set individual color components (R, G, B, WW, CW) with this command:

service: zwave_js.set_value
target:
  entity_id: light.office_rgb1
data:
  command_class: '51'
  property: targetColor
  value: 255
  property_key: '1'
PropertyKey Color
0 Warm White
1 Cold White
2 Red
3 Green
4 Blue

Ideally, we would want to set all color components at the same time though. I havent figured out how to do this with HA yet.

2 Likes

I think there may be a bug with zwave_js.set_value that prevents it from working when passing an object as the value, which is needed to set the full targetColor. I’ve opened an issue on the homeassistant core github: zwave_js.set_value not working when value is an object · Issue #57336 · home-assistant/core · GitHub

3 Likes

This works for me:

service: zwave_js.set_value
target:
  entity_id: light.den_reading_lamp_2
data:
  command_class: '51'
  property: hexColor
  value: "#ffff00"
1 Like

Yes, hexColor works for me as well. However you cannot adjust the warm white or cool white values with that.

Hi, I was wondering if you had any luck with this

Found the answer in kylesmittie’s github issue - Link here

1 Like