Closed R-ens closed 9 months ago
I don't have a energy contract so will not get these values.
Can you post the debug info maybe we can spot the value and add it as sensor to the integration. https://github.com/fsaris/home-assistant-zonneplan-one#troubleshooting
This is the only diff that I have found, within the price_per_hour
array.
It's all based on datetime, the same as the current prices.
[
{
"electricity_price":3100732,
"gas_price":10894555,
"tariff_group":"normal",
"solar_percentage":0,
"solar_yield":0,
"datetime":"2023-07-04T04:00:00.000000Z",
"sustainability_score":338
},
{
"electricity_price":2649281,
"gas_price":10770199,
"tariff_group":"low",
"solar_percentage":0,
"solar_yield":0,
"datetime":"2023-07-05T04:00:00.000000Z",
"sustainability_score":216
}
]
@renslinden could you test current main (beta) version, I added a additional sensor for this? But I'm not able to test this fully as I don't have a energy contract
Looks good so far, unfortunately there is no price change over the weekend so it shows me the current price.
It might be better to show None or Unknown instead.
It's the next known value.
Can you add the debug output here? Or check it for the gas_price
value? I expect that tomorrow is filled with this value even if it doesn't change regarding to today.
Yes i know, I've checked your change. You revert the list and pick the first item as the next day price, right?
Currently there is only one price available from the ZP api:
{'electricity_price': 2767377, 'gas_price': 12002777, 'tariff_group': 'low', 'solar_percentage': 0, 'solar_yield': 0, 'datetime': '2023-11-18T05:00:00.000000Z', 'sustainability_score': 176}
are you sure the price isn't updated during the weekend? Maybe it's only know every day after 18:30 like you mentioned in your first message.
As far as I know during the weekend the gas market is closed so the current price is valid till Monday 6.00 AM.
Anyways, does it impact the implementation? I don't think so.
Is there anything I can test/debug/clarify for you?
So let me elaborate a bit more. This is what I see at this moment in the Zonneplan app.
Around the clock of 6/7 PM the tomorrow's price will become available and is shown underneath 'Gasprijs vandaag'. Unfortunately I currently do not have a screenshot of that.
Technical wise the API gives two gas prices.
In the morning the tomorrow's price disappear from the app. As the next price is not known anymore. At this moment I do expect a sensor with status None or Unknown.
Technical wise the API gives only one gas price.
@renslinden updated the code to only show a next
gas price when there is a next price known (there a 2 prices in the list)
Getting an error with latest version:
Deze fout is ontstaan door een aangepaste integratie.
Logger: custom_components.zonneplan_one.coordinator
Source: helpers/update_coordinator.py:290
Integration: Zonneplan ONE (documentation, issues)
First occurred: 16:38:14 (4 occurrences)
Last logged: 16:40:32
Unexpected error fetching zonneplan_one data: name 'false' is not defined
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/zonneplan_one/coordinator.py", line 63, in _async_update_data
return await self._fetch_data()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/zonneplan_one/coordinator.py", line 120, in _fetch_data
result[uuid]["summary_data"]["gas_price_next"] = getNextGasPriceFromSummary(summary)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/zonneplan_one/coordinator.py", line 32, in getNextGasPriceFromSummary
first_price_found = false
^^^^^
NameError: name 'false' is not defined
@renslinden wrong value is fixed
It looks good so far!
This was the situation before 6 PM:
And this after 6 PM:
The situation this morning (8.30 AM):
So what I notice is that the state didn't reset to Onbekend / Unknown. That's what I initially did expect, but we can ask ourselves if that should be the desired option.
What do you think?
Can you check the data you receive from the api? It should go back to unknown if there aren't 2 prices in the data
Ah, there was still some use of known value in place
I'll let you know if it works as expected. Thanks!
Can confirm that it works as expected, good job!
Ready to release
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):