Reading Schneider PowerTags using Modbus and Acti9 Smartlink SI D

I am writing this because it took me so long to figure it out on my own as I did not find a guide from anybody else.

My PowerTag setup includes:

1x Acti 9 Smartlink SI D (A9XMWA20)

2x Acti 9 PowerTag 1p+N (A9MEM1521)

Setting up the Smartlink is relatively easy so I will not go over it here. But when you do it, will ask you what Phase is connected to the device, this is important for later. Smartlink will automatically address the devices from 150 and up.

In the configuration.yaml add the following:

modbus:
- name: "hub2"
    type: tcp
    host: 192.168.x.x (replace the x with your own address)
    port: 502
    sensors:
      - name: "Powertag: Name 1"
        device_class: power
        state_class: measurement
        slave: 151
        address: 3059
        unit_of_measurement: W
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 power_factor"
        device_class: power_factor
        slave: 151
        address: 3083
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 totalt enegry"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: Wh
        slave: 151
        address: 3203
        count: 4
        precision: 1
        scan_interval: 2
        data_type: int

      - name: "Powertag: Name 1 tempratur"
        device_class: temperature
        state_class: measurement
        slave: 151
        address: 3131
        unit_of_measurement: "°C"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 voltage L1-N"
        device_class: voltage
        state_class: measurement
        slave: 151
        address: 3027
        unit_of_measurement: "V"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 voltage L2-N"
        device_class: voltage
        state_class: measurement
        slave: 151
        address: 3029
        unit_of_measurement: "V"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 voltage L3-N"
        device_class: voltage
        state_class: measurement
        slave: 151
        address: 3024
        unit_of_measurement: "V"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 current L1"
        device_class: current
        state_class: measurement
        slave: 151
        address: 2999
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 current L2"
        device_class: current
        state_class: measurement
        slave: 151
        address: 3001
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 1 current L3"
        device_class: current
        state_class: measurement
        slave: 151
        address: 3003
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float


      - name: "Powertag: Name 2 power"
        device_class: power
        slave: 150
        address: 3059
        unit_of_measurement: W
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 power_factor"
        device_class: power_factor
        slave: 150
        address: 3083
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 totalt enegry"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: Wh
        slave: 150
        address: 3203
        count: 4
        precision: 1
        scan_interval: 2
        data_type: int

      - name: "Powertag: Name 2 tempratur"
        device_class: temperature
        state_class: measurement
        slave: 150
        address: 3131
        unit_of_measurement: "°C"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 voltage L1-N"
        device_class: voltage
        state_class: measurement
        slave: 150
        address: 3027
        unit_of_measurement: "V"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 voltage L2-N"
        device_class: voltage
        state_class: measurement
        slave: 150
        address: 3029
        unit_of_measurement: "V"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 voltage L3-N"
        device_class: voltage
        state_class: measurement
        slave: 150
        address: 3024
        unit_of_measurement: "V"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 current L1"
        device_class: current
        state_class: measurement
        slave: 150
        address: 2999
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 current L2"
        device_class: current
        state_class: measurement
        slave: 150
        address: 3001
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

      - name: "Powertag: Name 2 current L3"
        device_class: current
        state_class: measurement
        slave: 150
        address: 3003
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

I have not been able to get a reading from the temperature sensors, but the address is there. There might be that my version of the PowerTag does not have a temperature senor in it.
If you have multiple Modbus adapters you can do til like this:

modbus:
- name: "hub1"
    type: tcp
    host: 192.168.x.x
    port: 502
    sensors:
      - name: "some other sensor"
        slave: 151
        address: 3059
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

- name: "hub2"
    type: tcp
    host: 192.168.x.x
    port: 502
    sensors:
      - name: "Powertag: Name 1"
        device_class: power
        state_class: measurement
        slave: 151
        address: 3059
        unit_of_measurement: W
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

If you want more sensors you can find the registrer list here: https://www.se.com/in/en/faqs/FA379753/

3 Likes

Thanks for sharing this. Being a total beginner using modbus, I’m trying to setup a modbus sensor reading from Acti9 Powertag Link (manual with registers here), but so far I haven’t succeed.

