Fronius WR mit BYD HVS. Alle Werte auslesen

Moin,

falls jemand ich den SOH auslesen möchte, was ac hoc leide mit der Fronius Integration nicht funktioniert. So habe ich das ganze gelöst.

So überprüft Ihr erstmal ob die Werte überhaupt geliefert werden. http://IP-Adresse eures WR/components/readable

Das dann in die configurations.yaml:

# FRONIUS / BYD – REST SENSOR (ALLE WERTE)

###############################################
sensor:

* platform: rest
  name: BYD Battery Raw
  resource: „[http://IP-Adresse eures WR/components/readable](http://IP-Adresse%20eures%20WR/components/readable)“
  scan_interval: 60
  value_template: „OK“
  json_attributes_path: „$.Body.Data.\*.channels“
  json_attributes:

  * BAT_VALUE_STATE_OF_HEALTH_RELATIVE_U16

  * BAT_VALUE_STATE_OF_CHARGE_RELATIVE_F32

  * BAT_ENERGYACTIVE_ESTIMATION_MAX_CAPACITY_F64

  * BAT_ENERGYACTIVE_LIFETIME_CHARGED_F64

  * BAT_ENERGYACTIVE_LIFETIME_DISCHARGED_F64

  * BAT_ENERGYACTIVE_MAX_CAPACITY_F64

  * BAT_CURRENT_DC_F64

  * BAT_CURRENT_DC_INTERNAL_F64

  * BAT_VOLTAGE_DC_INTERNAL_F64

  * BAT_TEMPERATURE_CELL_F64

  * BAT_TEMPERATURE_CELL_MAX_F64

  * BAT_TEMPERATURE_CELL_MIN_F64

  * BAT_MODE_CELL_STATE_U16

  * BAT_MODE_HYBRID_OPERATING_STATE_U16

  * BAT_MODE_STATUS_BATTERY_U32

  * BAT_MODE_STATUS_BMS_U32

  * DCLINK_POWERACTIVE_LIMIT_DISCHARGE_F64

  * DCLINK_POWERACTIVE_MAX_F32

  * DCLINK_VOLTAGE_MEAN_F32

  * DEVICE_TEMPERATURE_AMBIENTEMEAN_F32

Das dann unter:

template:

* sensor:
  ######################################################
  # BYD – NEUES FORMAT
  ######################################################

  - name: "BYD SOH"
    unique_id: byd_soh
    unit_of_measurement: "%"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_VALUE_STATE_OF_HEALTH_RELATIVE_U16') }}"

  - name: "BYD SOC"
    unique_id: byd_soc
    unit_of_measurement: "%"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_VALUE_STATE_OF_CHARGE_RELATIVE_F32') | float | round(1) }}"

  - name: "BYD Kapazität Nenn"
    unique_id: byd_kapazitaet_nenn
    unit_of_measurement: "kWh"
    state: "{{ (state_attr('sensor.byd_battery_raw', 'BAT_ENERGYACTIVE_MAX_CAPACITY_F64') | float / 1000000) | round(2) }}"

  - name: "BYD Kapazität Geschätzt"
    unique_id: byd_kapazitaet_geschaetzt
    unit_of_measurement: "kWh"
    state: "{{ (state_attr('sensor.byd_battery_raw', 'BAT_ENERGYACTIVE_ESTIMATION_MAX_CAPACITY_F64') | float / 1000000) | round(2) }}"

  - name: "BYD Lifetime Charged"
    unique_id: byd_lifetime_charged
    unit_of_measurement: "kWh"
    state: "{{ (state_attr('sensor.byd_battery_raw', 'BAT_ENERGYACTIVE_LIFETIME_CHARGED_F64') | float / 1000000) | round(1) }}"

  - name: "BYD Lifetime Discharged"
    unique_id: byd_lifetime_discharged
    unit_of_measurement: "kWh"
    state: "{{ (state_attr('sensor.byd_battery_raw', 'BAT_ENERGYACTIVE_LIFETIME_DISCHARGED_F64') | float / 1000000) | round(1) }}"

  - name: "BYD Zelltemperatur"
    unique_id: byd_zelltemperatur
    unit_of_measurement: "°C"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_TEMPERATURE_CELL_F64') }}"

  - name: "BYD Zelltemperatur Max"
    unique_id: byd_zelltemperatur_max
    unit_of_measurement: "°C"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_TEMPERATURE_CELL_MAX_F64') }}"

  - name: "BYD Zelltemperatur Min"
    unique_id: byd_zelltemperatur_min
    unit_of_measurement: "°C"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_TEMPERATURE_CELL_MIN_F64') }}"

  - name: "BYD Umgebungstemperatur"
    unique_id: byd_ambient_temp
    unit_of_measurement: "°C"
    state: "{{ state_attr('sensor.byd_battery_raw', 'DEVICE_TEMPERATURE_AMBIENTMEAN_F32') }}"

  - name: "BYD Strom DC"
    unique_id: byd_strom_dc
    unit_of_measurement: "A"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_CURRENT_DC_F64') | float | round(2) }}"

  - name: "BYD Strom DC Intern"
    unique_id: byd_strom_dc_intern
    unit_of_measurement: "A"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_CURRENT_DC_INTERNAL_F64') | float | round(2) }}"

  - name: "BYD Spannung DC"
    unique_id: byd_spannung_dc
    unit_of_measurement: "V"
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_VOLTAGE_DC_INTERNAL_F64') | float | round(1) }}"

  - name: "BYD DC-Link Voltage"
    unique_id: byd_dc_link_voltage
    unit_of_measurement: "V"
    state: "{{ state_attr('sensor.byd_battery_raw', 'DCLINK_VOLTAGE_MEAN_F32') | float | round(1) }}"

  - name: "BYD DC-Link Limit Discharge"
    unique_id: byd_dc_link_limit
    unit_of_measurement: "W"
    state: "{{ state_attr('sensor.byd_battery_raw', 'DCLINK_POWERACTIVE_LIMIT_DISCHARGE_F64') | float | round(0) }}"

  - name: "BYD DC-Link Max Power"
    unique_id: byd_dc_link_max
    unit_of_measurement: "W"
    state: "{{ state_attr('sensor.byd_battery_raw', 'DCLINK_POWERACTIVE_MAX_F32') | float | round(0) }}"

  - name: "BYD Cell State"
    unique_id: byd_cell_state
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_MODE_CELL_STATE_U16') }}"

  - name: "BYD Hybrid Operating State"
    unique_id: byd_hybrid_state
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_MODE_HYBRID_OPERATING_STATE_U16') }}"

  - name: "BYD Battery Status"
    unique_id: byd_battery_status
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_MODE_STATUS_BATTERY_U32') }}"

  - name: "BYD BMS Status"
    unique_id: byd_bms_status
    state: "{{ state_attr('sensor.byd_battery_raw', 'BAT_MODE_STATUS_BMS_U32') }}"

Hier noch ein Vorschlag für eine Lovelace Karte:

title: BYD Batterie

views:

* title: Übersicht

  path: byd

  icon: mdi:battery-heart

  cards:

  * type: entities

    title: Ladezustand & Gesundheit

    entities:

    * entity: sensor.byd_soc

      name: State of Charge (SOC)

    * entity: sensor.byd_soh

      name: State of Health (SOH)

    * entity: sensor.byd_kapazitat_nenn

      name: Nennkapazität (kWh)

    * entity: sensor.byd_kapazitat_geschatzt

      name: Geschätzte Kapazität (kWh)

  * type: entities

    title: Temperaturen

    entities:

    * entity: sensor.byd_zelltemperatur

      name: Zelltemperatur

    * entity: sensor.byd_zelltemperatur_max

      name: Zelltemperatur Max

    * entity: sensor.byd_zelltemperatur_min

      name: Zelltemperatur Min

    * entity: sensor.byd_device_temperature_ambient

      name: Umgebungstemperatur

  * type: entities

    title: DC-Werte

    entities:

    * entity: sensor.byd_strom_dc

      name: Strom DC

    * entity: sensor.byd_strom_dc_intern

      name: Strom DC Intern

    * entity: sensor.byd_spannung_dc

      name: Spannung DC

    * entity: sensor.byd_dc_link_voltage

      name: DC-Link Spannung

    * entity: sensor.byd_dc_link_limit_discharge

      name: DC-Link Limit Discharge

    * entity: sensor.byd_dc_link_max_power

      name: DC-Link Max Power

  * type: entities

    title: Betriebszustände

    entities:

    * entity: sensor.byd_cell_state

      name: Cell State

    * entity: sensor.byd_hybrid_operating_state

      name: Hybrid Operating State

    * entity: sensor.byd_battery_status

      name: Battery Status

    * entity: sensor.byd_bms_status

      name: BMS Status

  * type: entities

    title: Lifetime Energie

    entities:

    * entity: sensor.byd_lifetime_charged

      name: Lifetime Charged (kWh)

    * entity: sensor.byd_lifetime_discharged

      name: Lifetime Discharged (kWh)

Gruß

André

:crayon:by HarryP: Post formatiert