fsaris / home-assistant-zonneplan-one Goto Github PK
View Code? Open in Web Editor NEWUnofficial Zonneplan integration for Home Assistant
Home Page: https://github.com/fsaris/home-assistant-zonneplan-one
License: MIT License
Unofficial Zonneplan integration for Home Assistant
Home Page: https://github.com/fsaris/home-assistant-zonneplan-one
License: MIT License
Just wondering why I do have multiple sensors with the same data. An error or is it designed as intended?
Can someone elaborate? Thanks.
- entity: sensor.zonneplan_current_electricity_tariff
- entity: sensor.zonneplan_current_electricity_tariff_2
- entity: sensor.zonneplan_current_electricity_tariff_3
- entity: sensor.zonneplan_current_gas_tariff
- entity: sensor.zonneplan_current_gas_tariff_2
- entity: sensor.zonneplan_current_gas_tariff_3
Hi Frans,
All still working perfectly, but had a question regarding the P1 tariff values.
At the moment, only normal tariff has a value, however high- and low tariff are always reported zero. Do you by any chance know if these are actually provided/filled in the Zonneplan interface or just there as a placeholder?
Thanks!
I miss the yield yearly value in your Zonneplan One integration. Is it possible to add this value?
The Zonneplan integration is very nice!
Is it possible to display Electricity costs today and Gas costs today in an additional entity?
This has been added to the Zonneplan app since last week.
Hi,
I am assuming that i am not the only one having the issue below that the zonneplan API has become unstable, probably because of their succes. In economic terms this is called the winners curse.
I hope that it is possible to cache the results as now all automations are all over the place because suddenly all kinds of sensors like the current tariff group are unavailable for short periods.
2023-02-04 15:24:38.910 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/summary')
2023-02-04 16:01:31.294 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/gas')
2023-02-04 16:07:44.764 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/user-accounts/me')
2023-02-04 16:28:03.373 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/gas')
2023-02-04 18:38:08.960 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/electricity-delivered')
2023-02-04 18:50:18.628 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/user-accounts/me')
2023-02-04 19:41:04.782 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/electricity-delivered')
2023-02-04 20:40:15.874 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/summary')
2023-02-04 21:04:51.432 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx/gas')
Must you have Solar from Zonneplan (the one unit) to get the prices of the Connect module?
Retrying setup: 403, message='Forbidden', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx/summary')
Logger: homeassistant.config_entries
Source: config_entries.py:1089
First occurred: 20:56:41 (3 occurrences)
Last logged: 20:58:03
Config entry '[email protected]' for zonneplan_one integration not ready yet: 403, message='Forbidden', url=URL('https://app-api.zonneplan.nl/connections/xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx/summary'); Retrying in background
Even tried to recreate the api links, same result.
Thanks in advance
Home Assistant 2022.11.5
Frontend 20221108.0 - latest
Currently the highest_yield_at value is presented as a date. In our case:
2021-04-10 22:00:00+00:00
At first I thought that the highest recorded value was at April 10 around 22:00, but actually April 10 was a very bad day (in terms of solar energy production). Turns out that you should read this value as a date. The timestamp is in UTC time and the CET time (with DST) is +2 hours. In this case it would be 2021-04-11 00:00:00. And that is correct. Up until now April 11 2021 was the best day.
Logger: homeassistant.loader
Source: custom_components/zonneplan_one/coordinator.py:18
Integration: Zonneplan ONE (documentation, issues)
First occurred: 14:21:58 (1 occurrences)
Last logged: 14:21:58
Unexpected exception importing component custom_components.zonneplan_one
Traceback (most recent call last):
File "/home/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 725, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/zonneplan_one/init.py", line 13, in
from .coordinator import ZonneplanUpdateCoordinator
File "/home/homeassistant/.homeassistant/custom_components/zonneplan_one/coordinator.py", line 18, in
def getGasPriceFromSummary(summary) -> int | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Found this error message in my logs after installing the Zonneplan component. After configuring the integration and verifying my email address no Zonneplan entities are added to my home assistant. Tried uninstalling and reinstalling multiple times, same error.
Logger: custom_components.zonneplan_one.coordinator
Source: custom_components/zonneplan_one/coordinator.py:54
Integration: Zonneplan ONE (documentation, issues)
First occurred: 2 oktober 2021 21:56:29 (1 occurrences)
Last logged: 2 oktober 2021 21:56:29
Unexpected error fetching zonneplan_one data: 'dict' object has no attribute 'append'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/zonneplan_one/coordinator.py", line 54, in _async_update_data
result[connection["uuid"]][contract["type"]].append(contract)
AttributeError: 'dict' object has no attribute 'append'
Hi,
I received a message one of my integrations needed updating. The Zonneplan One integration showed a 401 error in the log. After resending/re-validating the email address the integration works fine again.
Why do I get this error? No changes were made to the email address at Zonneplan.
This is what is in the log, running latest versions of HA (on SD) and integrations including HACS.
`Deze fout is ontstaan door een aangepaste integratie.
Logger: custom_components.zonneplan_one.coordinator
Source: helpers/update_coordinator.py:151
Integration: Zonneplan ONE (documentation, issues)
First occurred: 11:40:04 (1 occurrences)
Last logged: 11:40:04
Authentication failed while fetching zonneplan_one data: 401, message='Unauthorized', url=URL('https://app-api.zonneplan.nl/user-accounts/me') `
After about 13:00 (30-nov-2022) the sensor 'sensor.zonneplan_p1_electricity_consumption_today' is reporting unknown.
No problems past weeks with this sensor. I've restarted HA, but it stays at 'unknown' value.
All other P1 sensors I am using are still reporting their values
Hi,
I have the issue that at some time (after few days) the states of the integration become "unavailable" and won't recover until I restart Home Assistant.
I don't see anything in HA logs, but I also don't have the debug log of this integration enabled. I have used same e-mail address as the Zonneplan app on my phone uses, could that be a problem?
I will enable the debug logging and let you know when it happens again
Hi Frans,
First of; thanks for this awesome Zonneplan integration voor HA!! It works really well and provides me with the right information for my (daily) energy dashboard!
I recently installed the Power Flow Card addon which provides me with my current power consumption, taking account the total amount W/KW produced bij my solar panels at that time. Therefore i use the sensor "Zonneplan last measured value". Because my grid usage/production sensors are updating every second, and the "Zonneplan last measured value" only updates every 5 minutes, my results aren't that accurate. Is there a way to change the update frequency of the "Zonneplan last measured value" sensor?
Kind regards,
Frank
Hi, at the Energy configuration, at Home Assistant, I can configure the the Solar Panel sensors. The problem is that, right now, only the yield_today and yield_total are available as a Long Term sensor.
So, only with this two data, HA is not capable to give me a nice chart and overview of my Energy integration.
Has some documentation from HA explaining how to fix that in the sensor:
https://www.home-assistant.io/more-info/statistics/
https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Here a print screen of the configuration and you can see that the ZonnePlan integration does not show the current power generated.
Screenshot
I put the extra sensor in configuratief.yaml
sensor:
I got this error:
Invalid config for [sensor.integration]: The 'unit' option has been removed, please remove it from your configuration. Got OrderedDict([('platform', 'integration'), ('source', 'sensor.zonneplan_p1_electricity_production'), ('name', 'Zonneplan P1 electricity production kWh'), ('unit', 'kWh'), ('unit_prefix', 'k'), ('round', 2)]). (See ?, line ?).
I've use the manual method to install the zonneplan_one integration. Restarted HomeAssistant and my next step was to configure the zonneplan_one integration. When I select the integration I get the error: Config flow could not be loaded.
The home-assistant.log file contains the following error:
ERROR (MainThread) [homeassistant.config_entries] Error occurred loading configuration flow for integration zonneplan_one: cannot import name 'SensorDeviceClass' from 'homeassistant.components.sensor' (/usr/src/homeassistant/homeassistant/components/sensor/init.py)
Any idea what is going wrong?
I'm running version 2021.9.5
My sensor shows a different value for electricity price vs the zonneplan app. It seems to be one hour too soon (eg it now shows the value for next hour) - anyone else experience the same? It may have to do with the array which has one value less (eg no value for 2am) this would explain why this integration appears 1 hour ahead.
Yep once again zonneplan changed their API that breaks this plugin. This time they changed the current electricity tariff.
In the attributes of the current_electricity_tariff sensor the name of the electricity price is changed from 'price' to 'electricity_price'. My (could be wrong) assumption is that this also breaks the plugin.
Thanks for this integration. I received all data except for the gas price - integration throws below error (don't have solar panels with zonneplan and did not connect the logger so not too worried about the pv and P1 error). Anyone know how to address this?
This error originated from a custom integration.
Logger: custom_components.zonneplan_one.coordinator
Source: custom_components/zonneplan_one/coordinator.py:120
Integration: Zonneplan ONE (documentation, issues)
First occurred: 1 January 2023 at 15:53:37 (885 occurrences)
Last logged: 09:30:40
Could not find pv_installation of pv_installation
Could not find p1_installation of p1_installation
Could not find measurement_groups of gas_data.measurement_groups.0.meta.price
Recently, Zonneplan started providing the past day in the Home Screen chart. It seems the integration uses those prices now as current and forecast prices. This makes using the integration impossible π€πβ¦ Could you please have a look into this?
The new Home Assistant energy dashboard requires entities to have a state_class attribute set to measurement. Without the attribute it's not possible to select the Zonneplan sensors. See: https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Hi Frans,
First of all, thanks for this integration, much appreciated! Are there any plans (or at least possibilities) to also in include the energy consumption in the integration. At the moment the Zonneplan device (in the P1 port of smart meter) is just hanging there doing nothing (although I can see it in the Zonneplan app).
Thanks and have nice weekend,
Stefan
Since a few days, the sensor "sensor.zonneplan_p1_gas_last_measured_consumption" returns no value and stays on unknown. Using the latest version of all components. Cannot exactly recall when it started, so many december updates but it wasn't an HACS/integration update.
Also reinstalled the integration, it is still on unknown. Consumption today and last measured work just fine.
Hi all,
i've upgraded to the latest version a couple of days ago and since that time the "sensor.zonneplan_p1_electricity_production_compensation" state is unknown.
Before, this sensor did work and specified the compensation i recieved by delivering energy back to the supplier.
I really liked this insight.
Is this a bug or did the feature end?
The data in the forecast attributes contains prices that are not in euro (and need to be divided by 10000000 to get a reasonable euro price), while the state price of the sensor is in euros. This is unexpected behavior, it would be great if the prices in the attributes would be in euro's as well.
See screenshot:
Is it possible to pull "laadpaal" data from the zonneplan API ? I have a "laadpaal" from zonneplan. In the app i see usage, on/off, stats.
Hello,
After midnight the current price is dropping to 0 till the new price is available. In my assumption this is wrong because of the Energy dashboard.
Now it's calculating the gas price during those hours with a gas tariff of 0 euro. Which shouldn't of course.
Another side note, the new price is valid from 06.00 AM in the morning, isn't it? Then i expect the current price sensor changed around the clock of 06.00 AM and not already around the clock of 04.00 AM.
Maybe it's an idea to introduce a new sensor for the hours the price is already known but not valid yet. Something like sensor.zonneplan_new_gas_tariff
Since Nov 30, the Zonneplan integration (0.0.10) returns an error when connecting to the Zonneplan API:
ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Error requesting zonneplan_one data: 403, message='Forbidden', url=URL('https://app-api.zonneplan.nl/connections/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/summary')
After upgrading to version 0.0.14 (hoping the connection issue is solved) I get the following error:
ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.zonneplan_one.sensor
Traceback (most recent call last):
File "/srv/hass11/lib/python3.9/site-packages/homeassistant/loader.py", line 722, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/srv/hass11/lib/python3.9/site-packages/homeassistant/loader.py", line 739, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/zonneplan_one/sensor.py", line 108, in <module>
class ZonneplanSensor(CoordinatorEntity, SensorEntity):
File "/home/homeassistant/.homeassistant/custom_components/zonneplan_one/sensor.py", line 203, in ZonneplanSensor
def extra_state_attributes(self) -> dict[str, Any] | None:
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'
2022-12-05 11:05:54.103 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform zonneplan_one.sensor: Platform not found (Exception importing custom_components.zonneplan_one.sensor).
Can you help out here?
Thanx.
Gas en electra prijzen standaard paar cent te hoog. Hoe kan ik dit aanpassen?
Noticed a typo in the sensors where forcast should be forecast.
I tried to build an automation on the current tariff (put plug on below x cents and turn off above x cents).
But there is only current-low-tariff change, normal and high.
Possible to add the current one?π
I know there is a sensor with the current tariff, but I cannot use that in an automation sadly.
Since #7 the energy consumption provided by the P1 sensor can be used in the energy dashboard. However, energy production cannot be selected yet. I think we need the production equivalent of this entry in const.py:
"electricity_total_today": {
"type": "p1_installation",
"key": "electricity.measurement_groups.0.total",
"label": "electricity consumption today",
"unit": ENERGY_KILO_WATT_HOUR,
"device_class": DEVICE_CLASS_ENERGY,
"default_enabled": True,
"state_class": STATE_CLASS_MEASUREMENT,
},
The instantaneous energy production is retrieved in the integration, but as far as I can see, the total production today is not yet. It is unclear for me how the mapping from the REST interface works.
So sometimes the system forgets the prices, when it updates new hourly data for gas and elec it doesnt register a updated price.
Is there something possible between refreshing when it fails it can keep the old/current price in stead of forgetting the price for like 5 minutes becuase of the update.
hopefully you know what i mean.
Sjoerd
Hi!
Is there a way to get the cheapest tariff and get the corresponding hour with it? Just like shown in the Zonneplan app?
Would like to expose those values to Google Assistant so I could make a routine where I ask when the cheapest hour is and what the tariff is.
I've had a notification from Home Assistant a few times now, stating that an integration needed a renewal of the configuration. The integration mentioned is this Zonneplan integration. Up to this week I was able to re-authenticate the integration by entering my email address again and everything was fine again. However, from this week I get the following message in the logs:
Traceback (most recent call last):
File "/config/custom_components/zonneplan_one/config_flow.py", line 87, in async_step_auth
self._token = await self.flow_impl.async_request_temp_pass(self._email)
File "/config/custom_components/zonneplan_one/api.py", line 87, in async_request_temp_pass
return await self._api.async_request_temp_pass(email)
File "/config/custom_components/zonneplan_one/zonneplan_api/api.py", line 39, in async_request_temp_pass
response.raise_for_status()
File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 422, message='Unprocessable Content', url=URL('https://app-api.zonneplan.nl/auth/request')
I'm not able to authenticate the Zonneplan integration anymore. The issue might be related to this issue in some way.
It looks like something changed on the Zonneplan end maybe. When the solar production is higher than the grid consumption, the consumption sensor goes to unknown.
Which is fine when using the graph from the screenshots but impossible to use in other cards like mini graph card. Entity card also showing NaN at those moments.
Since the last Zonneplan App update they are publishing the new gas price already the day before around 18.30 PM.
It would be nice if we have this price as a new sensor within this integration.
Release notes Jun 29, 2023 (https://play.google.com/store/apps/details?id=com.zonneplanapp):
Met deze update publiceren we de gasprijs van de volgende dag veel sneller. Ongeveer rond 18:30 uur verschijnt de prijs in het dashboard. Zo kun je als klant je gasverbruik eerder sturen naar een ander moment. Daarnaast is de app op enkele punten verbeterd.
Hi, since today at around 11.30, electricity price is not working anymore.
I think they made an API change (Zonneplan App needs a restart too).
For Home Assistant forcast graph, I must change price to electricity_price.
data_generator: | return entity.attributes.forecast.map((entry) => { return [new Date(entry.datetime), entry.electricity_price/10000000]; });
But state of sensor.zonneplan_current_electricity_tariff is unknown.
Maybe you can take a look?
The logo's ( https://github.com/home-assistant/brands/tree/master/custom_integrations/zonneplan_one ) used for the repository are old. Zonneplan has new logo's.
icon.png
[email protected]
logo.png
[email protected]
How can i delete a not used Usage device?
Hi,
Thank you very much for creating this integration.
Would it be possible to get the prices for today (24 hrs) and tomorrow (24 hrs) instead of only the next 8 hours. I can see this data is available in the app.
I currently get this data from the Nordpool integration: https://github.com/custom-components/nordpool but these prices differ a little bit from the Zonneplan prices somehow (I add the Zonneplan additional costs to the kWh price).
This is what I am trying to achieve:
This are the Nordpool attributes:
nordpool sensor.txt
It appears the charge_point data is no longer available since yesterday (april 10th)
I tried restarting HA and reinstalling the plugin (0.0.17), but to no effect.
In Home Assistant all Charge point sensors have the state Unavailable
The other Zonneplan devices and sensors ( Usage, PV installatie and Connect energiemeter) work as intented.
I enabled debug logging and the following message appears while loading:
2023-04-11 19:47:15.397 INFO (MainThread) [custom_components.zonneplan_one.coordinator] Could not find charge_point of charge_point
I attached the captured (and redacted) log entries.
I get the following warning in the logs of Home Assistant:
Logger: custom_components.zonneplan_one.coordinator
Source: custom_components/zonneplan_one/coordinator.py:116
Integration: Zonneplan ONE
First occurred: 11:27:13 (1 occurrences)
Last logged: 11:27:13
Could not find p1_installation of p1_installation
What can I do to resolve this?
Hi,
The sensor.zonneplan_current_gas_tariff sensor has a gap in its data every day (about the first 4 hours of the day). Is there an explanation for this behavior? I think I would at least like to maintain the last gas price in this scenario, because the sensor is currently unusable for energy dashboard pricingβ¦
Hi,
Is it possible to get the meter readings from the P1 device? I would like to read them as well so I can upload them automatically to mindergas.nl with HA.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.