SDM energy meter reading other/more values

Hello All,

I have a working setup with a SDM630 meter.
I can read KWH, voltage, current, all working fine.
But i like to read a couple of values more than the example gives:
https://esphome.io/components/sensor/sdm_meter.html

sensor:
  - platform: sdm_meter
    phase_a:
      current:
        name: "SDM220M Current"
      voltage:
        name: "SDM220M Voltage"
      active_power:
        name: "SDM220M Power"
      power_factor:
        name: "SDM220M Power Factor"
      apparent_power:
        name: "SDM220M Apparent Power"
      reactive_power:
        name: "SDM220M Reactive Power"
      phase_angle:
        name: "SDM220M Phase Angle"
    frequency:
      name: "SDM220M Frequency"
    import_active_energy:
      name: "SDM220M Import Active Energy"
    export_active_energy:
      name: "SDM220M Export Active Energy"
    import_reactive_energy:
      name: "SDM220M Import Reactive Energy"
    export_reactive_energy:
      name: "SDM220M Export Reactive Energy"
    update_interval: 60s

This above working fine:
But in source code for SDM there are more options:
https://github.com/esphome/esphome/blob/073828235f67318df933fbe7350a3e0dc17bb773/esphome/components/sdm_meter/sdm_meter_registers.h

/* PHASE STATUS REGISTERS */
static const uint16_t SDM_PHASE_1_VOLTAGE = 0x0000;
static const uint16_t SDM_PHASE_2_VOLTAGE = 0x0002;
static const uint16_t SDM_PHASE_3_VOLTAGE = 0x0004;
static const uint16_t SDM_PHASE_1_CURRENT = 0x0006;
static const uint16_t SDM_PHASE_2_CURRENT = 0x0008;
static const uint16_t SDM_PHASE_3_CURRENT = 0x000A;
static const uint16_t SDM_PHASE_1_ACTIVE_POWER = 0x000C;
static const uint16_t SDM_PHASE_2_ACTIVE_POWER = 0x000E;
static const uint16_t SDM_PHASE_3_ACTIVE_POWER = 0x0010;
static const uint16_t SDM_PHASE_1_APPARENT_POWER = 0x0012;
static const uint16_t SDM_PHASE_2_APPARENT_POWER = 0x0014;
static const uint16_t SDM_PHASE_3_APPARENT_POWER = 0x0016;
static const uint16_t SDM_PHASE_1_REACTIVE_POWER = 0x0018;
static const uint16_t SDM_PHASE_2_REACTIVE_POWER = 0x001A;
static const uint16_t SDM_PHASE_3_REACTIVE_POWER = 0x001C;
static const uint16_t SDM_PHASE_1_POWER_FACTOR = 0x001E;
static const uint16_t SDM_PHASE_2_POWER_FACTOR = 0x0020;
static const uint16_t SDM_PHASE_3_POWER_FACTOR = 0x0022;
static const uint16_t SDM_PHASE_1_ANGLE = 0x0024;
static const uint16_t SDM_PHASE_2_ANGLE = 0x0026;
static const uint16_t SDM_PHASE_3_ANGLE = 0x0028;

static const uint16_t SDM_AVERAGE_L_TO_N_VOLTS = 0x002A;
static const uint16_t SDM_AVERAGE_LINE_CURRENT = 0x002E;
static const uint16_t SDM_SUM_LINE_CURRENT = 0x0030;
static const uint16_t SDM_TOTAL_SYSTEM_POWER = 0x0034;
static const uint16_t SDM_TOTAL_SYSTEM_APPARENT_POWER = 0x0038;
static const uint16_t SDM_TOTAL_SYSTEM_REACTIVE_POWER = 0x003C;
static const uint16_t SDM_TOTAL_SYSTEM_POWER_FACTOR = 0x003E;
static const uint16_t SDM_TOTAL_SYSTEM_PHASE_ANGLE = 0x0042;

How can i read for example: SDM_TOTAL_SYSTEM_POWER

If i add this key(or similar) to esphome it does not recognize it.
How can i read these values?

does anybody know this?
How to read more items from the eastron meters?

Hi,

i have the exact same question for my SDM72M-V2.

Any solution yet?

Thanks!

No have not found a solution yet

I added a fork (not yet a pullrequest since it is untested).

I added Import and Export Power to the readout.

try:

...
external_components:
  - source:
      type: git
      url: https://github.com/guineapirates/esphome
      ref: dev
    components: [ sdm_meter ]
