aWATTar binding: Beta and discussion

Hi,
For what ist the new thing “Best next prices” exatly.

The idea is to have a thing that delivers the best prices from current time until a certain end time, such as “I need my car to be loaded/my dishwasher to be finished/the room heated/… until today evening 6pm, what is the best 2/3/4 hours timespan from now until then”. This works out best when you can define the endtime and duration dynamically over the GUI and then activate it which fixes the computed hours. Development on this is not yet started.

1 Like

Hi,
I am testing the Binding for a whille. I created several best price things, and with one of them I have problems. I tryed to find the 2 most expensive hours, so I defined the thing like this:

UID: awattar:bestprice:aWattar_Bridge:WP_Off
label: Wärmepumpe Abschalten
thingTypeUID: awattar:bestprice
configuration:
  length: 22
  rangeDuration: 24
  rangeStart: 0
  consecutive: false
bridgeUID: awattar:awattar-bridge:aWattar_Bridge

The result is like this:

This is the screenshot from yesterday. The 1 most expensive hour was be found, but the second one is not the next expensive hour. This looks strange for me.

All other things i created (most 8 expensive, 8 cheapest, 2 cheapest) looks good.

Dear @Quautiputzli , thanks for testing! Looks like you found a bug :slight_smile: !

I will try to dig into this at the next weekend.

Dear @Quautiputzli, I created the same thing now on my test instance and added one item for the hours and one for the switch. For today it seems to work correctly, choosing all hours except 20 and 22. Do you see the problem today also? Do you have an item for the hours channel? Does it show the same problem or are the hours correct there?

You may check also the event log of 11th of may, it should show all status changes.

I will keep an eye on it and come back to you as soon as I found something.

Hi Wolfgang,
and thanks for the effort. The last 2 day it worked the way it should. But in my case the most expensive hours are 19 and 20, both days. I had problems on another side, so i flashed the openhab image new. I am now back at 3.0.2. But I also have the old image on another SD-card, so I can try to get this log from 11th of may.

And yes, I have an item for the hours channel. It showed the same hours like the switch channel did. I also did a test some days before (with the old image), I changed it from 22 to 21 hours, an then it was right.

Bye

Hi,
yesterday the problem was back. And something additional happend. Have a look at the screenshot, and the log.


2021-05-17 00:00:00.030 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WP_Abschalten_Hours' changed from 00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,21,22,23 to 00,01,02,03,04,05,06,07,09,11,12,13,14,15,16,17,18,19,20,21,22,23

2021-05-17 08:00:00.012 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WP_Abschalten_Active' changed from ON to OFF

2021-05-17 09:00:00.012 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WP_Abschalten_Active' changed from OFF to ON

2021-05-17 10:00:00.020 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WP_Abschalten_Active' changed from ON to OFF

2021-05-17 11:00:00.009 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WP_Abschalten_Active' changed from OFF to ON

2021-05-17 14:01:00.022 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'WP_Abschalten_Hours' changed from 00,01,02,03,04,05,06,07,09,11,12,13,14,15,16,17,18,19,20,21,22,23 to 00,01,02,03,04,05,06,07,09,10,11,12,13,14,15,16,17,18,19,20,21,23

At first, the hours 8 and 10 were selected ( but 7 and 8 should it be). This we can also see in the log. The Active Switch switches these hours 8 and 10. And then a strange thing happend. At 14 o’clock when the dates fron the next days are comming, the “WP_Abschalten_Hours” get an update and then the hours 8 an 22 are choosen.

I think, the easiest way would be to set it to Consecutive.
Or, I delete these one thing, and create it new. I will see.

Dear @Quautiputzli , I was able to reproduce the problem and also found the root cause in the code. I think I can provide a fix within the several next days.

Recreating the thing will not work. The problem will occur on days when one certain price appears twice.

Hi,
good to hear.
Thanks

Problem is fixed. Please download the updated version at

Yours

Wolfgang

1 Like

Thanks
How can I update? Just put the new file into the folder, deinstall the binding and install again?

I run with version 3.0.2 at the moment. Is this working with this? Becaus on your link its called …3.1.0…

Bye

To install it, just replace the jar file in the addons folder. Although not really required, it may be a good idea to stop openHAB before replacing the jar and start it again afterwards.

I tested it under 3.0.1, so it should run under 3.0.2 also. It’s just named 3.1.0-SNAPSHOT because this is the source branch I started working on.

1 Like

Hi
I tested the updated version a few days now. I can say It looks good so far.
Thanks a lot.
Bye

Hi Wolfgang,
the binding was working fine for me. I had the rangeStart on “0” and the rangeDuration on “24” and it worked very well.
No I tested something different. I set the rangeStart on “16” and the rangeDuration on “24”. And now, every day between 14 an 16 o’clock i get an “UNDEF” on the active-channel. Is this because the data from the day before is gone? Why gets the channel updated although the time Range starts on 16 o’clock?

Is the only chance for me, to set the rangeStart on “14”?

Thnaks and Bye

Dear @Quautiputzli , I will check this and come back to you.

Dear @Quautiputzli , problem found and corrected. Find the updated jar file on my server (linked above).

Thanks for testing!

Yours

Wolfgang

Thanks for the fast support. I will test it.

Bye

Hi,
looks good. It’s working now. :+1:

After adding internationalization to the binding I finally opened a Pull request:

3 Likes

Hi Wolfgang, thanks a lot for your great binding :slight_smile:
For the Best price I run into a small issue. It looks like for Duration 13 and less there is an issue with the working Start time…

Range Start:0 __ Duration: 24 __ Lenght: 18 __ OK
Range Start:0 __ Duration: 12 __ Lenght: 9 ___ UNDEF
Range Start:1 __ Duration: 12 __ Lenght: 9 ___ OK
Range Start:0 __ Duration: 14 __ Lenght: 9 ___ OK
Range Start:0 __ Duration: 11 __ Lenght: 3 ___ UNDEF
Range Start:1 __ Duration: 11 __ Lenght: 3 ___ UNDEF
Range Start:2 __ Duration: 11 __ Lenght: 3 ___ OK
Consecutive = OFF
I’m using the latest org.openhab.binding.mybmw-3.3.0-SNAPSHOT.jar

No big deal as I can use the timing from 1 anyhow :slight_smile: