Smartmeter - ACE3000 Type 260

Finally I got my german smartmeter “ACE 3000 type 260” quick + dirty working with a simple " IR-Schreib-Lesekopf"

What to do:

1. Create a script via SSH
a) cd /config
b) mkdir scripts
c) nano ace3000.sh
d) Insert Code into file:

#!/bin/bash

# Itron ACE3000 Typ260
# einfach auslesen
# nach Idee von https://wiki.volkszaehler.org/hardware/channels/meters/power/edl-ehz/itron_ace3000_type_260 --> BASH

# Init ttyUSBx  / 300 baud 7 E 1
stty -F /dev/ttyUSB0 1:4:da7:a30:3:1c:7f:15:4:10:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

## send request
( sleep 1 ; echo -e "\x2f\x3f\x21\x0d\x0a" > /dev/ttyUSB0 ) &

while read -t8 line                                         # warten auf die Zaehlerausgabe
do                                                          # Bestaetigung nach dem Wecken nicht notwendig
  [[ "$line" =~ "1.8.0" ]] && Z1=${line:6:8}                # Wert fuer Bezug
  [[ "$line" =~ "2.8.0" ]] && Z2=${line:6:8}                # Wert fuer Einspeisung
done < /dev/ttyUSB0


length1=${#Z1}
length2=${#Z2}

#printf '{"Strom": {"incoming":'$Z1', "outgoing":'$Z2'} }'
#check if there is an value read
if [[ $length1 -eq 8 ]] && [[ $length2 -eq 8 ]] 
then
  printf $Z1', '$Z2
fi

e) maybee change your device “IR-Schreib-Lesekopf” → /dev/ttyUSB0 … /dev/ttyUSB1 …
f) save file (ctrl + x)
g) chmod +x ace3000.sh
h) leave ssh

2. Create command_line sensor
a) Edit sensor.yaml or where you have defined your sensors
b) add this:

# Stromzähler      
  - platform: command_line
    name: smartmeter
    command: "/bin/bash /config/scripts/ace3000.sh"
    scan_interval: 900
    command_timeout: 30
    
  - platform: template
    sensors:
      smartmeter_in:
       value_template: "{% set list = states.sensor.smartmeter.state.split(',') %} {{ list[0] }}"
       friendly_name: 'Incoming'
       unit_of_measurement: ' kWh'
      smartmeter_out:
       value_template: "{% set list = states.sensor.smartmeter.state.split(',') %} {{ list[1] }}"
       friendly_name: 'Outgoing'
       unit_of_measurement: ' kWh'

e) maybee change scan interval (900 - 15 minutes, 300 - 5 minutes etc)
d) save and close file

3. Lovelace
a) add card to dashboard
b) insert code:

type: entities
entities:
  - entity: sensor.smartmeter_in
    icon: hass:power-plug-outline
    name: insg. Verbauch
  - entity: sensor.smartmeter_out
    icon: hass:transmission-tower
    name: insg. Einspeisung
title: Stromzähler

c) close card

4. Restart Home Assistent

image

This is quick an dirty. Hopefully some make some change to dsmr-parser, to get it clean and simple work. → dsmr-parser

5. Energy Dash
a) add this to template(.yaml)

# template.yaml
  sensor:
    - name: "Netz-Bezug"
      unit_of_measurement: "kWh"
      state: >
        {% set list = states.sensor.smartmeter.state.split(',') %}
        {{ list[0] | float(default='unavailable') }}
      state_class: total_increasing #measurement
      device_class: energy
      #attributes:         
      #  last_reset: '1970-01-01T00:00:00+00:00'        
        
    - name: "Netz-Einspeisung"
      unit_of_measurement: "kWh"
      state: >
        {% set list = states.sensor.smartmeter.state.split(',') %}
        {{ list[1] | float(default='unavailable') }}
      state_class: total_increasing #measurement
      device_class: energy
      #attributes:         
      #  last_reset: '1970-01-01T00:00:00+00:00'   

Thank you very much! This really helps me out.

But one question, how do you manage to get the ‚Netzbezug‘ data into the energy board?

I have added it to the board, but the data isn’t shown up. Only my configured cost accumulates.

image

Works fine on my HA.

I had to add my values “Netz-Bezug” and “Netz-Einspeisung” here:

image

Maybe disable:

      attributes:         
        last_reset: '1970-01-01T00:00:00+00:00'
1 Like

Thank you for your reply.

I already added Netz-Bezug to the energy dashboard.

When I disable ‚attributes‘ an error message states that measurement was defined but no ‚last reset‘

Can I post my config files? May be I have done something wrong?

Just to mention, I only have consumption. There‘s no return at the moment.

sure you can. :slight_smile:

Great!

Here’s my config.

ace3000.sh

#!/bin/bash

# Itron ACE3000 Typ260
# einfach auslesen
# nach Idee von https://wiki.volkszaehler.org/hardware/channels/meters/power/edl-ehz/itron_ace3000_type_260 --> BASH

