SlimmeLezer+ in Sweden with Aidon 6534
Alright. The steps I needed to perform to get the SL+ to work in Sweden with an Aidon 6534 electricity meter.
- Download and make available ESPHome. It is a Python package, and therefore I would recommend that you install it in a virtual env. I personally use miniconda and it works great.
- Clone the Forsberg fork of the esphome-p1reader repository. The main repo of the esphome-p1reader says that it works with Aidon 6534 and there is also a merge that supports this claim. However, when inspecting the code there is no resemblance between the main repo and the Forsberg fork, and I cant make the main repo work. It flashes OK but the SL+ never starts afterwards.
- Update the p1reader.yaml such that it is line with your needs.
- The readme of the main repo says that you should change the row
auto meter_sensor = new P1Reader(id(uart_bus));
toauto meter_sensor = new P1ReaderHDLC(id(uart_bus));
. DONT! Since this class does not exist in the Forsberg repo (the base P1Reader supports HDLC). - I didn’t use the secrets.yaml trick. I guess that you can if you like.
- The readme of the main repo says that you should change the row
- Start a terminal of choice. Navigate to the root where you cloned the Forsberg repo. Plug the SL+ into the computer with a cable. Run the command
esphome p1reader.yaml run
- Note that this is a deprecated command and a warning will be issued, but it is expected as the Forsberg fork seems to be a non-maintained fork.
- Wait and issue the flash over cable when the choice is presented to you.
- The software will end with “INFO UART logging is disabled (baud_rate=0). Not starting UART logs.”.
- Unplug the SL+ and plug it into the Aidon 6534. It should now show up in your Home Assistant with numbers.
My p1reader.yaml
Change the to reflect your passwords and ssids. The passwords for the AP and the OTA can be chosen freely.
substitutions:
device_name: slimmelezer
device_description: "P1 module to read smart meter"
esphome:
name: ${device_name}
comment: "${device_description}"
platform: ESP8266
esp8266_restore_from_flash: true
board: d1_mini
name_add_mac_suffix: false
includes:
- p1reader.h
wifi:
ssid: <your_SSID>
password: <your_wifi_password>
fast_connect: True
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: slimmelezer
ap_timeout: 15s
password: <ap_password>
reboot_timeout: 5min
domain: .local
captive_portal:
# Enable logging
logger:
level: DEBUG
baud_rate: 0 # disable logging over uart
# Enable Home Assistant API
api:
ota:
password: <ota_password>
web_server:
port: 80
uart:
id: uart_bus
tx_pin: D8
rx_pin: D7
rx_buffer_size: 1700
baud_rate: 115200
sensor:
- platform: uptime
name: "SlimmeLezer Uptime"
- platform: wifi_signal
name: "SlimmeLezer Wi-Fi Signal"
update_interval: 60s
- platform: custom
lambda: |-
auto meter_sensor = new P1Reader(id(uart_bus));
App.register_component(meter_sensor);
return {
meter_sensor->cumulativeActiveImport,
meter_sensor->cumulativeActiveExport,
meter_sensor->cumulativeReactiveImport,
meter_sensor->cumulativeReactiveExport,
meter_sensor->momentaryActiveImport,
meter_sensor->momentaryActiveExport,
meter_sensor->momentaryReactiveImport,
meter_sensor->momentaryReactiveExport,
meter_sensor->momentaryActiveImportL1,
meter_sensor->momentaryActiveExportL1,
meter_sensor->momentaryActiveImportL2,
meter_sensor->momentaryActiveExportL2,
meter_sensor->momentaryActiveImportL3,
meter_sensor->momentaryActiveExportL3,
meter_sensor->momentaryReactiveImportL1,
meter_sensor->momentaryReactiveExportL1,
meter_sensor->momentaryReactiveImportL2,
meter_sensor->momentaryReactiveExportL2,
meter_sensor->momentaryReactiveImportL3,
meter_sensor->momentaryReactiveExportL3,
meter_sensor->voltageL1,
meter_sensor->voltageL2,
meter_sensor->voltageL3,
meter_sensor->currentL1,
meter_sensor->currentL2,
meter_sensor->currentL3
};
sensors:
- name: "Cumulative Active Import"
unit_of_measurement: kWh
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "energy"
- name: "Cumulative Active Export"
unit_of_measurement: kWh
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "energy"
- name: "Cumulative Reactive Import"
unit_of_measurement: kvarh
accuracy_decimals: 3
- name: "Cumulative Reactive Export"
unit_of_measurement: kvarh
accuracy_decimals: 3
- name: "Momentary Active Import"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Reactive Import"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Active Import Phase 1"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export Phase 1"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Import Phase 2"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export Phase 2"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Import Phase 3"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Active Export Phase 3"
unit_of_measurement: kW
accuracy_decimals: 3
state_class: "measurement"
device_class: "power"
- name: "Momentary Reactive Import Phase 1"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export Phase 1"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Import Phase 2"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export Phase 2"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Import Phase 3"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Momentary Reactive Export Phase 3"
unit_of_measurement: kvar
accuracy_decimals: 3
- name: "Voltage Phase 1"
unit_of_measurement: V
accuracy_decimals: 3
state_class: "measurement"
device_class: "voltage"
- name: "Voltage Phase 2"
unit_of_measurement: V
accuracy_decimals: 3
state_class: "measurement"
device_class: "voltage"
- name: "Voltage Phase 3"
unit_of_measurement: V
accuracy_decimals: 3
state_class: "measurement"
device_class: "voltage"
- name: "Current Phase 1"
unit_of_measurement: A
accuracy_decimals: 3
state_class: "measurement"
device_class: "current"
- name: "Current Phase 2"
unit_of_measurement: A
accuracy_decimals: 3
state_class: "measurement"
device_class: "current"
- name: "Current Phase 3"
unit_of_measurement: A
accuracy_decimals: 3
state_class: "measurement"
device_class: "current"
text_sensor:
- platform: wifi_info
ip_address:
name: "SlimmeLezer IP Address"
ssid:
name: "SlimmeLezer Wi-Fi SSID"
bssid:
name: "SlimmeLezer Wi-Fi BSSID"
- platform: version
name: "ESPHome Version"
hide_timestamp: false