Koexistenz HA und evcc

Ich habe es nun wie folgt gemacht:

Eine Automation angelegt die alle 5 Sek. die benötigten Werte über den mqtt.publish service veröffentlicht:

alias: PV_Prod to EVCC via MQTT
description: ""
trigger:
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - service: mqtt.publish
    data:
      topic: pvdataevcc/sensor/power_meter_active_power_1
      payload_template: " {{ states('sensor.power_meter_active_power_1') }} "
  - service: mqtt.publish
    data:
      topic: pvdataevcc/sensor/power_meter_consumption_1
      payload_template: " {{ states('sensor.power_meter_consumption_1') }} "
  - service: mqtt.publish
    data:
      topic: pvdataevcc/sensor/inverter_input_power_with_efficiency_loss
      payload_template: " {{ states('sensor.inverter_input_power_with_efficiency_loss') }} "
  - service: mqtt.publish
    data:
      topic: pvdataevcc/sensor/battery_charge_discharge_power_1
      payload_template: " {{ states('sensor.battery_charge_discharge_power_1') }} "
  - service: mqtt.publish
    data:
      topic: pvdataevcc/sensor/battery_state_of_capacity_1
      payload_template: " {{ states('sensor.battery_state_of_capacity_1') }} "
mode: single

Die Huawei Integration läuft bei mir mit einem Updateintervall von 15 Sekunden. Ich habe dazu die Datei /config/custom_components/huawei_solar/const.py angepasst und den UPDATE_INTERVAL von 30 auf 15 geändert

UPDATE_INTERVAL = timedelta(seconds=15)
# optimizer data is only refreshed every 5 minutes by the inverter.
OPTIMIZER_UPDATE_INTERVAL = timedelta(minutes=5)

Im EVCC dann auch mit Regelintervall von 15 Sekunden. Meine EVCC.yaml sieht wie folgt aus:

network:
  # schema is the HTTP schema
  # setting to `https` does not enable https, it only changes the way URLs are generated
  schema: http
  # host is the hostname or IP address
  # if the host name contains a `.local` suffix, the name will be announced on MDNS
  # docker: MDNS announcements don't work. host must be set to the docker host's name.
  host: homeassistant.local
  # port is the listening port for UI and api
  # evcc will listen on all available interfaces
  port: 7070

interval: 15s # control cycle interval
sponsortoken: # your token from sponsor.evcc.io

# database configuration for persisting charge sessions and settings
# database:
#   type: sqlite
#   dsn: <path-to-db-file>

# sponsor token enables optional features (request at https://sponsor.evcc.io)
# sponsortoken:

# telemetry enables aggregated statistics
#
# Telemetry allows collecting usage data (grid and green energy, charge power).
# Data is aggregated, no individual charging sessions are tracked. The collected,
# anonymous data can be retrieved using https://api.evcc.io.
#
# See https://github.com/evcc-io/evcc/pull/4343 or details.
#
# For time being, this is only available to sponsors, hence data is associated with
# the sponsor token's identity.
#
# telemetry: true

# log settings
log: info
levels:
  site: debug
  lp-1: debug
  lp-2: debug
  mqtt: debug
  cache: error
  db: error

# modbus proxy for allowing external programs to reuse the evcc modbus connection
# each entry will start a proxy instance at the given port speaking Modbus TCP and
# relaying to the given modbus downstream device (either TCP or RTU, RS485 or TCP)
modbusproxy:
  #  - port: 5200
  #    uri: solar-edge:502
  #    # rtu: true
  #    # readonly: true

# meter definitions
# name can be freely chosen and is used as reference when assigning meters to site and loadpoints
# for documentation see https://docs.evcc.io/docs/devices/meters
meters:
  - name: grid
    type: custom
    power:
      source: mqtt
      broker: 192.168.xxx.xxx:1883
      topic: pvdataevcc/sensor/power_meter_active_power_1
      user: xxx
      password: xxx
      scale: 1
      timeout: 30s
    energy:
      source: mqtt
      broker: 192.168.xxx.xxx:1883
      topic: pvdataevcc/sensor/power_meter_consumption_1
      user: xxx
      password: xxx
      scale: 1
      timeout: 30s
  - name: pv
    type: custom
    power:
      source: mqtt
      broker: 192.168.xxx.xxx:1883
      topic: pvdataevcc/sensor/inverter_input_power_with_efficiency_loss
      user: xxx
      password: xxx
      scale: 1
      timeout: 30s
    energy:
      source: mqtt
      broker: 192.168.xxx.xxx:1883
      topic: pvdataevcc/sensor/power_meter_consumption_1
      user: xxx
      password: xxx
      scale: 1
      timeout: 30s
  - name: battery
    type: custom
    power:
      source: mqtt
      broker: 192.168.xxx.xxx:1883
      topic: pvdataevcc/sensor/battery_charge_discharge_power_1
      user: xxx
      password: xxx
      timeout: 30s
      scale: -1
    soc:
      source: mqtt
      broker: 192.168.xxx.xxx:1883
      topic: pvdataevcc/sensor/battery_state_of_capacity_1
      user: xxx
      password: xxx
      timeout: 30s