...

  - platform: sdm_meter
    ....
    total_power:
      name: "Total Power"
    import_power:
      name: "Import Power"
    export_power:
      name: "Export Power" 

...

What did you change for this? does this change also apply to the sdm630?
And are you going to make a PR for this change and add this to ESPhome?

@ frank8the9tank guineapirates
I’m using custom component for SDM630 in ESPHome:

esphome:
  name: "${device_name}"
  platform: ESP8266
  board: nodemcuv2
  includes:
    - custom_components/sdm/SDM_Config_User.h
    - custom_components/sdm/SDM.h
    - custom_components/sdm/sdm_esphome.h

wifi:
  ssid: "Secret"

  password: !secret wifi_pass

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${friendly_name} Hotspot"
    password: "As9HOTthln7T"

captive_portal:

substitutions:
  # Device Names
  device_name: "powermetersdm630"
  friendly_name: "SDM630"
  # Icon
  # https://materialdesignicons.com/
  # https://www.esphome.app/docs/icons
  main_icon: "mdi:gauge"

logger:
  #level: DEBUG
  level: VERBOSE
  #level: INFO
  baud_rate: 0  #disable uart log
  esp8266_store_log_strings_in_flash: false

# Enable Home Assistant API
api:
  password: !secret api

ota:
  password: !secret ota

uart:
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600
  stop_bits: 1

binary_sensor:
  # https://esphome.io/components/binary_sensor/status.html
  - platform: status
    name: "${friendly_name} Status"

time:
  # https://esphome.io/components/time.html
  - platform: homeassistant
    id: hass_time
    timezone: Europe/Warsaw

