From f20540792f78816a3d3153cb8686b98726a3d987 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sat, 9 Aug 2025 12:48:07 +0000 Subject: [PATCH] feat: add smart meter config --- common/base.yaml | 31 ++++++++++++++++++++ smart-meter-reader.yaml | 64 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 common/base.yaml create mode 100644 smart-meter-reader.yaml diff --git a/common/base.yaml b/common/base.yaml new file mode 100644 index 0000000..0d34f51 --- /dev/null +++ b/common/base.yaml @@ -0,0 +1,31 @@ +time: + - platform: sntp + id: time_sntp + +binary_sensor: + - platform: status + name: Online + id: ink_ha_connected + entity_category: diagnostic + +sensor: + - platform: uptime + name: Uptime + type: timestamp + time_id: time_sntp + entity_category: diagnostic + - platform: wifi_signal + name: RSSI + update_interval: 60s + entity_category: diagnostic + +button: + - platform: restart + icon: mdi:power-cycle + name: ESP Reboot + entity_category: diagnostic + +text_sensor: + - platform: wifi_info + ip_address: + name: IP Address diff --git a/smart-meter-reader.yaml b/smart-meter-reader.yaml new file mode 100644 index 0000000..fb7824f --- /dev/null +++ b/smart-meter-reader.yaml @@ -0,0 +1,64 @@ +esphome: + name: smart-meter + friendly_name: Smart Meter + name_add_mac_suffix: True + +packages: !include common/base.yaml + +esp8266: + board: d1_mini + +logger: + baud_rate: 0 + level: INFO +api: + +ota: + - platform: esphome + password: !secret ota_password + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + ap: + ssid: Smart Meter Fallback Hotspot + +sensor: + - platform: sml + name: Total Energy Consumed + obis_code: 1-0:1.8.0 + unit_of_measurement: kWh + accuracy_decimals: 1 + device_class: energy + state_class: total_increasing + filters: + - multiply: 0.0001 + - platform: sml + name: Current Power + obis_code: 1-0:16.7.0 + unit_of_measurement: W + accuracy_decimals: 0 + device_class: power + state_class: measurement + filters: + - multiply: 0.01 + +text_sensor: + - platform: sml + name: Manufacturer + obis_code: 1-0:96.50.1 + format: text + # - platform: sml + # name: Serial Number + # obis_code: 1-0:96.1.0 + # format: text + +uart: + id: uart_main + tx_pin: TX + rx_pin: RX + baud_rate: 9600 + +sml: + uart_id: uart_main + id: sml_main