Objective
On my salt electrolyser, I have a blue LED that indicates that production is ongoing, if it goes out, I would like my home automation system (Jeedom or Home Assistant) to know to warn me.
I was not going to disassemble the electrolyser to recover a power supply or not from the LED, even if I was itchy, I looked at how to recover rather the ‘visual’ info of the LED on or off.
My idea was to find out if there was a brightness detector, which was simple to interface on my computer. Existing control management system for my pool. My system using an I2C port, I looked for this type of chip and it had to be interfacing on Esp Easy for simplicity.

Material used
In addition to the equipment of the existing pool management system :
- BH1750 (or GY-302) A brightness sensor

I ordered two for 0.83€ x 2 + 0.73€ port + 0.48€ Taxes = 2.86€
Connection of the probe

- The probe is in I2C so two connectors SDA and SCL to connect without making a mistake to the existing bus.
- VCC to 5v and GND to mass.
- Addr makes it possible to change the address, we will keep the default value and therefore not connect it.
Positioning of the probe on the Alert Led
You have to position the brightness sensor (green arrow) on the LED and hold it with black scotch that covers well.


It is not that bad, and it is very convenient to have the information on the proper functioning of the production.

Configuring Esp Easy

I admit that I did not do too many tests on the setting of the resolution or other, I left everything by default and it works well.
- When the LED is on, I have Lux: between 25000 and 30000
- When the LED is turned off, I have Lux: 0
That suits me very well.
Add a rule to have a True/False instead of a Lux value
//// // Turns LedProduction's value in Lux into True/False on Pool#Electrolysis //// on LedProduction#Lux do if [LedProduction#Lux]>10000 and [Water#WaterOff]=0 // If LedProduction AND pump works //Light=Production works TaskValueSet 8.1 // Pool Update#Electrolysis=1 else //Light=Production does not work TaskValueSet 8,4,0 // Pool Update#Electrolysis=0 endif endon
As a reminder, TaskValueSet will initialise the Dummy Device variables I use and retrieve in Jeedom

So in the code, TaskValueSet will assign the result 0 or 1 to the 8th row of the table / 4th value (so Electrolysis).
Note: I added a small control in the rule so that an alarm will only go up if the electrolyser is powered.
Recovery in Jeedom or Home Assistant
For Jeedom, this is explained in:
For Home Assistant, follow the explanations in this plugin:
