# External Lux meter via zigbee protocole

**URL:** <https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105>\
**Category:** Hardware\
**Created:** [30 September 2019 18:28 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105 "2019-09-30T18:28:12Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [30 September 2019 18:28 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/1 "2019-09-30T18:28:12Z")

</div>

Hello, I'm looking for a zigbee light sensor to manage the amount of indoor light according to the external light power.  
Do you know of such a sensor?  
Thanks

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 September 2019 19:26 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/2 "2019-09-30T19:26:26Z")

</div>

A search for "ambient light sensor" came up with a bunch.

Does it have to be Zigbee? You can build your own using an ESP8266 with a BH1750 sensor which is very easy to wire up. I have a couple in the house.

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [30 September 2019 20:18 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/3 "2019-09-30T20:18:41Z")

</div>

Yes, I am absolutely looking for a zigbee because it is energy efficient. The ESP8266 is wifi.  
Google does not provide me with this kind of material at an affordable price. Thanks for your answer.

---

<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:** [30 September 2019 20:35 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/4 "2019-09-30T20:35:18Z")

</div>

an ESP8266 is definitely the cheapest option, and you don't even need to use the wifi, you could attach a 433Mhz transmitter, then it will be as power efficient as a zigbee based sensor. But a zigbee based sensor, Philips/Signify Hue has a motion sensor (which also exposes lux when using the API)

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [30 September 2019 20:52 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/5 "2019-09-30T20:52:23Z")

</div>

I vote for the BH1750 that Julian (@TotallyInformation) suggested, an east to set up and use sensor that will deliver lux values directly with minimal effort.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [30 September 2019 21:48 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/6 "2019-09-30T21:48:21Z")

</div>

You can put many ESP boards into deep sleep between readings so you can make them pretty battery efficient if you try. You can also get them with LORA radio which is even more efficient (albeit with a probably somewhat excessive range for this application)

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [1 October 2019 08:53 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/7 "2019-10-01T08:53:34Z")

</div>

Whouahh . This forum is really very responsive, like NR 😉  
Thanks Guy.

I like 433 MHz because I already have a Sonoff RF bridge in operation. Do you have any idea what wiring to do?  
The HUE can send LUX values ? or only information about a person's presence, because my Xiomi detectors do that.

In addition, I try to detect the external light to act as well as possible with the settings of my internal lights

---

<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:** [1 October 2019 08:59 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/8 "2019-10-01T08:59:40Z")

</div>

There are [various tutorials](https://www.instructables.com/id/Using-an-ESP8266-to-Control-Mains-Sockets-Using-43/). Then you need another one for the battery part, [different story](https://hackaday.io/project/28527-solved-esp8266-powered-by-coin-cell), can even run on a coincell. If you combine those 2 with deepsleep it can last a long time.

This is what my hue motion sensor sends:

 ![06](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/be04bb1e8042c0b9fd9f9cdb78a042908b4d9681.jpeg)

Also when motion is detected, not sure how to differentiate between the 2.

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [1 October 2019 09:41 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/9 "2019-10-01T09:41:28Z")

</div>

Does it send its values if the light changes? Or only if it detects a person.  
The variable Lux seems to be the right one.

The first article talks about receiving the RF signal and not transmitting and indeed you still need a battery module.  
The 2nd, obviously does not send the data with each change but in a fixed way.

As I am not an electronics engineer, it would be cool to find a device that is already ready to use.

Thank you anyway for the ideas as well as for the example of the Hue payload.

I saw that my zigbee2mqtt gateway is supported.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 October 2019 14:43 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/10 "2019-10-01T14:43:59Z")

</div>