# Init ttyUSBx  / 300 baud 7 E 1
stty -F /dev/ttyUSB0 1:4:da7:a30:3:1c:7f:15:4:10:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

## send request
( sleep 1 ; echo -e "\x2f\x3f\x21\x0d\x0a" > /dev/ttyUSB0 ) &

while read -t8 line                                         # warten auf die Zaehlerausgabe
do                                                          # Bestaetigung nach dem Wecken nicht notwendig
  [[ "$line" =~ "1.8.0" ]] && Z1=${line:6:8}                # Wert fuer Bezug
  [[ "$line" =~ "2.8.0" ]] && Z2=${line:6:8}                # Wert fuer Einspeisung
done < /dev/ttyUSB0


length1=${#Z1}
#length2=${#Z2}

#printf '{"Strom": {"incoming":'$Z1'} }'
#check if there is an value read
if [[ $length1 -eq 8 ]]
then
  printf $Z1', '$Z2
fi

If I run ‘/bin/bash /config/scripts/ace3000.sh’ I get this result:

bash-5.1# /bin/bash /config/scripts/ace3000.sh
026397.4, vi ace3000.sh

Looks good so far.

My ‘sensors.yaml’ looks like this:

# Stromz..hler
  - platform: command_line
    name: smartmeter
    command: "/bin/bash /config/scripts/ace3000.sh"
    scan_interval: 300
    command_timeout: 30

  - platform: template
    sensors:
      smartmeter_in:
       value_template: "{% set list = states.sensor.smartmeter.state.split(',') %} {{ list[0] }}"
       friendly_name: 'Incoming'
       unit_of_measurement: ' kWh'
      smartmeter_out:
       value_template: "{% set list = states.sensor.smartmeter.state.split(',') %} {{ list[1] }}"
       friendly_name: 'Outgoing'
       unit_of_measurement: ' kWh'

Card on dashboard:

type: entities
entities:
  - entity: sensor.smartmeter_in
    icon: hass:power-plug-outline
    name: insg. Verbauch
  - entity: sensor.smartmeter_out
    icon: hass:transmission-tower
    name: insg. Einspeisung
title: Stromzähler

My template.yaml (just this content, nothing else):

# template.yaml
  sensor:
    - name: "Netz-Bezug"
      unit_of_measurement: "kWh"
      state: >
        {% set list = states.sensor.smartmeter.state.split(',') %}
        {{ list[0] | float(default='unavailable') }}
      state_class: total_increasing #measurement
      device_class: energy
      #attributes:
      #  last_reset: '1970-01-01T00:00:00+00:00'

    - name: "Netz-Einspeisung"
      unit_of_measurement: "kWh"
      state: >
        {% set list = states.sensor.smartmeter.state.split(',') %}
        {{ list[1] | float(default='unavailable') }}
      state_class: total_increasing #measurement
      device_class: energy
      #attributes:
      #  last_reset: '1970-01-01T00:00:00+00:00'

Thanks again!

This is my card on dashboard:

title: heutige Energieverteilung
type: energy-distribution
link_dashboard: false

sensors.yaml I only use this:

# Stromzähler      
  - platform: command_line
    name: smartmeter
    command: "/bin/bash /config/scripts/ace3000.sh"
    scan_interval: 300
    command_timeout: 30

You return values of ace3000.sh are different. No Second value - maybe no feed.

Maybe for you, try this:

# Itron ACE3000 Typ260
# einfach auslesen
# nach Idee von https://wiki.volkszaehler.org/hardware/channels/meters/power/edl-ehz/itron_ace3000_type_260 --> BASH

# Init ttyUSBx  / 300 baud 7 E 1
stty -F /dev/ttyUSB0 1:4:da7:a30:3:1c:7f:15:4:10:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

## send request
( sleep 1 ; echo -e "\x2f\x3f\x21\x0d\x0a" > /dev/ttyUSB0 ) &

while read -t8 line                                         # warten auf die Zaehlerausgabe
do                                                          # Bestaetigung nach dem Wecken nicht notwendig
  [[ "$line" =~ "1.8.0" ]] && Z1=${line:6:8}                # Wert fuer Bezug
done < /dev/ttyUSB0

length1=${#Z1}

#printf '{"Strom": {"incoming":'$Z1'} }'
#check if there is an value read
if [[ $length1 -eq 8 ]]
then
  printf $Z1'
fi

and template.yaml:

# template.yaml
  sensor:
    - name: "Netz-Bezug"
      unit_of_measurement: "kWh"
      state: >
        {% set list = states.sensor.smartmeter.state.split(',') %}
        {{ list[0] | float(default='unavailable') }}
      state_class: total_increasing #measurement
      device_class: energy
      #attributes:
      #  last_reset: '1970-01-01T00:00:00+00:00'
1 Like

ok, thanks! Now it is working! :partying_face:

image

Great!!!

1 Like