Handling electricity dynamic pricing - Flex D

I’ve automated it using GCal Search as @zieghous suggested in a post above. So far it works fine but an API integration sure would be nice.

I am working on it but the fact that HQ is not purging the old events in there JSON file, makes it a bit harder to determine new events compared to the last ones and just keep track of what needs to be added to the scheduler (CRON jobs) and the ones that are already scheduled, there is no way in Groovy to check if a scheduled job exists for a certain time, the easiest way would be to flush everything and schedule all upcoming events but then you will get notifications for events that were already notified about and gets messy real fast.

I'll try to get something working this weekend but no promises, I'm actually setting mine manually also to give you an idea :woozy_face:

ChatGPT and I, we made an app to pull the events :

In the app you have two switches that are going to be turned on a number of hours before the events (Heures avant le préchauffage).
I am using those data : https://donnees.solutions.hydroquebec.com/donnees-ouvertes/data/json/pointeshivernales.json

It is supposed to send you a notification at 9PM for a morning event and at 1PM for an evening event.

I use rule machine to set the thermostats and to turn off the switches after the events.

Terrific !!!

I'll try that for sure and report back.

@zieghous ,

Any luck on your end?

On my end, I don't get the notification and my switches aren't turned ON by the app.

And a suggestion: It would be nice to be able to set more than one device for the notifications.

My app is now finally online and in HPM.

You can manually install it and check the readme file at the link... Now also available via HPM

Here is the link to the community page...

1 Like

Can you try to activate manual refresh and to run It :

In the log you should see something like that :

Let me know. It works perfectly for me.

Merci @nclark

1 Like

2 posts were merged into an existing topic: [RELEASE] Hydro-Quebec Dynamic Pricing

Hi Zieghous,

Yes when hitting the manual refresh button it pulls the data from the API and then set the switches, etc.

But it didn't do it by itself yesterday at 21:00.

Maybe I did something wrong.

I'll monitor it when we get another event.

And I got an error at the end of the event, not sure what that mean.

I'm also trying nclark app.

It is turning on the switch at 6:00 ?


For some reasons the API is refreshed more often than the schedule but It is only pulling the next events.

OK, I made some changes in the code to be able to select multiple devices. Also, I made some changes to fix the switch not turning off at 9:00 am in your log. Let me know.

love it!
looking forward to the next peak period to see if it works!

we have a peak period tomorrow AM and PM. I was looking forward to see if it works.
it didnt work for me. no notification on my cell and nothing in the logs at 9PM. it's 10:35 PM and both switches are still off
I hit the button "rafraichir les donnees des API" then I got the notification on my cell and log showed this

logs:

here is one of the 2 virtual switches

and the app, pretty straight forward. kudos, love it.

did I do something wrong?
thanks! :slight_smile:

I made a new version. Notifications are now working and are planned at 1:00 PM or 21:00 PM. I added a switch to disable turning off at the end of the period. Hilo by example is finishing at 9:00 PM but the events from the API are finishing at 8:00 PM.