sensor:
  - platform: wifi_signal
    name: "${friendly_name} RSSI"
    update_interval: 60s
  
  - platform: uptime
    id: uptime_sec

  - platform: custom
    lambda: |-
      auto sdm_sensors = new SDMComponent();
      App.register_component(sdm_sensors);
      return {sdm_sensors->voltage1_sensor, sdm_sensors->voltage2_sensor, sdm_sensors->voltage3_sensor, sdm_sensors->current1_sensor, sdm_sensors->current2_sensor, sdm_sensors->current3_sensor, sdm_sensors->current_sum_sensor, 
              sdm_sensors->power1_sensor, sdm_sensors->power2_sensor, sdm_sensors->power3_sensor, sdm_sensors->power_total_sensor, sdm_sensors->reactive1_sensor, sdm_sensors->reactive2_sensor, sdm_sensors->reactive3_sensor, 
              sdm_sensors->power_factor_total_sensor, sdm_sensors->frequency_sensor, sdm_sensors->import_active_energy_sensor, 
              sdm_sensors->export_active_energy_sensor, sdm_sensors->import_reactive_energy_sensor, sdm_sensors->export_reactive_energy_sensor, sdm_sensors->import1_sensor, 
              sdm_sensors->import2_sensor, sdm_sensors->import3_sensor, sdm_sensors->export1_sensor, sdm_sensors->export2_sensor, sdm_sensors->export3_sensor, sdm_sensors->total_energy1_sensor, 
              sdm_sensors->total_energy2_sensor, sdm_sensors->total_energy3_sensor, sdm_sensors->total_energy_sensor}; 
    
    sensors:
      - name: "${friendly_name} Napięcie L1"
        unit_of_measurement: V
        accuracy_decimals: 1
        #icon: "mdi:alpha-v-circle-outline"
        device_class: "voltage"
        state_class: "measurement"
      
      - name: "${friendly_name} Napięcie L2"
        unit_of_measurement: V
        accuracy_decimals: 1
        #icon: "mdi:alpha-v-circle-outline"
        device_class: "voltage"
        state_class: "measurement"
      
      - name: "${friendly_name} Napięcie L3"
        unit_of_measurement: V
        accuracy_decimals: 1
        #icon: "mdi:alpha-v-circle-outline"
        device_class: "voltage"
        state_class: "measurement"      
      
      - name: "${friendly_name} Prąd L1"
        unit_of_measurement: A
        accuracy_decimals: 3
        #icon: "mdi:alpha-a-circle-outline"
        device_class: "current"
        state_class: "measurement"      
      
      - name: "${friendly_name} Prąd L2"
        #unit_of_measurement: A
        accuracy_decimals: 3
        #icon: "mdi:alpha-a-circle-outline"
        device_class: "current"
        state_class: "measurement"       
      
      - name: "${friendly_name} Prąd L3"
        unit_of_measurement: A
        accuracy_decimals: 3
        #icon: "mdi:alpha-a-circle-outline"
        device_class: "current"
        state_class: "measurement"        
      
      - name: "${friendly_name} Prąd całkowiy"
        unit_of_measurement: A
        accuracy_decimals: 3
        #icon: "mdi:alpha-a-circle-outline"   
        device_class: "current"
        state_class: "measurement"        
      
      - name: "${friendly_name} Moc czynna L1"
        unit_of_measurement: W
        accuracy_decimals: 1
        #icon: "mdi:gauge"
        device_class: "power"
        state_class: "measurement" 
      
      - name: "${friendly_name} Moc czynna L2"
        unit_of_measurement: W
        accuracy_decimals: 1
        #icon: "mdi:gauge"
        device_class: "power"
        state_class: "measurement" 
      
      - name: "${friendly_name} Moc czynna L3"
        unit_of_measurement: W
        accuracy_decimals: 1
        #icon: "mdi:gauge"
        device_class: "power"
        state_class: "measurement" 

      - name: "${friendly_name} Moc czynna całkowita"
        unit_of_measurement: W
        #accuracy_decimals: 1
        icon: "mdi:gauge"
        id: power    
        device_class: "power"
        state_class: "measurement" 

      - name: "${friendly_name} Moc bierna L1"
        unit_of_measurement: VAr
        accuracy_decimals: 1
        icon: "mdi:gauge"
        #device_class: "power"
        #state_class: "measurement" 


      - name: "${friendly_name} Moc bierna L2"
        unit_of_measurement: VAr
        accuracy_decimals: 1
        icon: "mdi:gauge"


      - name: "${friendly_name} Moc bierna L3"
        unit_of_measurement: VAr
        accuracy_decimals: 1
        icon: "mdi:gauge"
 
      - name: "${friendly_name} Współczynnik mocy"
        accuracy_decimals: 2
        icon: "mdi:alpha-f-circle-outline"
        #device_class: "power_factor"
        #state_class: "measurement"  
 
      - name: "${friendly_name} Częstotliwość"
        unit_of_measurement: Hz
        accuracy_decimals: 2
        icon: "mdi:current-ac"
      
      - name: "${friendly_name} Energia czynna pobrana"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement"        
      
      - name: "${friendly_name} Energia czynna oddana"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 
      
      - name: "${friendly_name} Energia bierna pobrana"
        unit_of_measurement: kVARh
        accuracy_decimals: 3
        icon: "mdi:gauge"
     
      - name: "${friendly_name} Energia bierna oddana"
        unit_of_measurement: kVARh
        accuracy_decimals: 3
        icon: "mdi:gauge"
     
      - name: "${friendly_name} Energia pobrana L1"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 
     
      - name: "${friendly_name} Energia pobrana L2"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 

      - name: "${friendly_name} Energia pobrana L3"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 


      - name: "${friendly_name} Energia oddana L1"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 
 
      - name: "${friendly_name} Energia oddana L2"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 


      - name: "${friendly_name} Energia oddana L3"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:gauge"
        device_class: "energy"
        state_class: "measurement" 


      - name: "${friendly_name} Energia całkowita L1"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:counter"
        device_class: "energy"
        state_class: "measurement" 

      - name: "${friendly_name} Energia całkowita L2"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:counter"
        device_class: "energy"
        state_class: "measurement" 

      - name: "${friendly_name} Energia całkowita L3"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:counter"     
        device_class: "energy"
        state_class: "measurement" 

      - name: "${friendly_name} Energia całkowita"
        unit_of_measurement: kWh
        accuracy_decimals: 3
        #icon: "mdi:counter"
        device_class: "energy"
        state_class: "measurement" 

  # https://esphome.io/components/sensor/total_daily_energy.html
  - platform: total_daily_energy
    name: "${friendly_name} Dzienne zużycie energii"
    icon: "mdi:counter"
    power_id: power
    filters:
      # Multiplication factor from W to kW is 0.001
      - multiply: 0.001
    unit_of_measurement: kWh

text_sensor:
  - platform: template
    name: "${friendly_name} Uptime"
    lambda: |-
      int seconds = (id(uptime_sec).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600); 
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
    icon: mdi:clock-start
    update_interval: 120s

Files

Hi,

