ESP8266 P1 to WiFi
Simple Arduino Sketch that can be used to stream P1 data (Dutch Smart Meter Requirements/DSMR) over WiFi using an ESP8266. Can be used to integrate a smart meter into Home Assistant without having to run a cable from your server to your smart meter.
Requirements
Everything I've used is listed below, including a link to the product page at the store I bought them at.
- ESP8266 ESP01-S
- AMS1117-3.3
- RJ12 6P6C to Jump Wires Adapter
- Breadboard
- Jump Wires (Male to Male)
- Jump Wires (Male to Female)
- FT232RL 3.3v-5v TTL USB Serial Port Adapter
Flashing the Firmware
-
Install the Arduino IDE with the ESP8266 Arduino Core (see documentation)
-
Clone this repository and open it in the Arduino IDE
-
Adjust the settings in the Sketch to your needs
You should at least adjust theSSID
andPASSWORD
settings so the ESP can connect to your network
⚠️ The ESP8266 can only connect to 2.4GHz networks -
Use the USB Serial Port Adapter to flash the firmware (see Flashing Schema)
⚠️ Make sure you only supply 3.3V to your ESP8266 -
Connect all components (see Runtime Schema)
-
Plug it into your smart meter
-
Enable the DSMR integration in Home Assistant (see Home Assistant Configuration)
Flashing Schema
From | To |
---|---|
USB Serial Port Adapter VCC | ESP8266 3V3, ESP8266 EN |
USB Serial Port Adapter GND | ESP8266 GND, ESP8266 IO0 |
USB Serial Port Adapter TX | ESP8266 RXD |
USB Serial Port Adapter RX | ESP8266 TXD |
Runtime Schema
From | To |
---|---|
P1 pin 1 (5V) | Voltage Regulator VIn, P1 pin 2 (RTS) |
P1 pin 6 (GND) | Voltage Regulator GND, ESP8266 GND |
P1 pin 5 (TX) | ESP8266 RX |
Voltage Regulator VOut | ESP8266 3V3, ESP8266 EN |
Home Assistant Configuration
Example configuration for the DSMR Slimme Meter integration below:
sensor:
- platform: dsmr
port: 1337
host: 192.168.1.130
dsmr_version: 5
Troubleshooting
The ESP8266's IO2 pin can be connected to your USB Serial Port Adapter's RX pin for debugging purposes.
Example Debug Output
* VERSION 2021.01.23+1
Network Settings:
* HOSTNAME p1
* SSID SomeSSID
* PASSWORD REDACTED
* MAX_CLIENTS 4
* PORT 1337
Serial Settings:
* DEBUG_BAUD_RATE 9600
* P1_BAUD_RATE 115200
* P1_MODE 28
* P1_INVERT 1
General Settings:
BUFFER_SIZE 128
Starting WiFi connection
Waiting for WiFi connection...
Waiting for WiFi connection...
Waiting for WiFi connection...
Waiting for WiFi connection...
WiFi connected at 192.168.1.130
Starting server
Starting OTA server
Client 192.168.1.163 accepted