Deye Solar Inverter Zero Feed-In (Nulleinspeisung)

Hi everyone,

For those guys who are looking for a working solution to give the Deye Microinverter e.g. 600W or 800W a zero feed-in, I would like to share my template & automation here:

  1. What do you need?
  • Deye Microinverter
  • Solarman integration in Home Assistant
  • Energymeter e.g. Shelly pm between Inverter & Grid
  • Shelly Integration in Home Assistant
  • Energymeter on your Grid e.g. Esp32 with Tasmota and IR Read Dongle to get the Current consumption in Watt from the Grid in realtime.
  1. Make a custom template “Nulleinspeisung” (zero feed-in) under devices & services → helper:
{# set your max Power of your Inverter in Watt: #}
{% set maxInverterPower = 800 %}
{# set your max Inverter Regulation e.g. 100 or max 120 in percent: #}
{% set maxInverterRegulation = 100 %}
{# If your Inverter is making an offset, you can change it here in Watt: #}
{% set inverterPowerOffset = 0 %}
{# Set here your min amount of your base load in your house in Watt: #}
{% set minSolarLimit = 100 %}
{# Here can you change the Zero Point goal e.g. -5, o or +10 in Watt: #}
{% set zeroPointGridAdj = -5 %}

{% set newSolarLimit = 0 %}
{% set newRegulationLimit = 0 %}

{# Put in your current Grid sensor in Watt: #}
{% set curGridUsage = states('sensor.tasmota_stromzahler_strom_power_curr') | float * -1 | replace('W','') | int %}
{#Put in your current Solarpower sensor in Watt e.g. a shelly 2pm (the inverter sensor is too lazy): #}
{% set curSolarProd = states('sensor.solaranlage_solar_leistung_power') | float (0) | replace('W','') | int %}

{% set newSolarLimit = (curSolarProd - (curGridUsage + zeroPointGridAdj)) %}

{% if newSolarLimit <= minSolarLimit %}
  {% set newSolarLimit = minSolarLimit %}
    {% elif newSolarLimit >= maxInverterPower %}
       {% set newSolarLimit = maxInverterPower %}
{% endif %}

{% set newRegulationLimit = ((newSolarLimit * maxInverterRegulation) / (maxInverterPower - inverterPowerOffset)) %}

{{ newRegulationLimit | round (0) }}
  1. Make an automation “Nulleinspeisung” (zero feed-in) under config → automations & scenes:
alias: Solar Nulleinspeisung
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.solaranlage_solar_leistung_power
    to: null
    from: null
    enabled: true
condition:
  - condition: state
    entity_id: sensor.solarman_on_off_enable
    state: "ON"
action:
  - service: solarman.write_multiple_holding_registers
    metadata: {}
    data:
      register: 40
      values: "{{ states('sensor.kalkulation_nulleinspeisung') | replace('%','') }}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
mode: single
  1. Enjoy to see the Gauge Display between -5 & 5 Watts :grin::+1:

With kind regards

Mathias Harmening

1 Like

Hallo Mathias,
das klingt interessant.

Helper konnte ich anlegen.
Aber wie lege ich die Szene an?
Wo muss ich deinen Code reinkopieren?

Du musst den Code direct in die automations.yaml eintragen.

Den Sensor musst du auch mit kalkulation_nulleinspeisung anlegen, sonst gibts auch nen Fehler.

Ich habe es fĂĽr mich umgeschrieben, und es funktioniert.