Here’s what I’m trying to setup:

- name: "MY-HUB"
  type: tcp
  host: 192.168.x.x
  port: 502
  close_comm_on_error: true
  delay: 5
  timeout: 5
  sensors:

    - name: "MAINS IN"
      device_class: power
      state_class: measurement
      slave: 2
      address: 3060
      unit_of_measurement: W
      count: 2
      precision: 1
      scan_interval: 30
      data_type: float32

But I have yet to get some kind of reading out this:

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:291
Integration: Modbus
First occurred: 23:27:56 (1 occurrences)
Last logged: 23:27:56
Pymodbus: MY-HUB: Exception Response(131, 3, IllegalValue)

@AKRANO you could add any insight on this error I’d appreciate it.

Have you been able to connect directly to the device using software on your computer? I used Modbus Client X so I was sure that it worked before importing it to Home Assistant ModbusClientX - Modbus Tool download | SourceForge.net

Also using “count: 2” is telling home assistant to read address 3060 and 3061, by adding datatype float32 to the mix might confuse it to read 3060-3063 as one modbus address is only 16 bit big.

I also had a lot of problems using any different names than hub and a number when setting it up originally. For some reason only i was only able to get hub1 and hub2 working.

One more thing. the reason that I read from address 3059 instead of 3060 is because of an peculiar way home assistant handles addresses. It start reading address 1 as 0, at least it does for the Flexit unit I am also using on Modbus. You therefore need to subtract 1 for every address in the Schneider provided to get the values to line up. At least it seems to work that way, because it is the only way I am able to get any sensible numbers form the system. Modbus Client X also reads the address the same way, but have big problems reading floats, so I have not been able to read the values directly from it. You will however see if the slave address is correct, and that the value address is present.

Hi @AKRANO had my measuring working, but suddenly it stopped working. Could you check my config, i cant figure out how to make it work again

Hardware info

  • 1 x Acti9 PowerTag Link HD
  • 1 x A9MEM1570

I have a seperat filer for the sensors, so they are not in my config.yaml file

Config.yaml

#Modbus addon
modbus:
  - name: powertag_tavle
    type: tcp
    host: 192.168.254.41
    port: 502
    delay: 5
    close_comm_on_error: true
    retry_on_empty: true
    retries: 10

/sensor/powertag_volt.yaml

- platform: modbus
  scan_interval: 5
  registers:
    - name: Powertag_Fase_L1_V
      hub: powertag_tavle
      unit_of_measurement: V
      address: 1
      count: 2
      register: 3028
      precision: 2
      #scale: 0.0001
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L2_V
      hub: powertag_tavle
      unit_of_measurement: V
      count: 2
      register: 3030
      precision: 2
      #scale: 0.0001
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L3_V
      hub: powertag_tavle
      unit_of_measurement: V
      count: 2
      register: 3032
      precision: 2
      #scale: 0.0001
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L1_A
      hub: powertag_tavle
      unit_of_measurement: A
      count: 2
      register: 3000
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L2_A
      hub: powertag_tavle
      unit_of_measurement: A
      count: 2
      register: 3002
      precision: 2
      #scale: 0.01
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L3_A
      hub: powertag_tavle
      unit_of_measurement: A
      count: 2
      register: 3004
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L1_W
      hub: powertag_tavle
      unit_of_measurement: W
      count: 2
      register: 3054
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L2_W
      hub: powertag_tavle
      unit_of_measurement: W
      count: 2
      register: 3056
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32
    - name: Powertag_Fase_L3_W
      hub: powertag_tavle
      unit_of_measurement: W
      count: 2
      register: 3058
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32
    - name: Powertag_total_W
      hub: powertag_tavle
      unit_of_measurement: W
      count: 2
      register: 3059
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32



It is difficult to tell. It looks like we have different hubs for the Powertags. I am not able to change the mod-bus address on mine. But comparing my setup vs yours I think the problem lies in the address if it worked before.
I have also put everything in my main config file and it starts like this:

