E3Dc Integration

Hast du am E3DC System den Zugriff erlaubt? und auch auf Modbus umgeschaltet?

Hallo Nicknol,

ich hab am E3DC den Modus aktiviert und auch in der zweiten Seite den Port abgeschaut (unter smarte Funktionen). Muss ich den Zugriff noch an einer weitern Stelle erlauben?

tja, das ist bei mir schon sooo lange her. Was sagt denn die E3DC Modbus-Doku?

Die Doku sagt auch:

für die mir bekannten HA Modbus Zugriffe brauchst du „E3DC“ Mode

sorry für das schlechte bild. Ja … wie in der Doku beschrieben ist E3DC einstellt.

und so sieht meine Config aus…

und hier die Modus.yaml

Die kenne ich nicht, kann ich also auch nicht viel zu sagen.

Hilfreich für alle wäre es, wenn du

  • den Link auf die Integration bereitstellst
  • echte Quelltexte (statt Bildschirmfotos) bereitstellst, und zwar mindestens von
    • dem relevanten Teil deiner configuration.yaml
    • und den für modbus relevanten inkludierten yaml Dateien
  • die von dir verwendete Doku (E3DC) teilst.

Die 502 in deiner Fehlermeldung deutet, als HTTP response interpretiert, auf „Bad Gateway“, also eine reichlich unerwartete Antwort.

hast Du mal den e3 neu gestartet nachdem Du Modus aktiviert hast

Ok … hier mal meine Info.

Hier den Link für die Integration

So sieht meine Config in summe aus(ist nicht viel):

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
homeassistant:
packages: !include_dir_merge_named packages/

und die Modbus.Yaml ist die von dem Github. Nur mit meiner IP wie im Screenshot.
e3dc_modbus:
modbus:
- name: „e3dc“
type: tcp
host: „192.168.2.29“
port: 502
sensors:
# Identification Block
- name: E3DC Modbus Firmware
unique_id: e3dc_modbus_firmware
address: 40001
data_type: uint16
scan_interval: 86400

vielleicht hab ich aber auch noch etwas grundsätzliches nicht verstanden. Für Modbus muss ich doch nicht noch eine Integration installieren oder? ich hatte das so verstanden das HA das kann sobald ich die Modbus.Yaml richtig einbinde.

bitte Code immer als Code einfügen.
image

und wenn ich das richtig sehe, bindest du die modbus.yaml nirgengs in configuration.yaml ein. es fehlt ein include

# packages: !include_dir_merge_named custom_components/
# homeassistant:
#   packages: !include_dir_merge_named modbus.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
homeassistant:
 packages: !include_dir_merge_named packages/

die letzte Zeile..
die Modbus.yaml liegt noch unter packages/e3dc/Modbus.yaml

@Katzetom: E3DC hab ich einen Neustart gemacht. Hat aber nix gebracht

bei den Packages bin ich raus. Damit habe ich keine Erfahrung. Doch du hast es ja wie in der Doku gemacht.

die 502 in der response deutet auch eher auf einen Verbinungsproblem hin.
Bist du dir sicher mit der IP-Adresse des E3DC Systems? Und sind dein Home Assistant und E3DC im gleichen (V)LAN?

Hallo Nicknol,

Welche Lösung hast du verwendet? ich häng nicht an dieser Lösung. Ich will nur die den E3DC im HA haben.

ich habe mein Heimnetz nicht in VLANs aufgeteilt. der E3DC ist über einen WLAN-Repeater (von Fritz) im Netz (E3DC kann kann nur LAN und ich hab im Keller kein LAN nur WLAN). Und HA ist direkt an die Fritz!Box angebunden.
Ping von HA zu E3DC geht durch und auch der Port habe ich gescheckt

mbtget -r 1 -a 0 -d INT -t 192.168.2.29

sagt open

Also gerne versuche ich auch deine Lösung mal.

in meiner configuration.yaml steht natürlich:

modbus: !include modbus.yaml

Allerdings befürchte ich, dass Dir am E3DC System noch eine Einstellung fehlt. (response 502).

Vielleicht fängst Du damit an, nur das Magic Byte zu finden.

2 „Gefällt mir“

Oh man, ich könnte dich küssen. Hab den Fehler gefunden. Wie all so oft, sitzt der Fehler direkt vor der Tastatur! Das E3DC System bei mir hat zwei IP Adressen und ich hab natürlich die Falsche genutzt.

Danke auch für dein Modbus File ich werd mir das mit dem Update Zyklus ansehen.

Super! Du hast es gefunden! :slight_smile:

Jetzt schau noch, ob du sinnvolle Werte bekommst, siehe offset Problematik.

Viel Erfolg

1 „Gefällt mir“