While trying to complile your example I have plenty of errors as:

/config/esphome/sdm-new.yaml: In lambda function:
/config/esphome/sdm-new.yaml:74:28: error: 'class SDMComponent' has no member named 'voltage1_sensor'; did you mean 'voltage_sensorL1'?
   74 |       return {sdm_sensors->voltage1_sensor, sdm_sensors->voltage2_sensor, sdm_sensors->voltage3_sensor, sdm_sensors->current1_sensor, sdm_sensors->current2_sensor, sdm_sensors->current3_sensor, sdm_sensors->current_sum_sensor,
      |                            ^~~~~~~~~~~~~~~
      |                            voltage_sensorL1

What am I doing wrong?

It is not enough to put the import_active_energy sensor:
name: SDM220M Import Active Energy to the home assistant in the energy panel? then it will do what you need.

maybe a stupid question, but what kind of SDM630 do you have. is it the Wifi version which you have to read out via the HomeWizzard integration or is it the modbus version which you can read out with the modbus integration.
I use the modbus version. you can readout every parameter in the SDM630 by adressing the correct register.
you can also find the SDM630 documentation which describes all the parameters that you can read and set via the modbus interface.

Its the version with modbus, and i use ESPhome for a 485/modbus connection to the meter.

Can you give me a example of your configuration?

sure.
I use a HF2211 as 485 to ethernet converter. I talk ModbusTCP to the converter which converts it into Modbus RTU to the devices.

modbus:

   - name: Hub1

    type: tcp

    host: 172.x.y.65

    port: 8899

    sensors:

      - name: recharge_Vac1

        #hub: Hub1

        slave: 1

        input_type: input

        address: 0

        count: 2

        data_type: float32

        precision: 1

        scan_interval: 5

        unit_of_measurement: V

        device_class: voltage

      - name: recharge_Vac2

        slave: 1

        input_type: input

        address: 2

        count: 2

        data_type: float32

        precision: 1

        scan_interval: 5

        unit_of_measurement: V

        device_class: voltage

      - name: recharge_Vac3

        slave: 1

        input_type: input

        address: 4

        count: 2

        data_type: float32

        precision: 1

        scan_interval: 5

        unit_of_measurement: V

        device_class: voltage

      - name: recharge_Iac1

        slave: 1

        input_type: input

        address: 6

        count: 2

        data_type: float32

        precision: 3

        scan_interval: 5

        unit_of_measurement: A

        device_class: current

      - name: recharge_Iac2

        slave: 1

        input_type: input

        address: 8

        count: 2

        data_type: float32

        precision: 1

        scan_interval: 5

        unit_of_measurement: A

        device_class: current

      - name: recharge_Iac3

        slave: 1

        input_type: input

        address: 10

        count: 2

        data_type: float32

        precision: 1

        scan_interval: 5

        unit_of_measurement: A

        device_class: current

      - name: recharge_Pac1

        slave: 1

        input_type: input

        address: 12

        count: 2

        data_type: float32

        precision: 2

        scan_interval: 5

        unit_of_measurement: kW

        device_class: voltage

Mine looks like this - works flawlessly now.

esphome:
  name: stromzaehler # need to adjust to your setup
  platform: ESP8266 # need to adjust to your setup
  board: nodemcuv2 # need to adjust to your setup

wifi:
  ssid: "xxx" # need to adjust to your setup
  password: "xxx" # need to adjust to your setup

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Stromzaehler Fallback Hotspot" # need to adjust to your setup
    password: "xxx" # need to adjust to your setup


captive_portal:

# Enable logging
logger:
  level: DEBUG
  baud_rate: 0  #needs 0, because info & data goes thru one line.
  
web_server:
  port: 80
  
# Enable Home Assistant API
api:

ota:

time:
  - platform: homeassistant
    id: homeassistant_time

uart:
  id: mod_bus
  rx_pin: D5  # need to adjust to your setup
  tx_pin: D0  # need to adjust to your setup
  baud_rate: 9600
  stop_bits: 1

modbus:
  uart_id: mod_bus
  id: modbus1
  
modbus_controller:
  - id: sdm
    address: 0x0001 # need to adjust to your setup, standard SDM is 1
    modbus_id: modbus1
    update_interval: 10s

sensor:
        
##### SDM Meter via Modbus

  - platform: modbus_controller
    modbus_controller_id: sdm
    name: "HT NT Import Leistung"
    id: "import_power"
    register_type: read
    address: 0x0500
    value_type: FP32
    accuracy_decimals: 0
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    filters:
      - multiply: 1.0
      
  - platform: modbus_controller
    modbus_controller_id: sdm
    name: "HT NT Export Leistung"
    id: "export_power"
    register_type: read
    address: 0x0502
    value_type: FP32
    accuracy_decimals: 0
    unit_of_measurement: "W"
    state_class: measurement
    device_class: power
    filters:
      - multiply: 1.0

###SDM Meter can be used for the rest

  - platform: sdm_meter
    phase_a:
      current:
        name: "HT NT L1 Strom"
        accuracy_decimals: 1
      voltage:
        name: "HT NT L1 Spannung"
        accuracy_decimals: 0
      active_power:
        name: "HT NT L1 Leistung"
        accuracy_decimals: 0
      power_factor:
        name: "HT NT L1 Leistungsfaktor"
        accuracy_decimals: 0
      apparent_power:
        name: "HT NT L1 Scheinleistung"
        accuracy_decimals: 0
      reactive_power:
        name: "HT NT L1 Blindleistung"
        accuracy_decimals: 0
    phase_b:
      current:
        name: "HT NT L2 Strom"
        accuracy_decimals: 1
      voltage:
        name: "HT NT L2 Spannung"
        accuracy_decimals: 0
      active_power:
        name: "HT NT L2 Leistung"
        accuracy_decimals: 0
      power_factor:
        name: "HT NT L2 Leistungsfaktor"
        accuracy_decimals: 0
      apparent_power:
        name: "HT NT L2 Scheinleistung"
        accuracy_decimals: 0
      reactive_power:
        name: "HT NT L2 Blindleistung" 
        accuracy_decimals: 0
    phase_c:
      current:
        name: "HT NT L3 Strom"
        accuracy_decimals: 1
      voltage:
        name: "HT NT L3 Spannung"
        accuracy_decimals: 0
      active_power:
        name: "HT NT L3 Leistung"
        accuracy_decimals: 0
      power_factor:
        name: "HT NT L3 Leistungsfaktor"
        accuracy_decimals: 0
      apparent_power:
        name: "HT NT L3 Scheinleistung"
        accuracy_decimals: 0
      reactive_power:
        name: "HT NT L3 Blindleistung"     
        accuracy_decimals: 0
    frequency:
      name: "HT NT Netzfrequenz"
      accuracy_decimals: 0
    total_power:
      name: "HT NT Summe Leistung"
      accuracy_decimals: 0
    import_active_energy:
      name: "HT NT Import Energie"
    export_active_energy:
      name: "HT NT Export Energie"
    import_reactive_energy:
      name: "HT NT Import Blindenergie"
      accuracy_decimals: 0
    export_reactive_energy:
      name: "HT NT Export Blindenergie"
      accuracy_decimals: 0
    update_interval: 10s

@blackscreener can you put the files somewhere else? The link has expired. Thank you !

Thanks for this Integration.

Tried it yesterday with a spare SDM220 I had on hand.
Had little trouble getting it up in short order & now it’s reading just Volts & Freq as no load is present.

Now I need to get it reading on the Identical meters I have in service.

First issue I can’t find a real solution to is how I address the 3 meters I have daisy chained on the same Bus. Addresses are 1, 2 & 3.

First one is on the Mains Supply arriving at the Meter Box.
2nd one is on Power feed into my Hybrid Inverter, &
3rd on the output that feeds a Sub-Board.

Currently I’m just reading them with a PIC32MX170 running basic & code I have written.
It just polls the 3 addresses & reports data on a TFT & the serial console.

Would be great to have all 3 available within Home Assistant.

I see no mention in the config of a Modbus Address, but assume it using Add01, as that’s what the spare I am testing with is on.

Using this device between an ESP32 & the SDM220, and also on my working PIC connection.

Any assistance greatly appreciated, as I’m on the edge of my Skill Set.

Cheers

For anybody that comes looking:

I have a couple of these eastron meters connected to a m5stack atom,
With the esp eastron integration it gave me alot of trouble to get is stable.
Changed over to just modbus reads and that works fine and stable for weeks now.
my code:

uart:
  rx_pin: 22
  tx_pin: 19
  baud_rate: 9600
  stop_bits: 1
  parity: NONE

modbus:
  #flow_control_pin: 5
  id: modbus1

modbus_controller:
  - id: modbus002
    # Nibe F2120
    address: 0x2
    modbus_id: modbus1
    setup_priority: -10
    update_interval: 30s

  - id: modbus010
    # Car charger
    address: 10
    modbus_id: modbus1
    setup_priority: -10
    update_interval: 30s

  - id: modbus030
    # Daikin airco
    address: 30
    modbus_id: modbus1
    setup_priority: -10
    update_interval: 30s

  - id: modbus040
    # Zehnder q450
    address: 40
    modbus_id: modbus1
    setup_priority: -10
    update_interval: 30s

sensor:
#Nibe F2120
  - platform: modbus_controller
    modbus_controller_id: modbus002
    name: "Nibe heatpump f2120 kwh"
    id: nibe_heatpump_f2120_kwh
    register_type: read
    address: 0x004A
    unit_of_measurement: "kWh"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    state_class: "total_increasing"

  - platform: modbus_controller
    modbus_controller_id: modbus002
    name: "Nibe heatpump f2120 power"
    id: nibe_heatpump_f2120_power
    register_type: read
    address: 0x0034
    unit_of_measurement: "kW"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    filters:
      - multiply: -0.001
#Car charger
  - platform: modbus_controller
    modbus_controller_id: modbus010
    name: "Car charger kwh"
    id: car_charger_kwh
    register_type: read
    address: 0x0048
    unit_of_measurement: "kWh"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    state_class: "total_increasing"

  - platform: modbus_controller
    modbus_controller_id: modbus010
    name: "Car charger power"
    id: car_charger_power
    register_type: read
    address: 0x000C
    unit_of_measurement: "kW"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    filters:
      - multiply: 0.001

#Daikin
  - platform: modbus_controller
    modbus_controller_id: modbus030
    name: "Daikin airco stairs kwh"
    id: daikin_airco_stairs_kwh
    register_type: read
    address: 0x0048
    unit_of_measurement: "kWh"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    state_class: "total_increasing"

  - platform: modbus_controller
    modbus_controller_id: modbus030
    name: "Daikin airco stairs power"
    id: daikin_airco_stairs_power
    register_type: read
    address: 0x000C
    unit_of_measurement: "kW"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    filters:
      - multiply: 0.001

#Zenhder
  - platform: modbus_controller
    modbus_controller_id: modbus040
    name: "Zehnder q450 kwh"
    id: zehnder_q450_kwh
    register_type: read
    address: 0x0048
    unit_of_measurement: "kWh"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    state_class: "total_increasing"

  - platform: modbus_controller
    modbus_controller_id: modbus040
    name: "Zehnder q450 power"
    id: zehnder_q450_power
    register_type: read
    address: 0x000C
    unit_of_measurement: "kW"
    value_type: FP32
    accuracy_decimals: 3
    device_class: "energy"
    filters:
      - multiply: 0.001

text_sensor:
  - platform: template
    name: "Car charger state"
    lambda: !lambda |-
      if (id(car_charger_power).state > 0.25) {
        return std::string("Charging");
      } else {
        return std::string("Idle");
      }

The only thing is now that the statistics don’t work now in home assistant.

1 Like

Trying to read one register without success. Can some please guide me in the right direction?

esphome:
  name: tac2100
  friendly_name: tac2100

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:
  level: VERBOSE
  baud_rate: 0 
# Enable Home Assistant API
api:
  encryption:
    key: "4glSwI9DIHBUsxa7E1PYwDuXosZaP9EpRaauXvEbhUU="

ota:
  password: "5c0e9168cbb9223eb6f9bf9ce5737bc9"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Tac2100 Fallback Hotspot"
    password: "s6utAx2k0ZMM"

captive_portal:
uart:
  id: mod_bus
  rx_pin: GPIO17
  tx_pin: GPIO16
  baud_rate: 9600
  stop_bits: 1  
  
modbus:
  uart_id: mod_bus
  id: modbus1
  send_wait_time: 500ms
modbus_controller:
  - id: sdm
    address: 1 # need to adjust to your setup, standard SDM is 1
    modbus_id: modbus1
    update_interval: 5s


sensor:
  - platform: modbus_controller
    modbus_controller_id: sdm
    name: "HT NT Import Leistung"
    id: "power_factor"
    register_type: read
    address: 0
    value_type: FP32
    accuracy_decimals: 1
    unit_of_measurement: "V"
    device_class: voltage
    state_class: measurement
    filters:
      - multiply: 1.0