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
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'