Um die neuen Möglichkeiten des Energiedashboards nutzen zu können, müssen alle Sensoren die richtige state_class bekommen.

Insbesondere die Leistungs-Sensoren brauchen:

state_class: measurement

@Mac1 @Katzetom

1 „Gefällt mir“

Hallo !

@Nicknol du hast weiter oben geschrieben, dass Du auch die Wallbox über Modbus steuerst. D.h. Du schreibst Werte per Modbus zurück.

Kannst Du bitte den Code dafür hier zeigen ?

Ich bin beim Thema Modbus bisher ahnungslos und benötige einen Schups in die richtige Richtung :slight_smile:

Das ist bei mir schon lange her :wink:

Ich habe mir einige Skripte geschrieben, um

  • das Laden ein-/auszuschalten
  • den „Sonnenmodus“ (also Überschussladen) ein-/auszuschalten

Generisch

Write Register turn off bit

alias: Write Register turn off bit
sequence:
  - action: modbus.write_register
    data:
      hub: "{{ hub }}"
      unit: "{{ unit }}"
      address: "{{ address }}"
      value: >-
        {{ states(sensor_value) | int(default=0) | bitwise_and(65535 - (2 ** (bit | int - 1))) }}
  - action: homeassistant.update_entity
    data:
      entity_id: "{{ sensor_value }}"

Write Register turn on bit

alias: Write Register turn on bit
sequence:
  - action: modbus.write_register
    data:
      hub: "{{ hub }}"
      unit: "{{ unit }}"
      address: "{{ address }}"
      value: >-
        {{ states(sensor_value) | int(default=0) | bitwise_or(2 ** (bit | int - 1)) }}
  - action: homeassistant.update_entity
    data:
      entity_id: "{{ sensor_value }}"

Speziell

e3dc Wallbox laden toggle

alias: e3dc Wallbox laden toggle
sequence:
  - if:
      - condition: state
        entity_id: binary_sensor.e3dc_wallbox_0_charging_open
        state: "off"
    then:
      - action: script.write_register_turn_off_bit
        data:
          bit: 3
          hub: e3dc
          unit: 1
          address: 40087
          sensor_value: sensor.e3dc_wallbox_0_ctrl
    else:
      - action: script.write_register_turn_on_bit
        data:
          bit: 3
          hub: e3dc
          unit: 1
          address: 40087
          sensor_value: sensor.e3dc_wallbox_0_ctrl
mode: single

e3dc Sonnenmodus toggle

alias: e3dc Sonnenmodus toggle
sequence:
  - if:
      - condition: state
        entity_id: binary_sensor.e3dc_wallbox_0_solar
        state: "on"
    then:
      - action: script.write_register_turn_off_bit
        data:
          bit: 2
          hub: e3dc
          unit: 1
          address: 40087
          sensor_value: sensor.e3dc_wallbox_0_ctrl
    else:
      - action: script.write_register_turn_on_bit
        data:
          bit: 2
          hub: e3dc
          unit: 1
          address: 40087
          sensor_value: sensor.e3dc_wallbox_0_ctrl
mode: single

Sensoren

Die Skripte verwenden Sensoren, hier die Wesentlichen:

modbus.yaml

# -----------
# modbus E3DC
# magic byte
#    expected at 400001
#    found at 40000
#    => offset -1
# -----------
- name: e3dc
  type: tcp
  host: <<IP Address>>
  port: 502
  delay: 5
  timeout: 5
  sensors:
    - name: E3DC Magic Byte
      unique_id: e3dc_magic_byte
      address: 40000
      data_type: uint16
      scan_interval: 86400

    - name: E3DC Wallbox 0 CTRL
      unique_id: e3dc_wallbox_0_ctrl
      data_type: uint16
      address: 40087

template.yaml

- name: E3DC Wallbox 0 verfügbar
    unique_id: e3dc_wallbox_0_available
    default_entity_id: binary_sensor.e3dc_wallbox_0_available
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(1) > 0 }}"

  - name: E3DC Wallbox 0 Solarbetrieb aktiv
    unique_id: e3dc_wallbox_0_solar
    default_entity_id: binary_sensor.e3dc_wallbox_0_solar
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(2) > 0 }}"

  - name: E3DC Wallbox 0 Laden freigegeben
    unique_id: e3dc_wallbox_0_charging_open
    default_entity_id: binary_sensor.e3dc_wallbox_0_charging_open
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(4) == 0 }}"

  - name: E3DC Wallbox 0 Auto lädt
    unique_id: e3dc_wallbox_0_car_charging
    default_entity_id: binary_sensor.e3dc_wallbox_0_car_charging
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(8) > 0 }}"

  - name: E3DC Wallbox 0 Typ2 Stecker eingesteckt
    unique_id: e3dc_wallbox_0_typ2_plug_plugged
    default_entity_id: binary_sensor.e3dc_wallbox_0_typ2_plug_plugged
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(16) > 0 }}"

  - name: E3DC Wallbox 0 Typ2 Stecker verriegelt
    unique_id: e3dc_wallbox_0_typ2_plug_locked
    default_entity_id: binary_sensor.e3dc_wallbox_0_typ2_plug_locked
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(32) > 0 }}"

  - name: E3DC Wallbox 0 drei Phasen aktiv
    unique_id: e3dc_wallbox_0_typ2_3phase
    default_entity_id: binary_sensor.e3dc_wallbox_0_typ2_3phase
    state: "{{ states('sensor.e3dc_wallbox_0_ctrl')|int|bitwise_and(4096) == 0 }}"