# charger definitions
# name can be freely chosen and is used as reference when assigning charger to vehicle
# for documentation see https://docs.evcc.io/docs/devices/chargers
chargers:
  - name: go-eCharger Gemini
    type: template
    template: go-e-v3
    host: 192.168.xxx.xxx # IP-Adresse oder Hostname

# vehicle definitions
# name can be freely chosen and is used as reference when assigning vehicle to loadpoint
# for documentation see https://docs.evcc.io/docs/devices/vehicles
vehicles:
  - name: Tesla Model Y
    type: template
    template: tesla
    title: xxx
    accessToken: 
    refreshToken: 
    vin: LRWXXXXXXXXXXXXX # Erforderlich, wenn mehrere Fahrzeuge des Herstellers vorhanden sind # Optional
    capacity: 75 # Akkukapazität in kWh # Optional

# site describes the EVU connection, PV and home battery
site:
  title: Home
  meters:
    grid: grid
    pvs:
      - pv
    batteries:
      - battery
  bufferSoC: 90 # ignore home battery discharge above soc (empty to disable)
  prioritySoC: 80 # give home battery priority up to this soc (empty to disable)
  residualPower: 100 # additional household usage margin
  #    aux:
  #     - aux # list of auxiliary meters for adjusting grid operating point
  maxGridSupplyWhileBatteryCharging: # ignore battery charging if AC consumption is above this value
  smartCostLimit: # set cost limit for automatic charging in PV mode

# loadpoint describes the charger, charge meter and connected vehicle
loadpoints:
  - title: Carport
    charger: go-eCharger Gemini
    mode: pv
    vehicles:
      - Tesla Model Y
    phases: 0
    mincurrent: 6
    maxcurrent: 16
    resetOnDisconnect: false
    soc:
      estimate: true
    enable: # pv mode enable behavior
      delay: 1m # threshold must be exceeded for this long
      threshold: 0 # grid power threshold (in Watts, negative=export). If zero, export must exceed minimum charge power to enable
    disable: # pv mode disable behavior
      delay: 3m # threshold must be exceeded for this long
      threshold: 0 # maximum import power (W)
    guardDuration: 5m # switch charger contactor not more often than this (default 5m)

# tariffs are the fixed or variable tariffs
tariffs:
  currency: EUR # three letter ISO-4217 currency code (default EUR)
  grid:
    # either static grid price (or price zones)
    type: fixed
    price: 0.2529 # EUR/kWh
  #    zones:
  #      - days: Mo-Fr
  #        hours: 2-5
  #        price: 0.2 # EUR/kWh
  #      - days: Sa,So
  #        price: 0.15 # EUR/kWh

  # # or variable via tibber
  # type: tibber
  # token: "476c477d8a039529478ebd690d35ddd80e3308ffc49b59c65b142321aee963a4" # access token
  # homeid: "cc83e83e-8cbf-4595-9bf7-c3cf192f7d9c" # optional if multiple homes associated to account

  # # or variable via awattar
  # type: awattar
  # region: de # optional, choose at for Austria
  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.0762 # EUR/kWh
  planner:
    # planner tariff can be used for target charging if not grid tariff is specified
    # GrünStromIndex (Germany only) or ElectricityMaps provide CO2 intensity forecast

    # type: grünstromindex
    # zip: <zip>

    # type: electricitymaps
    # uri: <uri>
    # token: <token>
    # zone: DE

# mqtt message broker
#mqtt:
#  broker: 192.168.xxx.xxx:1883
#  topic: xxx # root topic for publishing, set empty to disable
#  user: xxx
#  password: xxx

# influx database
influx:
  # url: http://localhost:8086
  # database: evcc
  # user:
  # password:

# eebus credentials
eebus:
  # uri: # :4712
  # interfaces: # limit eebus to specific network interfaces
  # - en0
  # certificate: # local signed certificate, required, can be generated via `evcc eebus-cert`
  #   public: # public key
  #   private: # private key

# push messages
messaging:
  events:
    start: # charge start event
      title: Charge started
      msg: Started charging in "${mode}" mode
    stop: # charge stop event
      title: Charge finished
      msg: Finished charging ${chargedEnergy:%.1fk}kWh in ${chargeDuration}.
    connect: # vehicle connect event
      title: Car connected
      msg: "Car connected at ${pvPower:%.1fk}kW PV"
    disconnect: # vehicle connected event
      title: Car disconnected
      msg: Car disconnected after ${connectedDuration}
    soc: # vehicle soc update event
      title: Soc updated
      msg: Battery charged to ${vehicleSoc:%.0f}%
    guest: # vehicle could not be identified
      title: Unknown vehicle
      msg: Unknown vehicle, guest connected?
  services:
    # - type: pushover
    #   app: # app id
    #   recipients:
    #   - # list of recipient ids
    #- type: telegram
    #  token: XXXXXXXXXXXXXXXX # bot id
    #  chats:
    #    - XXXXXXXXXXXX # list of chat ids
  #- type: email
  #  uri: smtp://<user>:<password>@<host>:<port>/?fromAddress=<from>&toAddresses=<to>
  # - type: ntfy
  #   uri: https://<host>/<topics>
  #   priority: <priority>
  #   tags: <tags>

Hoffe das hilft !

4 Likes