- name: "hub2"
    type: tcp
    host: 192.168.x.x (replace the x with your own address)
    port: 502
    sensors:
      - name: "Powertag: Name 1 current L1"
        device_class: current
        state_class: measurement
        slave: 151
        address: 2999
        unit_of_measurement: "A"
        count: 2
        precision: 1
        scan_interval: 2
        data_type: float

I do not have the hub as an entry on the sensor like you. I also had problems naming the hub anything else than “hub” and a number. Every time I tried it fails.

Yours:

- name: Powertag_Fase_L1_A
      hub: powertag_tavle
      unit_of_measurement: A
      count: 2
      register: 3000
      precision: 2
      #scale: 2
      slave: 1
      data_type: float32

You put register but I used address. also my address number is 1 lower than yours. I found that some products use 0 as the first address and some others uses 1. This is apparently a common problem and was the same for my Flexit ventilation system.

Morning,
After the latest version 2022.4 has been relased my sensors are broken.
I have been using data_type: float - but thats not allowed anymore

are you having same issues @akrano

Yes. Sadly my quick fix for datatypes does not work anymore, and you have to specify float32 and int64. Here is how it looks for me now:

      - name: "Powertag: heat pump power"
        device_class: power
        state_class: measurement
        slave: 154
        address: 3059
        unit_of_measurement: W
        count: 2
        precision: 1
        scan_interval: 5
        data_type: float32

      - name: "Powertag: heat pump total "
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: Wh
        slave: 154
        address: 3203
        count: 4
        precision: 1
        scan_interval: 5
        data_type: int64

I also found the manual with the addresses that I am using here:

Thx for your gr8 help again, everything is up and running again.

I’m setting up a few powertag link’s and thankfully got to this post, very helpful.

I was trying to add the mains powertag link to Home Assistant’s Energy dashboard (or others as a device) but I haven’t been able to yet.

I’m following the same logic used for some Sonoff or Shelly devices, by creating a kWh template based on a working one, it doesn’t appear as a selection:

(deleted, check next post)

Does anyone have some info on how to get the data on the energy dashboard?

Nevermind the code I posted above. Below is my working Energy sensor (in kWh):

modbus.yaml:

- name: "PTL1"
  type: tcp
  host: 192.168.1.41
  port: 502
  close_comm_on_error: true
  delay: 5
  timeout: 20
  sensors:
   
    - unique_id: qee_powertaglink_mains_energy_kwh
      name: "QEE - PowertagLink - Mains - Energy - kWh"
      device_class: energy
      state_class: total_increasing
      slave: 10
      address: 3203
      unit_of_measurement: kWh
      scale: 0.001
      count: 4
      precision: 1
      scan_interval: 5
      data_type: int64

And here’s my “helper” template, following Sonoff/Shelly templates to get those working with the Energy dashboard (but doesn’t appear listed):

templates.yaml:

- sensor:
    - unique_id: qee_powertaglink_entrada_energy_kwh
      attributes:
        friendly_name: "QEE"
        last_reset: "1970-01-01T00:00:00+00:00"
      state: >-
        {{ ( states('sensor.qee_powertaglink_mains_energy_kwh') | float(0) 
            )}}
      unit_of_measurement: kWh
      device_class: energy
      state_class: total_increasing
      availability: >
          {{ not 'unavailable' in 
             [ states('sensor.qee_powertaglink_mains_energy_kwh')
             ] }}
             

Solved. Entities were being filtered out by glob exclusion in database records.

This would be great if we could comunicate with the powertag directly, without the Smartlink SI D. This way the powertag will be, probally, the best energy analyser in the market.

1 Like

I have been testing powertag with direct link to zigbee2mqtt, model R9M70 works perfect, model R9M41links but don’t show any values

Hey, I’m interested in the powertag. Do you think it would be compatible with ZHA?
I have some of the wiser switches working with ZHA using the conbee 2

No, I tried that, only zigbee2mqtt works, and that not even 100%

Thanks a lot AKRANO for sharing this. It works very easily for me after 1st test.
The hub name was not a problem for me.
It saved me a lot of time and frustration to achieve to find the good values !

1 Like