[RELEASE] GameTime - Pro & College Sports Schedules Integration

OK, didn't know that. Makes sense.

Hmm, stumped. I'm using a hub variable, not a local variable -- I'm going to test if that's the difference maker. EDIT: Nope, doesn't make a difference.

Two other ideas:

  • can you reproduce the error with professional teams / NFL? [Edit: I tried a college team instance using RM5--same error]
  • any chance this problem could be related to the way the driver needs another game after install?

Nope, works for me with my NFL teams too.

No, gameTime is populated immediately upon install.

I'm really not sure how else to help troubleshoot. Wonder if a post on a Rule Machine thread might help ferret out the issue.

I'm just going to implement on RM4 for now. At least I know it works. Maybe one day I'll figure out what's going on.

In the meantime, great app. Thanks a bunch!

1 Like

I believe the last version is stable enough to justify release status. So, there, this app is officially released!

1 Like

This is what I'm trying to do as well. I have some LED lights that I want to change color half an hour before game time. The gameTimeStr attribute contains the day and time. So if it says "Today 7:10 PM" I want lights to turn on at 6:40. I'm trying to figure out how to parse this attribute in Rule Machine without having to get into variables but not sure if there is a way.

Anybody have any ideas?

Alex, I have rules to notify before gametime and to celebrate a victory. As soon as I get home (this weekend), I will post those rules for you here. Standby....

1 Like

Thank you. Much appreciated!

Below is notification rule. I'll post the celebrate-victory rule this weekend.

As you'll see, I set it up for two reminders (guess I'm forgetful :thinking:). One a couple days ahead of time (set the DVR) and another 30 minutes beforehand (don't miss it, and make a sandwich). I only used two global variables, one for the wait time (i.e., reminder), which I have set at 48 hrs, and the other for the warning time (i.e., imminent, or about to start), which I have set for 30 mins. Obviously YMMV. Most of the rule are just calcs to derive the wait times from gameTime and current time. It's all triggered off of when the device changes its status to Scheduled, but you could trigger it off other stuff if you wanted.

Warning: there is one problem I haven't resolved yet. Perhaps @JustinL could weigh in here? When I try to convert the gameTime attribute into seconds (looks like its stored in the device in milliseconds), it throws off a "java.lang.NumberFormatException: For input string: "1633292700000" on line 733 (method appButtonHandler)" error. All I'm trying to do is divide that number by 1000 to convert from ms to sec. Wonder if HE can't handle math on such a huge number.

Beyond that known problem, I believe everything works, but I haven't tested much. You're welcome to take it if helpful. Would appreciate knowing if there are problems.

Here are both the rule and the local variables:


Sheesh. That's a lot more work than I thought it would be for this sort of thing. I had thought for sure that we would be able to work with UTC dates in RM, which is why the gameTime attribute is specified as a UTC date. But it looks like that isn't quite the case... Honestly, I haven't set up anything like this quite yet (will when Duke Basketball starts...).

I think it makes sense for me to make this a part of the app so that it's easier for everyone. I'm thinking I can configure the team devices to push a button at certain events. Something like:
Button 1 pushed X minutes before gametime
Button 2 pushed Y minutes before gametime (could be 0 so that pushed at gametime)
Button 3 pushed upon a win
Button 4 pushed upon a loss

Could also add in notifications for those events....

This would be pretty easy for me to do in the app, and it would save a bunch of Rule Machine headaches...

Speaking of Rule Machine headaches, I think this is because I've defined the gameTime attribute as a string, not a number. I had it as a number at first, but then realized I needed to be able to handle the case where there's no game scheduled. I can't set the gameTime attribute to null when there's no game (lots of posts in this community about that....). So I needed to assign it some value (like "No Game Scheduled") when there's nothing scheduled. In any event, I see you specified the variable in Rule Machine as a number but I'm guessing Rule Machine just keeps it as a string? Not sure how they do type casting in that case, or if there's a way for you to cast it as a number before assigning it to your variable....or if it will matter once I do the above....

1 Like

Hi,
This is an awesome app! I got it setup for NFL, working great and the device is showing up.

I didn’t see this mentioned, but is it possible to use with SharpTools or ActionTiles? I don’t currently use the built-in HE dashboards and I have an iPhone, so the Android Dashboard won’t work for me.

Thanks

1 Like

Yep, that explains it.

Well, hold on a minute. You want to make it super easy for us?!!!? Now, come on, where's the fun in that? :stuck_out_tongue_winking_eye:

Seriously, that'd be awesome. If you want a beta tester, just give me a yell.

1 Like

Yes, I use Sharptools and it works great. Use Custom Tiles, in particular HTML Attribute Display as described here. Not sure about ActionTiles since I haven’t ever used it.

2 Likes

Thank you for helping, got it displaying in SharpTools now!

2 Likes

This would be a perfect solution for my needs.

Great! I’ve already coded up my first pass at it. I’ll test it with the NFL and MLB games Sunday!

I’m having some trouble with the formatting of the schedule tile. I set both the odd and even rows to the same settings but they don’t appear the same. Is it something I’m doing wrong? I’m trying to put a screenshot of my settings and the tile but it’s not letting me include any images.

I'm not sure. Difficult to know without much more info. I think the forum limits what you can do until you post a bit more in it. I don't think it takes much. You might even be able to do it now that you've posted that.

Ok I think this is ready for you to try out. Give it a spin and let me know if it works well for you. If so, I'll merge it into the next release.

Sounds good. Since I'm using this mostly for the NFL, let me play around with the Sunday games this weekend. Will let you know what I find.

Still pissed at you for stealing all my fun, though. :crazy_face:

EDIT: Do I need to re-install all apps and devices, or were the changes confined to the parent/child apps?

EDIT #2: Does the app create a separate button device or does the button attribute get added to the team device? I'm asking because any RM logic for notification or celebration would, I assume, be triggered off one of the four button presses.

1 Like

Yes, everything needs to be replaced. If you're using HPM, I think you can copy/paste in the code without messing HPM up. After copying/pasting in the new code, you'll need to go in and hit DONE in either the parent app or in each child app (after configuring the events as desired in each child app)

The button attribute is added to the team device.