Für alle die eventuell eine ähnliche Situation haben und eine Daheimladen Wallbox sowie einen Powerfox flow integrieren wollen meine YAML Dateien die nun alle Werte liefern und auch zuverlässig laufen.
Folgend die configuration.yaml:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensors.yaml
# Modbus TCP original wallbox ist 192.168.178.192 // proxy ist HA 192.168.178.133
modbus:
- name: "modbus_hub"
type: tcp
host: 192.168.178.192
port: 502
delay: 25
message_wait_milliseconds: 30
timeout: 60
sensors:
- name: "DaheimLader Status"
address: "0000"
scan_interval: 30
data_type: uint16
unique_id: daheimLader_charging_station_state
- name: "DaheimLader Status Ladekabel"
address: "0002"
scan_interval: 30
data_type: uint16
unique_id: daheimLader_cable_state
- name: "DaheimLader Fehlercode"
address: "0004"
scan_interval: 30
data_type: uint16
unique_id: daheimlader_fault_code
- name: "L1 charging current"
address: "0006"
scan_interval: 30
data_type: uint16
scale: 0.1
precision: 1
unit_of_measurement: A
device_class: current
unique_id: daheimlader_l1_charging_current
- name: "L2 charging current"
address: "0008"
scan_interval: 30
data_type: uint16
scale: 0.1
precision: 1
unit_of_measurement: A
device_class: current
unique_id: daheimlader_l2_charging_current
- name: "L3 charging current"
address: "0010"
scan_interval: 30
data_type: uint16
scale: 0.1
precision: 1
unit_of_measurement: A
device_class: current
unique_id: daheimlader_l3_charging_current
- name: "DaheimLader Ladeleistung"
unit_of_measurement: kWh
address: "0012"
scan_interval: 30
data_type: uint32
scale: 0.001
precision: 2
unique_id: daheimlader_active_power
device_class: energy
- name: "DaheimLader Zählerstand"
address: "0028"
scan_interval: 30
data_type: uint32
scale: 0.1
precision: 2
unique_id: daheimLader_energy_meter
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
- name: "DaheimLader geladene Energie"
unit_of_measurement: kWh
address: "0072"
scan_interval: 30
data_type: uint16
scale: 0.1
precision: 2
unique_id: daheimLader_charged_energy
device_class: energy
state_class: total
- name: "DaheimLader Ladedauer"
unit_of_measurement: s
address: "0078"
scan_interval: 30
data_type: uint32
unique_id: daheimlader_charging_time
device_class: duration
state_class: measurement
- name: "DaheimLader Modus"
address: "0093"
input_type: holding
scan_interval: 30
data_type: uint16
unique_id: daheimlader_charge_control
- name: "DaheimLader Ladeleistung L1"
unit_of_measurement: W
address: "0016"
scan_interval: 30
data_type: uint32
unique_id: daheimLader_l1_active_power
device_class: power
state_class: measurement
- name: "DaheimLader Ladeleistung L2"
unit_of_measurement: W
address: "0020"
scan_interval: 30
data_type: uint32
unique_id: daheimLader_l2_active_power
device_class: power
state_class: measurement
- name: "DaheimLader Ladeleistung L3"
unit_of_measurement: W
address: "0024"
scan_interval: 30
data_type: uint32
unique_id: daheimlader_l3_active_power
device_class: power
- name: "L1 real-time Spannung"
unit_of_measurement: V
address: "0109"
scan_interval: 30
data_type: uint16
unique_id: daheimlader_l1_realtime_spannung
scale: 0.1
precision: 1
device_class: voltage
- name: "L2 real-time Spannung"
unit_of_measurement: V
address: "0111"
scan_interval: 30
data_type: uint16
scale: 0.1
precision: 1
unique_id: daheimlader_l2_realtime_spannung
device_class: voltage
- name: "L3 real-time Spannung"
unit_of_measurement: V
address: "0113"
scan_interval: 30
data_type: uint16
scale: 0.1
precision: 1
unique_id: daheimlader_l3_realtime_spannung
device_class: voltage
- name: "DaheimLader Ladesteuerung"
input_type: holding
address: "0095"
scan_interval: 5
data_type: uint16
unique_id: daheimlader_charge_command
- name: "Input Current limit"
input_type: holding
address: "0091"
scan_interval: 5
data_type: uint16
unit_of_measurement: A
device_class: current
scale: 0.1
slave: "255"
unique_id: input_current_limit
- name: "Conn timeout"
input_type: holding
address: "0089"
scan_interval: 15
data_type: uint16
unit_of_measurement: s
device_class: duration
unique_id: conn_timeout
homeassistant:
customize:
sensor.daheimlader_energy_meter_scaled:
state_class: total_increasing
unit_of_measurement: kWh
template:
- trigger:
- platform: event
event_type: bubble_card_update_modules
sensor:
- name: "Bubble Card Modules"
state: "saved"
icon: "mdi:puzzle"
attributes:
modules: "{{ trigger.event.data.modules }}"
last_updated: "{{ trigger.event.data.last_updated }}"
- sensor:
- name: "Gasverbrauch Aktuell"
state: "{{ state_attr('sensor.gas_json_debug', 'Gas').CurrentConsumption }}"
unit_of_measurement: "m³"
- name: "Gasverbrauch kWh"
state: "{{ state_attr('sensor.gas_json_debug', 'Gas').CurrentConsumptionKwh }}"
unit_of_measurement: "kWh"
- name: "Gas Max"
state: "{{ state_attr('sensor.gas_json_debug', 'Gas').Max }}"
unit_of_measurement: "m³"
- name: "Gas Kosten"
state: "{{ state_attr('sensor.gas_json_debug', 'Gas').TotalDeltaCurrency | round(2) }}"
unit_of_measurement: "€"
powercalc:
In der Sensor.yaml dann folgendes:
# sensor.yaml
- platform: template
sensors:
daheimlader_charging_station_state:
friendly_name: "DaheimLader Status"
unique_id: daheimlader_charging_station_state_text
value_template: >-
{% if states('sensor.daheimlader_status') == '1' %}
Bereit
{% elif states('sensor.daheimlader_status') == '2' %}
Verbunden
{% elif states('sensor.daheimlader_status') == '3' %}
Laden startet
{% elif states('sensor.daheimlader_status') == '4' %}
Lädt
{% elif states('sensor.daheimlader_status') == '5' %}
Start fehlgeschlagen
{% elif states('sensor.daheimlader_status') == '6' %}
Laden beendet
{% elif states('sensor.daheimlader_status') == '7' %}
Systemfehler
{% elif states('sensor.daheimlader_status') == '8' %}
Ladetimer
{% elif states('sensor.daheimlader_status') == '9' %}
Firmware Upgrade
{% elif states('sensor.daheimlader_status') == '10' %}
Eingeschaltet
{% elif states('sensor.daheimlader_status') == '31' %}
Blockiert
{% else %}
Unbekannt
{% endif %}
daheimlader_cable_state:
friendly_name: "DaheimLader Status Ladekabel"
unique_id: daheimlader_cable_state_text
value_template: >-
{% if states('sensor.daheimlader_status_ladekabel') == '0' %}
Nicht verbunden
{% elif states('sensor.daheimlader_status_ladekabel') == '1' %}
Verbunden
{% else %}
Unbekannt
{% endif %}
daheimlader_fault_code:
friendly_name: "DaheimLader Fehlercode"
unique_id: daheimlader_fault_code_text
value_template: >-
{% set code = states('sensor.daheimlader_fehlercode') %}
{% if code == '0' %}
kein Fehler
{% elif code == '11' %}
CP-Kontroll Wert
{% elif code == '13' %}
Unterspannung
{% elif code == '14' %}
Überspannung
{% elif code == '15' %}
Temperatur zu hoch
{% elif code == '16' %}
Zählerwert
{% elif code == '17' %}
Leckage
{% elif code == '18' %}
Output Short
{% elif code == '19' %}
Überstrom
{% elif code == '21' %}
Fahrzeug
{% elif code == '22' %}
Fahrzeug nicht erkannt
{% elif code == '23' %}
Relais
{% elif code == '24' %}
Leckage, Gerät prüfen
{% elif code == '25' %}
PE-Fehler
{% elif code == '26' %}
Start / Stopp Ladefehler
{% else %}
Unbekannt
{% endif %}
daheimlader_charge_control:
friendly_name: "DaheimLader Modus"
unique_id: daheimlader_charge_control_text
value_template: >-
{% if states('sensor.daheimlader_modus') == '0' %}
Plug & Charge
{% elif states('sensor.daheimlader_modus') == '1' %}
RFID / OCPP Start+Stopp
{% elif states('sensor.daheimlader_modus') == '2' %}
Ladestation gesperrt
{% else %}
Unbekannt
{% endif %}
daheimlader_charged_energy_scaled:
friendly_name: "DaheimLader geladene Energie scaled"
value_template: "{{ states('sensor.daheimlader_geladene_energie') | float }}"
unit_of_measurement: kWh
device_class: energy
unique_id: daheimlader_charged_energy_scaled
daheimlader_ladedauer_scaled:
friendly_name: "DaheimLader Ladedauer scaled"
value_template: >-
{{ states('sensor.daheimlader_ladedauer') | int(0)
| timestamp_custom('%-Hh %-Mmin %-Ssec', false)
| regex_replace('(^0h| 0min| 0sec$)', '')
| regex_replace('(^ )', '') }}
unique_id: daheimlader_ladedauer_scaled
- platform: rest
name: gas_json_debug
resource: https://backend.powerfox.energy/api/2.0/my/1020ba44b968/report?day=0&month=0&year=0&fromhour=0
username: christian.stade@gmx.de
password: !secret powerfox_password
authentication: basic
scan_interval: 300
value_template: "{{ value_json.Gas.CurrentConsumption }}"
json_attributes:
- Gas