so far so good!
and it worked like a charm!
thanks!
Version 1.0.5 is out
- Bug when within an event and new event is detected an error would be thrown during scheduling a past event
- Voice announcements to TTS devices and players configurable like regular notifications
- Config page clean up, most config pages now on separate pages to de-clutter the main page
- Other code clean up
Your version is just missing 3 features to have everything I need. It is just a suggestion:
-
A switch (in my case a virtual switch) that is ON when there is an event schedule tomorrow morning and one for afternoon. In my "before sleep actions" I code a Webcore piston that check for that flag and speak a message using Alexa to remind me of tomorrow's morning event. Normally to power the chauffe-eau.
-
A virtual switch that will disable the pre-event. When in vacations (away from the home) I want the event to occur but not the pre-event part.
-
Another thing important for me: The Alexa messages are different in the morning and the evening and could be NULL so nothing to speak (like in the morning at 6AM).
hello sir,
there is a hydro event tomorrow. but I didn't get the push notification I usualy get.
I upgrade from 1.0.4 to .5. ran API manually. logs shows successful. but still no notification of a new event
looking at the API URL from the logs, they only did "affaire" and nothing for residential.
https://donnees.solutions.hydroquebec.com/donnees-ouvertes/data/json/pointeshivernales.json
Yes you are right, I also went to the API and checked but nothing for residential. Will keep an eye out and maybe try to reach someone at HQ that works on the API side of things?
I also queried the API directly with other values and nothing, kind of weird.
I sent a message to the dataset team about this mornings event not being listed in the API even though we all received an email and/or notification from the HQ app. Will let you all know what they reply!
I also sent a message through the data portal. At 1504 they added this morning missing data. I highlighted the importance of such data for automated energy management. Not sure if this was a one time issue, or a new way of working for them.
I checked at noon and the missing data was not there yet, just checked again and now I see it. Time will tell, but I think that I'll do a small revision and poll all day instead of stopping once a new event is found as I can see, data is added at all times of the day especially for the ones that need the business data.
There will most likely be an event on this friday morning, I'll keep an eye on the data!
Looks like they are back on game with the API, the app picked up the tomorrow morning event as it should. Will keep an eye and make sure all works as intended, let me know if something does not work or seems buggy.
Hi Nelson,
Thanks a lot for your time on this. I did see on the .json file upcoming events on Monday.
Is this because the event is 3 days ahead that I get an error when trying to poll data? First time I'm using it so maybe that error is just intended and OK since it's monday
error:
java.lang.NullPointerException: Cannot invoke method toInteger() on null object on line 577 (method pollHandler)
integerHour is at a null value in that case but seems to pass in the <12 statement.
Not home at the moment, let me check but did not have errors when it was scheduled on my side for monday. I will try to check that tonight or sometime this weekend.
Hi Nelson,
Found the issue. With a new install of your code, the 120 default value for pre events did not seem to get to the code. I did change to 1 and back to 120 and now it works.
Thanks I'll look into this soon.
Well this actually messes things up a bit because of the way I was using the data returned from the original API I had access to, last year the official API was updating pretty much once a day and for the next day events. But having these new events added 3 days in advance wrecked havoc in the scheduling, I will need to re-write the API polling and scheduling from scratch and will also need to verify if the event has already been scheduled or not so that we don't have overlapping CRON jobs on the hub like what happened this weekend.
I will work on this part time this week and will push an update as soon as I have some more reliable code when this situation happens. I also think I will just poll the API every xx minutes (configurable) all day long since updates are all over the place during the day and we don't want to miss an event because of it.
Well just joined another Facebook group about HQ Flex-D program and saw a post about the JSON file having erroneous data in it about an evening event on Sunday Dec 7th, This explains why my house went in full pre-event mode and we were wondering what the heck is going on, then I noticed an event coming up but no info about it on the website. So since I did not have time to check what was going on, I cancelled everything hoping it was just some bug in my app, so looks like my app was not to blame after all ![]()
Thanks to @beland.remy for pointing it out on the Facebook group because when I had more time in the evening, I did check the JSON and nothing was in it about an event on that day, but he had a snapshot of it as proof!
Hey Nelson,
It is still in the json file, however it is after the 2 December 8th events (Line 344).
I wasn't sure if it was an event or not at that time!
Ha, just found it, I was sure it was sorted by date, but it looks like they just sort it with the DB id field. Thanks!
FWIW here is the API endpoint I use to fetch peak period info - allows filtering and sorting, etc.
@Field static final Map API_PARAMS = [
uri: "https://donnees.hydroquebec.com",
path: "/api/explore/v2.1/catalog/datasets/evenements-pointe/records",
query: [
order_by: "datedebut",
limit: 100,
timezone: "America/New_York",
refine: "offre:\"CPC-D\""
],
contentType: "application/json"
]
Thanks @hubitrep, that would be more logical than going through the HQ generated JSON file each time, I had not had time to study the API calls but was going to check it out during the holiday vacation, this will save me some time to rewrite my code and optimize it.