Das solltest du alles an Deine Gegebenheiten anpassen, und Dir in jedem Fall die Doku von E3DC zum Modbus herunterladen und lesen.

Hier noch der relevante Teil meines GUIs:

  type: card
  content:
    square: false
    type: grid
    cards:
      - type: custom:mushroom-template-card
        secondary: null
        primary: ""
        icon: |-
          {% if is_state('binary_sensor.e3dc_wallbox_0_charging_open', 'on') %}
            mdi:toggle-switch-outline
          {% else %}
            mdi:toggle-switch-off-outline
          {% endif %}
        layout: vertical
        icon_color: |-
          {% if is_state('binary_sensor.e3dc_wallbox_0_charging_open', 'on') %}
            green
          {% else %}
            grey
          {% endif %}
        tap_action:
          action: none
        hold_action:
          action: call-service
          service: script.e3dc_wallbox_laden_toggle
          target: {}
        double_tap_action:
          action: none
      - type: custom:mushroom-template-card
        secondary: null
        primary: ""
        icon: |-
          {% if is_state('binary_sensor.e3dc_wallbox_0_solar', 'on') %}
            mdi:weather-sunny
          {% else %}
            mdi:transmission-tower
          {% endif %}
        layout: vertical
        icon_color: |-
          {% if is_state('binary_sensor.e3dc_wallbox_0_car_charging', 'on') %}
            {% if is_state('binary_sensor.e3dc_wallbox_0_solar', 'on') %}
              green
            {% else %}
              orange
            {% endif %}
          {% else %}
            grey
          {% endif %}
        tap_action:
          action: none
        hold_action:
          action: call-service
          service: script.e3dc_sonnenmodus_toggle
          target: {}
        double_tap_action:
          action: none
      - type: custom:mushroom-template-card
        secondary: null
        primary: ""
        icon: >-
          {% if is_state('binary_sensor.e3dc_wallbox_0_typ2_plug_plugged', 'on')
          and  
                is_state('binary_sensor.e3dc_wallbox_0_typ2_plug_locked', 'off') %}
            mdi:ev-plug-ccs2
          {% elif is_state('binary_sensor.e3dc_wallbox_0_typ2_plug_locked',
          'on') %}
            mdi:lock-outline
          {% else %}
            mdi:lock-open-outline
          {% endif %}
        tap_action:
          action: none
        hold_action:
          action: none
        double_tap_action:
          action: none
        layout: vertical
        icon_color: >-
          {% if is_state('binary_sensor.e3dc_wallbox_0_typ2_plug_plugged', 'on')
          and  
                is_state('binary_sensor.e3dc_wallbox_0_typ2_plug_locked', 'off') %}
            orange
          {% elif is_state('binary_sensor.e3dc_wallbox_0_typ2_plug_locked',
          'on') %}
            red
          {% else %}
            grey
          {% endif %}
      - type: custom:mushroom-template-card
        secondary: null
        primary: ""
        icon: |-
          {% if is_state('binary_sensor.e3dc_wallbox_0_car_charging', 'on') %}
            mdi:lightning-bolt-outline
          {% else %}
            mdi:sleep
          {% endif %}
        tap_action:
          action: none
        hold_action:
          action: none
        double_tap_action:
          action: none
        layout: vertical
        icon_color: |-
          {% if is_state('binary_sensor.e3dc_wallbox_0_car_charging', 'on') %}
            blue
          {% else %}
            grey
          {% endif %}
      - type: conditional
        conditions:
          - entity: binary_sensor.e3dc_wallbox_0_typ2_3phase
            state: "on"
        card:
          type: custom:mushroom-template-card
          primary: ""
          secondary: 3-Phasen
          icon: ""
          layout: horizontal
          tap_action:
            action: none
          hold_action:
            action: none
          double_tap_action:
            action: none
    columns: 1
1 „Gefällt mir“