[Deprecated] NHL Game Day

NHL Game Day
Get NHL notifications when your favorite team is playing!

  • Get goal notifications in real time, both home and away teams
  • Play Horn or Boo when a team scores
  • Also can send text to speech for speakers that can't play sounds
  • Send push when a team scores
  • Use data in Rule Machine
  • Show data on Dashboards, all data can be displayed separate or use our predefined tile!
  • Make separate child app for each team to follow

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


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!

1 Like

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.

Hockey fans rejoice!!!

New version of GitHub... ( in the 'port' section )

Parent App:
V1.0.2 - 11/29/19 - adjustments, adjustments, adjustments!

Child App:
V1.0.3 - 11/29/19 - Major enhancements! Reworked several modules and added a couple too!
- Fixed Pregame Message
- Major enhancements to speaker section
- Horn and Boo now play over speakers, also honors the Sound Duration setting
- Added text to speech if your speakers can't handle Sounds
- Changed up the Tile, much better formatting
- Lot's of code cleanup

Driver:
V1.0.1 - 11/29/19 - Major overhaul

1 Like

First off, THANK YOU!

Secondly, App and child seem self explanatory, other than installing the driver do I need to configure it in any way?

Thanks,

Other than creating the virtual device, no setup is required on the driver side. For the child app, just select the options you want.

FYI, I'm seeing about a 30 second delay between viewing a goal and hearing the announcement. I'm using Xfinity for both viewing and internet (blast). Funny though, if I stream it on the Xfinity's app, it's almost perfect!

Ok, i tried entering some values and hit the buttons in the driver and only received errors in the log so I was hoping that was all I needed.

I stream through Hulu and typically have to pause the game about 10 seconds to keep the goal signal from preempting the stream.

I'm not having much success with the app as is. I only use it for goal scores, flash RGB lights, play team goal music and boos.

On a goal score the light turns on to the correct color, does not flash, and does not recover previous state. The funny part though is the music; instead of playing the song it reads me the URL!

This same hardware worked when on ST so it's probably just the platform differences. The lights are OSRAM BR30's directly paired to HE. My music player is a DLNA speaker using the Media Renderer driver. It plays .MP3's, .WAV files, and does TTS like a champ except when a goal is scored of course.

I'm not opposed to changing out some hardware if there's a known working configuration. What's working for others?

@bptworld First off, this app is awesome! Anyways, not sure if I'm doing something wrong or not. I'm using a Google Home for the goal sound. It connects via the Chromecast beta app and makes the Chromecast connect tone and then plays the goal sound really quick, like 1 second. If I change the duration of play to a longer time, it connects --> plays Chromecast connect tone --> plays goal horn for 1 second --> reconnects --> plays Chromecast connect tone --> plays for 1 second --> repeats for the duration that I set. Is this normal or do I possibly have something causing this? Thanks again for all the great work!

I've had this happen too, not every time but occasionally. Hopefully I can look at this over the all-star break.

Thanks

Oh and Welcome to Hubitat!

Try the new version I just put on GitHub... Will have to wait until after the break to test.

V1.0.4 - 01/23/20 - Attempt to fix horn stuck in repeat, Added test buttons for Horn and Boo

Thank you for doing this! The horn tester is a nice addition! How long is the horn supposed to play for? Mine does play but only for 1 second no matter what I put for the play duration. I only have the NHL parent and child driver/app installed. Do I need to set up anything else other than the Chromecast beta app? I selected my Google Home in the speaker options of the child app under Speech synthesis speaker because nothing shows up under music player speakers. Not sure if that is the reason. The help is much appreciated!