All lights that are on - change brightness

hi all

i stole a node red flow some time ago that gets all lights that are on and turns them off

i’d love to use this to auto change my lights brightness (only those that are on) when my home mode goes from day to evening. I have the trigger setup fine in teh full node but the sample below i am not sure of the format to pass the brightness through.

I’d greatly appreciate any advice.

thank you

[{"id":"f2677c379f9a1297","type":"ha-get-entities","z":"cf558353c0517902","name":"get lights that are on","server":"f9088194.9ff3a","version":0,"rules":[{"property":"entity_id","logic":"starts_with","value":"light.","valueType":"str"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":1200,"y":360,"wires":[["11529c2a6313b4e9"]]},{"id":"11529c2a6313b4e9","type":"api-call-service","z":"cf558353c0517902","name":"evening brightness","server":"f9088194.9ff3a","version":5,"debugenabled":false,"domain":"light","service":"toggle","areaId":[],"deviceId":[],"entityId":[],"data":"{\"entity_id\": $join(\"brightness\":130,\"color_temp\":550.entity_id,\",\")}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1430,"y":360,"wires":[["3861a7f384cd3e86"]]},{"id":"f9088194.9ff3a","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

no one? surely it’s been done? thank you

{
    "brightness": 130,
    "color_temp": 550,
    "entity_id": $join(payload.entity_id, ",")
}
1 Like

thank you so much that works.

woudl you happen to know how to exclude an entity id under property state? i.e if there was the word “strip” in the entity id? i’ve tried a few variations and can’t get that to work. thank you again

i added not in thinking that would work with your examples on a few other discussions. but it is still updating those strip lights. image

not in and is not no luck.

not in works for me as expected.

You can also try regex so you don’t have to type out each light

image

hmm odd i am combining it with starts with light. and powered on and added the property not in and it doens’t work. still updates the strip. with is not or not in and as reg ex.

thanks for trying appreciate it .

been trying this for a while still no luck - it’s still applying the change to the strip. any other tips? thank you

image

Any idea what can cause this to have lights get picked up that are off ? Their state is off but it’s still sending it through and changing brightness.

Seems to only happen on certain lights like lifx non down lights.