elden1337 / hass-peaqnext

Utility sensors to help find the next best usage of your appliances
Other
7 stars 0 forks source link

State not correct? #2

Closed groen-sb closed 1 year ago

groen-sb commented 1 year ago

Good afternoon,

Thanks for this integration! :) In my home assistant installation the state of the sensor is the current price. While the readme states that the sensor state should be the cheapest option in the next 12 hours.

Any idea what I'm doing wrong?

elden1337 commented 1 year ago

Hi! What setup did u do? If you dont remember just open the sensor and expand the attributes.

I am afk now but will take a look as soon as possible

groen-sb commented 1 year ago

Sure, no hurry! Here is a screenshot:

Screenshot from 2023-07-28 19-54-38

Settings are:

elden1337 commented 1 year ago

Ok cool. And I guess you'r on either BE or NL (prices are virtually equal on both today and tomorrow)? I'll have to write a test case for this, would assume something with the smaller euro-prices that i'm calculating badly.

elden1337 commented 1 year ago

It also looks extremely expensive, will also make sure i didnt miss any currency issue

groen-sb commented 1 year ago

Yes, NL prices. Maybe it is something with using comma or point for decimals? The prices display as 0.5 instead of 0,5 which is normal here.

I think the prices are calculated correctly. The price at this moment is about 20 cents per kWh. I made another test sensor that uses 2 kWh in 2 hours and its price is approximately 40 cents. Last night the sensor state was a moment in the future for quite some time. However, there still was a cheaper sequence a few hours later: Screenshot from 2023-07-29 13-09-40

tux2000 commented 1 year ago

I think I got a similar problem here (SE3):

image image

There are some options to get negative prices tomorrow, but the status is to start it now.

I just installed the extension today (v.0.1.1)

elden1337 commented 1 year ago

I can see the issue. Will try to get time tonight (i think use_cents in nordpool is half the issue). Sorting is off.

tux2000 commented 1 year ago

Great that you identified the problem and thank for the amazing (in theory at least) extension!

groen-sb commented 1 year ago

I saw you made some updates. In HACS there was no update available so I selected the 'main' version in HACS. And I think it works now! At this moment the best price is also the current hour. But it sorts all values correctly in the attributes.

groen-sb commented 1 year ago

Oops, state is still 14:00-16:39 (0.04 EUR) (cheapest option today) but it is already 17:00..

elden1337 commented 1 year ago

I havent released a new version yet. Gonna test on my own instance first.

elden1337 commented 1 year ago

works on my machine and in my tests now at least, so released a new version 0.1.2. Please re-open issue if not working.

tux2000 commented 1 year ago

Yes, 0.1.2 seems to fix this. But I get the impression that "blocked" hours are not honored. Will test a bit more and open a new issue if confirmed.

elden1337 commented 1 year ago

Thanks. Please do. At my instance the blocked are blocked.