[RELEASE] GameTime - Pro & College Sports Schedules Integration

Should the tile show the score or the winner:

image

It will show “Won” if your team won, and “Lost” if your team lost. It deduces that based on the change in the team’s record, so it needs one game under its belt after install to be able to display that. Check back next game to make sure it displays correctly.

1 Like

Hi, first off my son and I love this driver! He's constantly telling me who the Mets play today (not that it matters since the Mets stink lol).

Anyway, I was wondering if it was possible to add the schedule somehow.

Obviously, there's no room for a schedule on a 1x1 tile. I'm not sure how the built-in dashboard works.. what happens when you click on a tile? In the dashboard I'm working on though clicking on a tile opens up the view full-screen so there's plenty of room below for a schedule.

image >

I wish I knew the groovy language better (something on my list to learn) but I did look at the driver code and it looks like you're fetching the team schedule already. Even if not part of the tile attribute, maybe a new attribute?

That could be cool. I'll have to look into how it could work, though. As you've noticed, getting the schedule data is no problem. I could put it in a new attribute, which I presume would be HTML formatted for display. Something like this perhaps?

image

It would be easy to add that new attribute to the dashboard in another tile. The trickier thing would be to have the schedule show when then existing tile is tapped. That would be the way I would prefer it on my dashboard - but not sure if/how it could be done.

Could you code your dashboard to display one attribute on the tile, but then switch to displaying a different attribute when the tile is clicked and enlarged?

Yeah, that example looks awesome! I can't help change the built-in dashboard but I can definitely handle it on my dashboard :slight_smile:

I'm guessing it would still work with the default dashboard at least by showing just the schedule in a larger tile on the main screen.. again, I haven't used it much so I'm not 100% but I think that would be possible.. just don't want to ask for something that's limited to just my app!

Yeah, I'm not sure about the built-in dashboard either, since I don't use it. I think what makes sense is for me to just put the schedule in an attribute, and then it's up to the user to figure out how to make it work for their dashboard.

1 Like

v1.4.0 - Added schedule tile
image

Let me know how that works for you.

I'm going to see how college football does tomorrow. If all goes well, and nobody else raises any issues, I'm planning to officially release (out of beta) by next week.

Looking good! I'm not an HTML expert by any means but I did modify a few things to get to this point. I'm basically just combining the 2 <div> tags together with a <hr> in between.

  • I removed height:90% from both tile and schedule otherwise the matchup (tile) takes up most of the space
  • I changed the font color to black for the shaded rows
  • I also change the font color to white for everything else because my app generally uses white text on a darker background color.. this logic happens for all HTML tiles not just the GameTime one

Anyway, if you have any tips or things I can try let me know.. in particular, do you know how I can keep the row height the same for every row? I have a feeling some of the team logos are different sizes in the NFL screen which is causing this. Also, not sure how to keep the team name from wrapping in the college example.

side-note.. I probably don't need to show both tile and schedule together.. just figured I had the extra space

2 Likes

That looks great! I will fiddle around with the HTML a bit to see what optimizations I can come up with.

At the moment, I'm thinking about making row colors and font colors configurable.

Regarding the height:90% part, I will have to think about how to handle that. I feel like I put that in there so that the tile size changes dynamically with the browser window. Do you think it would be good to make it configurable to have the matchup part and the schedule part render in the same attribute or different attributes?

actually, the more I thought about it - I don't need to display both elements on the same screen.. in landscape there's not as much free vertical space anyway so I can just display the schedule.

anyway, I really appreciate the changes! that's a really nice addition to an already great driver

So I think I forgot to hit save on my low priority team (Astros) so I just went in and changed it.

After saving I reopened Hubitat Dashboard for Android and I am still seeing Astros even though there is a Texans game in 14 hours from now.

Do I need to re-test since I saved my settings during the 24 hour horizon or should the changes still have taken effect?

The changes should have taken effect. Are you sure you are looking at the 'all-teams' tile instead of the Astros-specific tile? Also, did you refresh the Hubitat Dashboard? I assume you have the timeframe set as more than 14 hours (e.g., 24 hour default)?

If all of that sounds like it should be good, then take a look at the log to see if you have any errors.

One thing you could do is go into the parent app and click "done" - that will definitely update everything. Would be interesting to see if that makes a difference...

Yes! That did the trick. Thank you.

1 Like

@JustinL, fantastic app, thank you.

Two questions (started with NFL):

  1. My schedule tiles are blank. They show up as expected in the device details page, but when I go to dashboard and select the Schedule attribute, I get “Please Select an Attribute” as it no attribute had been selected. This seems true irrespective of team.
  2. What is the Parent App ID in the device preferences for?

+1 for Soccer!

You're welcome. Glad you're enjoying it.

Looks like this is caused by the 1024 character limit for attributes on Hubitat dashboards. I'll work on fixing this in my spare time today.

I used it at one point, I think, but it isn't needed anymore. I'll delete it.

Thanks for pointing out these issues!

1 Like

I've worked on this a bit, but it's not looking promising. The 1024 character limit for native hubitat dashboards seems to be difficult to get around. I have tried a number of different approaches to no avail. For example, rendering an SVG for display on native dashboards works, except I can't reference 3rd party images, so there wouldn't be any logos in the schedule. Plus it would only be local, not cloud. Unless I come up with something miraculous, I think the schedule tile will only be able to display on non-native dashboards that don't have the 1024 character limit....

EDIT: Well, looks like I posted 10 minutes too soon. I figured out a way to do it. Will update soon....

v 1.4.1 - Fixed issue with displaying schedule tile on native HE dashboards. Added settings for configuring schedule tile font size, row background colors, and row text colors.

Important This change requires you to enable OAuth to view the schedule tile. It was the only way I could find to sidestep the 1024 character limit. Let me know if this is a problem for you.

@jpage4500 Let me know if this re-work of the schedule tile messes up what you've got. You'll have to enable OAuth as indicated above, but hopefully it doesn't change anything on your end besides that...

Also, I'm not sure if this will work for displaying the schedule tile when remote from your hub's local network. Please let me know if it does or it doesn't.

I'm excited to try it out! I can always tweak things to make sure it works on my dashboard app

1 Like