Zonneplan ONE custom component

Yep, already checked. That is not the case.
I will try to delete and reinstall tomorrow.

Delete and reinstalled. It still won’t add the Zonneplan Connect device. I have no clue why that is.

Do you see the electricity and gas usage in the Zonneplan app?

If yes, can you send me the debug output of the integration in HA GitHub - fsaris/home-assistant-zonneplan-one: Unofficial Zonneplan ONE + connect integration for Home Assistant

Hi,

@minifranske: I do not have an energy contract through Zonneplan, gas and electricity is provided by Vattenvall. The only thing I see in the app is de power generated by the Solar Panels. There is nothing else to see in the app. I do however have a P1 dongle, connected to the Solar Inverter, but it does not seem to register at all. Also at my previous address the P1 dongle was connected to the electricity meter instead of the Solar Inverter, not sure if that should matter.

It’s al very strange.

Yes, it’s meant to be in the p1

Yes, it’s meant to be in the p1

Not sure what you mean by that.

Ok, I just spent some time with the Zonneplan Helpdesk. It appears they only provide you with a P1 Connect Dongle if you have a Zonneplan Energy Contract. It might be worthwhile to make that clear to Home Assistant users before they want to install this integration. The dongle connected to the Solar Inverter is nothing more than a 4G module. Therefore I need to purchase a third party P1 dongle to retrieve the data I want and I am not sure that they will register the energy returned to grid. Unfortunately this means that at this point I have no use for this integration. Thanks for the support.

Hi, I try to get the lowest_pice_today with this code but it doesn’t seem to work. Is there a better code/another way to get the lowest_pice_today for Zonneplan?

sensor:
  - platform: template
    sensors:
      lowest_electricity_price:
        friendly_name: "Lowest Electricity Price"
        value_template: "{{ state_attr('sensor.zonneplan_current_electricity_tariff', 'electricity_price') | min }}"
        unit_of_measurement: "EUR"

Hi, did you manage to find a solution for this?

Did anyone find a way to see individual panels connected to the zonneplan inverter/omvormer?

I see a strange flattened curve last days and would lil my own ability to check panels.

Mine is only connected to zonneplan via a 4g dongel.

With the Zonneplan integration you will only see the production of all panels.

The inverter has 2 groups and with a modbus connection you are able to get the current power of each group (GitHub - wimb0/home-assistant-saj-modbus: Home Assistant Component for reading data locally from SAJ (and Zonneplan) Inverters through modbus TCP.).

But you could als just call Zonneplan and ask them. They probably also have this data.

Hi @Botap, I am working on this solution but the results are different from the manual calculation. Did’t find the time to figger out why.

  - platform: template
    sensors:
      laagste_prijs_zonneplan_test5:
        friendly_name: "Laagste prijs Zonneplan Test5"
  #      value_template: "{{ (states('sensor.enstso_e_lowest_energy_price_today') | float + (states('sensor.zonneplan_current_electricity_tariff') | float - states('sensor.enstso_e_current_electricity_market_price') | float)) | round(8) }}"
        value_template: "{{ (states('sensor.enstso_e_lowest_energy_price_today') | float + (states('sensor.zonneplan_current_electricity_tariff') | float - states('sensor.enstso_e_current_electricity_market_price') | float)) }}"
        unit_of_measurement: "€/kWh"
        icon_template: mdi:currency-eur

for example, tomorrows Zonneplan lowest price will be 0.2856796 and the calculated lowest price is 0,2856816 €/kWh.

Hi all,
I have the Zonneplan Energy contract, the P1 dongle and the app with P1-data and hourly prices.
But I don’t have Zonneplan solar pane;s and inverter. In that context, is this integration still usefull for me to get the hourly prices and current consumption/production?
Just out of curiosity: Is the integration getting the information from the Zonneplan website, or directly from the dongle?

Thanks!

Yes, and through the API (or: backend of the app. So in your choices: the website).

I also don’t have the Zonneplan inverter, works all fine. Data is retrieved from the “slimme meter” in your “meterkast” by the dongle, sent to the servers of Zonneplan, and from there retrieved by the app and the component.

1 Like

I’ve altered a previously shared graph which now looks more like how it’s shown in the Zonneplan iOS app.

image

