# How to control light with analog signal input and no analog output

**URL:** <https://discourse.nodered.org/t/how-to-control-light-with-analog-signal-input-and-no-analog-output/48094>\
**Category:** General\
**Created:** [6 July 2021 20:01 UTC](https://discourse.nodered.org/t/how-to-control-light-with-analog-signal-input-and-no-analog-output/48094 "2021-07-06T20:01:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndriesS82](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andriess82/32/35842_2.png) [@AndriesS82](https://discourse.nodered.org/u/AndriesS82)\
**Post date:** [6 July 2021 20:01 UTC](https://discourse.nodered.org/t/how-to-control-light-with-analog-signal-input-and-no-analog-output/48094/1 "2021-07-06T20:01:15Z")

</div>

Helo,

I am looking for a program solution to control a light.  
Discription:

I use an eltako dimmer EUD12Z UC with SUD12 0-10v eltako to normal 0-10v converter.  
When I press the button then the lights go's on. Pressing long then the dimming effect starts. The value of the analog signal is changing.  
I will bring this analog signal into Arduino with a voltage divider. Then i will see on what brightness the lights ar shining.  
But now the tricky part. How can I regulate this with a fader? In home assistant i can make input\_numeric and set value between 0-100. If i set it to 65 brightness i should regulate the light dimmer to 665 analog value (1024/100\*65).  
How can this be done with node red that it works automaticaly? If it starts from 0 then it should run up and slow down to reach the analog value. When its to far it should go down.

Is this even possible???

regards  
Andries

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 July 2021 20:19 UTC](https://discourse.nodered.org/t/how-to-control-light-with-analog-signal-input-and-no-analog-output/48094/2 "2021-07-06T20:19:49Z")

</div>

> [@AndriesS82](#):
>
> How can I regulate this with a fader? In home assistant i can make input\_numeric and set value between 0-100. If i set it to 65 brightness i should regulate the light dimmer to 665 analog value (1024/100\*65).

You can use a range node to map 0-100 to 0-1024, followed by a change node to floor the value.  
e.g.

```auto
[{"id":"ab556716.b58c4","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"65","payloadType":"num","x":100,"y":3640,"wires":[["55294b5f.144964"]]},{"id":"55294b5f.144964","type":"range","z":"c74669a0.6a34f8","minin":"0","maxin":"100","minout":"0","maxout":"1024","action":"scale","round":false,"property":"payload","name":"","x":260,"y":3660,"wires":[["75973e87.4980b8"]]},{"id":"75973e87.4980b8","type":"change","z":"c74669a0.6a34f8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$floor(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":3700,"wires":[["2718fd9c.8710ca"]]},{"id":"2718fd9c.8710ca","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":480,"y":3640,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![AndriesS82](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andriess82/32/35842_2.png) [@AndriesS82](https://discourse.nodered.org/u/AndriesS82)\
**Post date:** [7 July 2021 19:13 UTC](https://discourse.nodered.org/t/how-to-control-light-with-analog-signal-input-and-no-analog-output/48094/3 "2021-07-07T19:13:20Z")

</div>

Thx!  
I will try that!  
I will come back on this topic. For the moment I don't get a 0-10v signal at all... have to solve this first if i won it to work.

---

<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:** [5 September 2021 19:14 UTC](https://discourse.nodered.org/t/how-to-control-light-with-analog-signal-input-and-no-analog-output/48094/4 "2021-09-05T19:14:00Z")

</div>

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