> [@Jean-Luc](#):
>
> As I am not an electronics engineer, it would be cool to find a device that is already ready to use

Well Seeed do one on a Grove module, they also do a Pi Grove adaptor:

> **[Grove - Luminance Sensor](https://www.seeedstudio.com/Grove-Luminance-Sensor.html)**
>
> Grove - Luminance Sensor using APDS-9002 as lumens Sensor, provide the linear transform lumen intensity for the output voltage levels

Truth is - the hardest part of wiring up your own to an ESP8266 is actually sticking it in a case - not an electronics issue at all! Even that isn't really very hard. There are lots of tutorials on the BH1750 with ESP8266 out there. Since it uses I2C, it is only 4 wires.

You don't even need to program it since both TASMOTA and ESPeasy support it directly.

> **[GitHub - arendst/Tasmota: Alternative firmware for ESP8266 and ESP32 based...](https://github.com/arendst/Tasmota)**
>
> Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP...

[https://www.letscontrolit.com/wiki/index.php/BH1750](https://www.letscontrolit.com/wiki/index.php/BH1750)

I use ESPeasy-Mega on most of my ESP's now because I'm too lazy (ahem, no, I'm too busy!) to write my own code even though that only takes a few hours even if you have to learn how to use the Arduino IDE from scratch.

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [2 October 2019 07:21 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/11 "2019-10-02T07:21:30Z")

</div>

For my sonoff I also use Tasmota. This I do not want to use an external wifi sensor. So I'm going to try either with the Hue or with an FM sensor.  
I'll look that way too.

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [17 October 2019 11:56 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/12 "2019-10-17T11:56:21Z")

</div>

So that's it, I bought a Philips hue sensor. Very simple to connect to zigbee2mqtt. I get many values for Lux, I still have to understand the scale of values 🤔 to control my lights in the house as well as the control of the external blind.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/39e6b500f53043a0d8661f67b0f5b3273073fcfe.jpeg)

---

<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:** [17 October 2019 14:12 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/13 "2019-10-17T14:12:12Z")

</div>

Nice. Lux is kind of weird as its value is logarithmic. But you only get illuminance from zigbee2mqtt it seems  
I am using hue magic, which produces both lux and illuminance (while they are supposed to be the same, they differ a lot in hue magic)

illuminance ranges from 1 to 100.000, where 20.000 is [daylight not measured in direct sunlight](https://www.allaboutcircuits.com/technical-articles/understanding-illuminance-whats-in-a-lux/).

For the lux value that comes from hue magic, I have figured out where the thresholds somewhat are for blinds and lights (brightness of the lights is actually mapped against the lux, so they get brighter as it gets darker outside)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 October 2019 16:07 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/14 "2019-10-17T16:07:50Z")

</div>

> [@bakman2](#):
>
> Lux is kind of weird as its value is logarithmic

Lux is an international standard and so is the better value to use if you ever want to compare it to anything else. It is used as a measure of the intensity, as perceived by the human eye.

> **[Lux](https://en.wikipedia.org/wiki/Lux)**
>
> The lux (symbol: lx) is the unit of illuminance, or luminous flux per unit area, in the International System of Units (SI). It is equal to one lumen per square metre. In photometry, this is used as a measure of the intensity, as perceived by the human eye, of light that hits or passes through a surface. It is analogous to the radiometric unit watt per square metre, but with the power at each wavelength weighted according to the luminosity function, a model of human visual brightness percept Ill...

---

<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:** [17 October 2019 16:11 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/15 "2019-10-17T16:11:24Z")

</div>

Yes I know, the strange thing is; the hue sensor gives up to 115.000 illuminance and only up to 15.000 lux (looking at my grafana data), philips calls lux "real lux value". Not sure what they mean, as long as my blinds go down 😉

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 October 2019 16:15 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/16 "2019-10-17T16:15:21Z")

</div>

It should mean that they are applying the correct formula to turn illuminance to Lux. That should give you a standardised output that takes into account the way we perceive light which is not uniform of course.

I use the BH1750 to measure light levels and one of its advantages is that it outputs Lux. We have a hallway and a landing which can get quite dark having no direct window light, the sensors mean that I can turn on/off lights at convenient levels.

---

<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:** [17 October 2019 16:22 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/17 "2019-10-17T16:22:04Z")

</div>

I also have an esp+BH1750 next to the philips and was trying to match them up in values, but they simply didn't.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 October 2019 19:07 UTC](https://discourse.nodered.org/t/external-lux-meter-via-zigbee-protocole/16105/18 "2019-10-17T19:07:01Z")

</div>

Hmm, that's not good.