type: custom:plotly-graph
title: Dynamische stroomprijs
hours_to_show: 18
time_offset: 12h
fn: |
  $fn ({ hass, vars }) => {
    vars.x = []; vars.y = []; vars.color = []; vars.hover = []
    vars.min = {p: 999,t: null}; vars.max = {p:-999,t:null}
    vars.ymin = 999; vars.ymax = -999
    vars.unit_of_measurement = hass.states['sensor.zonneplan_current_electricity_tariff'].attributes.unit_of_measurement
    vars.now = {t: Date.now(), p: parseFloat(hass.states['sensor.zonneplan_current_electricity_tariff'].state)} 
    vars.now.h = "<b>" + vars.now.p.toFixed(3) + "</b> " + vars.unit_of_measurement + " @now " 
    vars.avg = { p: 0, c: 0 }
    hass.states['sensor.zonneplan_current_electricity_tariff']?.attributes?.forecast?.map(e => {
      var t = new Date(e.datetime).getTime()+1800000 
      var p = e.electricity_price/10000000
      vars.avg.p += p
      vars.avg.c++
      var c = e.tariff_group.replace("low", "#00a964").replace("normal", "#365651").replace("high","#ed5e18")
      if (t>=Date.now()-1800000) {
        if (p<vars.min.p) vars.min = {p,t,c}
        if (p>vars.max.p) vars.max = {p,t,c}
      }
      if (p<vars.ymin) vars.ymin = p
      if (p>vars.ymax) vars.ymax = p
      vars.x.push(t)
      vars.y.push(p)
      vars.color.push(c)
      vars.hover.push(String(new Date(t).getHours()).padStart(2,"0") + "-" + 
        String(new Date((new Date(t).getTime()+3600000)).getHours()).padStart(2,"0") + ": <b>" + 
        p.toFixed(3) + "</b> " + vars.unit_of_measurement)
    })
    vars.min.h = "<b>" + vars.min.p.toFixed(3) + "</b> " + vars.unit_of_measurement + " @ " + new Date(vars.min.t).getHours() + ":00"
    vars.max.h = "<b>" + vars.max.p.toFixed(3) + "</b> " + vars.unit_of_measurement + " @ " +  new Date(vars.max.t).getHours() + ":00"
    vars.avg.p = vars.avg.p / vars.avg.c
    vars.avg.h = "<b>" + vars.avg.p.toFixed(3) + "</b> " + vars.unit_of_measurement + " average"
    // console.log(vars)
  }
layout:
  margin:
    l: 20
    r: 20
    b: 40
  yaxis:
    fixedrange: false
    tickformat: .2f
    range: $fn ({vars}) => [ vars.ymin-0.02, vars.ymax+0.02 ]
    showgrid: false
    visible: false
    showticklabels: true
    showline: false
    title: null
  xaxis:
    tickformat: '%H'
    showgrid: false
    visible: true
    showticklabels: true
    showline: false
    dtick: 3600000
config:
  displayModeBar: false
  scrollZoom: false
entities:
  - entity: ''
    unit_of_measurement: $ex vars.unit_of_measurement
    showlegend: false
    x: $ex vars.x
    'y': $ex vars.y
    marker:
      color: $ex vars.color
    type: bar
    hovertemplate: $ex vars.hover
  - entity: ''
    mode: markers
    textposition: top
    showlegend: true
    name: $ex vars.min.h
    hovertemplate: $ex vars.min.h
    yaxis: y0
    marker:
      symbol: diamond
      color: $ex vars.min.c
      opacity: 0.7
    x:
      - $ex vars.min.t
    'y':
      - $ex vars.min.p
  - entity: ''
    mode: markers
    textposition: top
    showlegend: true
    name: $ex vars.max.h
    hovertemplate: $ex vars.max.h
    yaxis: y0
    marker:
      symbol: diamond
      color: $ex vars.max.c
      opacity: 0.7
    x:
      - $ex vars.max.t
    'y':
      - $ex vars.max.p
  - entity: ''
    name: Now
    hovertemplate: Now
    yaxis: y9
    showlegend: false
    line:
      width: 0.5
      color: gray
      opacity: 1
    x: $ex [vars.now.t, vars.now.t]
    'y':
      - 0
      - 1
7 Likes

Does anyone have the correct code for the lowest price sensor? that tells you between which times the price is lowest.

I received unavailable from my sensor code from ESPhome with display to manually delay electricity consumption for non connected devices


      time_low_coming_short:
        friendly_name: Time lowest price short
        unique_id: time_low_coming_short
        device_class: timestamp
        value_template: >
         {% set dtnow = now().isoformat()[0:26]~"Z" %}
         {% set dtend = (now()+timedelta(hours=6)).isoformat()[0:26]~"Z" %}
         {% set fclist = state_attr('sensor.zonneplan_current_electricity_tariff','forecast')
                         |selectattr('datetime','>=',dtnow)|selectattr('datetime','<=',dtend)|list %}
         {% set plist = fclist|map(attribute='price')|list %}
         {% set ns = namespace(fc2=[]) %}
         {%- for fc in fclist[:-1] -%}
         {%- set ns.fc2 = ns.fc2 + [{'datetime':fc['datetime'],'price':(plist[loop.index0] + plist[loop.index0+1])/2}] -%}
         {%- endfor -%}
         {% set pmin = ns.fc2|map(attribute='price')|list|min %}
         {{ (ns.fc2|selectattr('price','eq',pmin)|first)['datetime'] }}

The name of the attribute ‘price’ has been changed by the Zonneplan component developer to “electricity_price” few months ago. If you change that, it should work.

This works great but if you want to trigger automations based on this its never triggered. The date always shifts forward before the current time matches the cheapest time.

Does anyone know how to resolve this?

Hi @minifranske

Sometimes sensor.zonneplan_p1_electricity_consumption_today_cost shows a very different value when comparing it to the mobile Zonneplan app.

While the app shows 0,76 euros, the sensor’s value is 0.0176131088.


Is Zonneplan delivering the wrong value through its API for this sensor or is there a bug in the integration?