Prerequisites
To build this setup, you will need:
Warning!
The code is in LUA and therefore requires the ESP8266 to have the nodemcu firmware.
Wiring
[Waiting for TSL2561 sensor under Fritzing]
Code
Principle
The principle is as follows:
- The ESP creates an MQTT client with a unique id;
- It connects to the MQTT broker;
- On each value change of the TSL2561 sensor, the MQTT client publishes the data on a specific topic;
- The MQTT broker receives the data and publishes it for each client that has subscribed to this topic.
Jeedom
You must first install the free MQTT plugin in Jeedom.
Once your ESP8266 publishes on the MQTT broker, the Jeedom plugin will automatically add the TSL2561 device:


