# How to counting light?

**URL:** <https://discourse.nodered.org/t/how-to-counting-light/75218>\
**Category:** General\
**Created:** [15 February 2023 07:35 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218 "2023-02-15T07:35:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [15 February 2023 07:35 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/1 "2023-02-15T07:35:34Z")

</div>

Hi everyone,

i face some issue, example i put 1 "3 Tier Tower Lamp" and 1 sensor stick on the tower lamp.  
so on the node-red part when the light is light up then start to counting the light how long has be turn on the result wanted to have 1 or 0 only.

thanks

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 February 2023 12:05 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/2 "2023-02-15T12:05:45Z")

</div>

> [@kelvin](#):
>
> when the light is light up then start to counting the light how long has be turn on the result wanted to have 1 or 0 only.

I am sorry, I don't understand what you mean by that. Can you explain again in more detail, with examples of what might happen and what result you want.

---

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [15 February 2023 12:18 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/3 "2023-02-15T12:18:07Z")

</div>

@Colin got any node that can detect light?  
example: when light is on, the node/function will start to detect the light and start to count the time until the light off.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [15 February 2023 12:38 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/4 "2023-02-15T12:38:33Z")

</div>

In which context are you speaking, is this related to home assistant ?

---

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [15 February 2023 12:40 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/5 "2023-02-15T12:40:48Z")

</div>

no actually is to machine only

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [15 February 2023 12:45 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/6 "2023-02-15T12:45:41Z")

</div>

Ok so in relation to your question:

> got any node that can detect light?

How are you able to talk to the light ? Is it a "smart" light ? if yes what kind ? Is it via a "smart" plug ? if yes what type of plug ? etc.

---

<div class="post-metadata">

**Author:** ![kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kelvin](https://discourse.nodered.org/u/kelvin)\
**Post date:** [15 February 2023 13:19 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/7 "2023-02-15T13:19:25Z")

</div>

nope just normal tower light connect by wire using 24v and Gnd

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 February 2023 13:32 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/8 "2023-02-15T13:32:55Z")

</div>

It isn't a matter of finding a node, you need to work out what hardware you are going to use. You could use a light sensor, but would it be able to distinguish between bright daylight and the light? Alternatively you could measure the voltage or current at the light.

---

<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:** [16 April 2023 13:33 UTC](https://discourse.nodered.org/t/how-to-counting-light/75218/9 "2023-04-16T13:33:33Z")

</div>

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