[PORT] NHL Notifications

NHL Notifications
Get NHL notifications when your favorite team is playing!

  • Get goal notifications in real time, both home and away teams
  • Get schedule for next four days
  • Use data in Rule Machine
  • Show data on Dashboards
  • Make seperate child app for each team to follow

App can be found on my Github: (in the Ported section)

Version:
V1.0.1 - 10/06/19 - Added support for two types of child apps

Child Games Day (replaces original child app):
V1.0.2 - 10/06/19 - Changed child name to NHL Game Day
- Started to streamline the code
- fixed daily check.
- Started collecting code to virtual device

Child NHL Stats:
V1.0.0 - 10/06/19 - Initial release

Driver:
V1.0.0 - 10/06/19 - Initial release.


Original Post:

I've been trying to port the NHL Notifications ST app from this thread.

I've done a ton of work on it but have become stuck! It goes out and gets the date/time for the next game but the time seems to be 4 hours ahead.

example: Tonight's Bruins game started @ 8:00pm EST but I get this back in the app...

If anybody wants to take it for a spin, the new code can be found here.

Thanks!

More Info, this url will bring back the json file for tonight's game. I see the date and it is the same date that the app is displaying but it also says that it's live right now.

Here the url...

http://statsapi.web.nhl.com/api/v1/schedule?teamId=6&date=2019-10-03&expand=schedule.teams,schedule.broadcasts.all

edit: Slowly working my head around this. The time has a Z after it... so z=zulu time (gmt +0), need to set timezone. Now to find it in the code and fix it.... :roll_eyes:

No guarantees (Have not tested, just took a quick glance), but check out line 821:

gameStartTime = Date.parse("yyyy-MM-dd'T'HH:mm:ss'Z'", state.gameDate)

try this instead:

gameStartTime = Date.parse("yyyy-MM-dd'T'HH:mm:ssX", state.gameDate)
1 Like

You're a genius! lol It worked! Data is now pouring in (game is live).

Thank you very much!

Now I need the Bruins to score and see what happens!

1 Like

Could this be ported to any type of sports? example college football, college basketball, etc?

Nope, the data feed is provided by the NHL

I'll just leave this right here.... (coming soon!) :wink::grin::grin:

1 Like

Big update, some things still don't work but wanted to get this out there so everyone could see the direction I'm going in.

Thanks

I liked this one in ST. I am going to give this a try also! Thanks!

I've been out of town for the last week, so I wasn't able to try this out until today.

When a goal is scored I'm not hearing the goal score celebration. This might be an issue with my speaker, so consider that secondary. The RGBW light that I have set to flash blue stays on solid blue when a goal is scored. If I manually change it to another color it keeps flipping back to blue. Either time or when I eventually sent an off command fixed it.

I get the following errors associated with that bulb as the blue color change is executing.

dev:442019-10-12 05:36:36.955 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:19000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.906 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:18000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.856 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:17000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.802 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:16000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.751 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:15000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.696 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:14000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.644 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:13000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.592 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:12000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.542 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:11000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.493 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:10000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.443 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:9000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.391 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:8000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.341 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:7000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.291 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:6000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.241 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:5000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.190 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:4000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:36.137 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:3000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:36.053 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:2000]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

dev:442019-10-12 05:36:35.989 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.on() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:1000]] Possible solutions: on(), run(), off(), run(), any(), any(groovy.lang.Closure) (on)

dev:442019-10-12 05:36:35.937 pm errorgroovy.lang.MissingMethodException: No signature of method: GenericZigbeeRGBWBulb.off() is applicable for argument types: (java.util.LinkedHashMap) values: [[delay:0]] Possible solutions: off(), on(), run(), run(), any(), any(groovy.lang.Closure) (off)

I have the light set to flash blue 10 times with the default timing values. I hope this helps you iron this bugger out

UPDATE : as I was typing the word "DEFAULT" above, I realized that is likely the problem. I entered values in those fields and the errors are now gone. The light turns Blue on a goal but does not flash or change back on it's own. I also reset my speaker device (DLNA using media render driver) and it still does not play any sounds. On goals of either team.