# Change light brightness that are on

**URL:** <https://discourse.nodered.org/t/change-light-brightness-that-are-on/70243>\
**Category:** General\
**Created:** [8 November 2022 08:51 UTC](https://discourse.nodered.org/t/change-light-brightness-that-are-on/70243 "2022-11-08T08:51:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djseek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/djseek/32/67001_2.png) [@djseek](https://discourse.nodered.org/u/djseek)\
**Post date:** [8 November 2022 08:51 UTC](https://discourse.nodered.org/t/change-light-brightness-that-are-on/70243/1 "2022-11-08T08:51:28Z")

</div>

hi all

i stole a flow from here 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 when my home mode goes from day to evening.

Here's what i'm trying which is giving error, i'm sure it's an easy fix but i'm not sure how to do it in the node "evening mode brightness"

thank you

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 November 2022 10:52 UTC](https://discourse.nodered.org/t/change-light-brightness-that-are-on/70243/2 "2022-11-08T10:52:34Z")

</div>

I see you are using Home Assistant. You would be better sered asking about this on their forum.

Also I fixed your pasted code. In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![djseek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/djseek/32/67001_2.png) [@djseek](https://discourse.nodered.org/u/djseek)\
**Post date:** [8 November 2022 18:48 UTC](https://discourse.nodered.org/t/change-light-brightness-that-are-on/70243/3 "2022-11-08T18:48:41Z")

</div>

thank you. i posted on mobile and didn't see the code option i know how to use it on desktop.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 January 2023 18:49 UTC](https://discourse.nodered.org/t/change-light-brightness-that-are-on/70243/4 "2023-01-07T18:49:40Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
