For my first post on the blog, I suggest you see together how to integrate the information from your electricity meter (teleinfo) into Home Assistant for around € 14. This tutorial is valid for old electronic meters as well as for new “Linky” communicating meters. To retrieve the information we will use a feature used by energy suppliers: Tele-information.
As the electricity meter is generally remote from your home automation system, I advise you to program and flash your ESP8266 first.
Summary of integration steps with ESPhome:
- To start, go to ESPHome you must create a new configuration by clicking on the green ‘+’ button located at the bottom right of the screen.
- Then fill in the various fields with the name of the device, the name of your wifi network (2.4 Ghz imperatively) as well as the associated password.
- The platform is of course ESP8266, for a wemos d1 mini the board is d1_mini
- Click on the ‘Next’ button and connect your Wemos D1 mini by USB to your PC, then click on ‘Connect’ and choose the COM port corresponding to your Wemos.
The flash may last a few minutes, leave the page open while waiting for the operation to complete.
After this operation, your new configuration will appear on the ESPHome Dashboard. Click on ‘EDIT’, we will complete the configuration file with the elements necessary for reporting information from the meter.
Below ‘logger’ add the following lines:
Finally, below the ‘captive_portal’ line add the rest of the code:
- For Peak Hours / Off-Hours subscriptions:
- For subscriptions at the Basic rate:
You can now upload the file by clicking on ‘INSTALL’.
So much for the programming part, now let’s go to the connection of the assembly.
Connection to the meter
We will in this part see how to connect our assembly, here is the wiring diagram:
- Rx of Wemos on TXD of PiTInfo
- G of Wemos onGND of PiTInfo
- 3v3 of Wemos on VCC ofPiTInfo
- The two input terminals of the PiTInfo must be connected to I1 and I2 under the meter (These terminals are protected by a cover), there is no polarity on this side of the assembly
Linky counter: For information to go back to Home Assistant. The counter must be in ‘History’ mode, you can check this information by pressing the ‘+’ or ‘-‘ keys.
Back in Home Assistant go to ‘Integrations’. Normally your new Wemos should be recognized by HA and offered to you for configuration. If this is not the case, you will have to add it manually by clicking on ‘Add integration’ at the bottom right. Then look for ESPHome in the list and finally enter the IP address of the module.
So you get this map which you can add directly to Lovelace or create a personalized map.
Here it is now finished, you have all the information from your meter which arrives on your HA, you are now free to manage this data, create graphs, automations …!