I have to say the most recent updates that include button triggers to kick off automations are a life saver. DirecTV constantly fails to record my home team's games and now my LED strip + phone notification an hour before gives me a heads up so I can check if the recording is scheduled.
So a dashboard question. After incorporating in Hubitat Dashboard for Android with no issues I've started dabbling with Home Assistant. Using the Hubitat integration in Home Assistant I added these to Lovelace dashboard but it shows up as a switch and a clock:
I also tried adding the child devices (my teams) to Maker API to see how they looked in Home Assistant but it doesn't provide any of the custom attributes like Game Start time or opponent:
Is there any way these attributes can be brought into home assistant lovelace dashboards?
Completely understand if this is out of scope for this app but just thought I'd ask.
I'm not sure since I don't have Home Assistant or use Lovelace. Seems like they would have an option to display a custom attribute? I'm guessing you would want to show the "tile" attribute. Perhaps you can look into that on the Home Assistant forums and report back. If there's no way to do it, then I guess I could expose a URL for you to point an image tile at, assuming you can display an image from a URL in Home Assistant?
Sorry, I haven't had a lot of time lately to do much with this, in part because I was able to grab tickets to the World Series (go Braves!) and have been preoccupied with that. Would you want to send me a pull request to consider?
lol. parse it back - I can do that. In my suggestion, I buried a 1x1 gif - since you rely on the wiki for images - the location of the gif. I'll see if I can do a base64 embed as well.
it may take me all day - i've got a doc appt this am.
Hey @justinL wow. I did not realize what I was getting into!
First off - you were already miles more advanced than I was - I thought I had enough CSS/HTML skills to solve this (and I still do!).
Once I forked your repo, things went downhill. I found the section related and made adjustments and all went very smoothly. Then when I went to verify and test - I had nothing. Scratching my head I checked the HE logs and found I had induced an error ' Tile greater than 1024 chars'. I honestly suspect you've seen this and are now laughing at me knowing full well but thats just me being me (LOL).
So. HE has a 1k limit on what you can put in a tile. I've no doubt 3 yrs ago when they were cooking this up it seemed like a lot. Anyways. I digress.
As I was looking for solutions to the ~220 chars I added to your code, I considered shortURL - since 2 biggest components are the URL to the wiki for the logo's. Those strings alone are 30% of the total. Wiki does support short URL but since you're receiving it from the sports api - its concrete. Your skills are waaaay beyond mine and i don't want to tinker with ways to pull the value and get the shortURL version of it from wiki.
In the end, I know it works pretty good because the Android Dashboard displays it very nicely. I also saw you have written an image server - which maybe there is an option there. All the images could be pulled down, then served off the HE but... uugh. it's a ton of work I'm not ready for! Sorry to back out, but it will be a while until I feel I have strong enough skillls to do your app justice. thanks for letting me give it a run.
Here is how I had it looking on first pass on the android Dash (which doesn't care about the tile size limit)
Hi @JustinL - I believe I've isolated another bug or problem. It occurs on both line 352 of the college and 405 of the Professional instances of GameTime.
actually has no effect (except on the images!). I believe your intent was to pass a fontsize variation to the text content of the table in the iframe. I tested a correction which worked for me as:
I effectively moved the variable $fontSize from the Div to the table where the cascade would be effective. I'm attempting to get my tiles to work on the Android and stumbled over this - I only tested on IE and firefox. (and within an app).
Hiya @JustinL - I got a bit over-zealous. Originally when I peeked/picked at your code my needs were to fix a layout problem on the Android Dashboard of @jpage4500 which is as outstanding a body of work as your app.
I realized that the 'fix' I had made for getting fontsize actually impacted what I was doing previously when I was attempting to fix the icon size problem I was having.
Ultimately, by sheer will I was able to preen down my additional code to 8 chars less than what you had and in addition, I fixed a problem where the fontSize and fontColor of the TILE (not the schedule!) now operates as I think you designed it as well as tidied up the logo's so they now fit on the Android Dashboard as well as the HE dashboard regardless of your image source for the logo's. If you ever had time - you might want, at some later date, to change your image pull from Wiki to NHL.com as that would save an additional 42 chars against the 1024 tile max. but at this moment you have 4 chars left - I tested against ONLY NHL. I am seriously concerned that NBA or NFL team names but I didn't check them.
You may want to test then implement on lines 952-955 of the Pro Instance: (sorry for the block quote, the editor was munging my cut/paste):
That's actually only an option in college sports. The teams data is not as big in pro sports, so the teams data isn't cleared. So, that's not going to help reduce your API count. Do you just have 3 NHL teams? I might have to dig a bit to figure out where / how to reduce the API call count. Off the top of my head, it might reduce it some to make the update period longer. But not sure if that alone would do it since I'm not sure how close to the 1000 calls you are.
Morning - I had 3, and removed 1 today that wasn't really necessary to monitor. I think that GT is updating very frequently when it's not necessary - if the update rate was hourly except when pre-game time is reached it would help!
Or - a variable that allows user config of the update period. I was trying to deduce if there was a way to see the # of updates (such as an attribute or sendEvent counter on the device) as a debug tool. I suspect this might need a bit of foundational thought...
Unless you're seeing a bug in the updates, the app is intended to update fairly infrequently when there's no game ongoing. Once per day. The in-game updates are somewhat frequent out of the box (every 10 minutes). That is what I think could be made configurable for people like you who monitor 3+ teams per league. It would be pretty simple to make it configurable - just have to get some time... hopefully next week.
Look at the state of the Gametime parent device. There's a state variable called apiCallsThisMonth. Bear in mind that, given the structure of the API, there are usually multiple API calls required for each update that needs to happen. So it's not as simple as 1 API call per day when there's no game.
heyo - I recently stepped wrong while doing some testing - I clicked delete on the Parent while I had multiple children - and the whole thing zapped.
I put a note in feedback thinking it was a system controlled routine and got this response from @bravenel
"You have to build the check into the parent app yourself. The built-in parent apps all have double check warning pages, that warn about what you are about to do. This is just basic coding.
On the main page of the parent, use uninstall: false You put uninstall: true on the remove double check page.
So I recently bought a new c7 hub that I'm dedicating for all my apps/automatons and I'm trying to set up my GameTime app and child devices on the new hub. I installed the app via HPM and tried to add my 3 teams. The first two teams (Rockets and Astros) installed just fine. But when I tried to add the Texans it shows up in the app section:
2022-03-23 11:55:00.897 am [error]groovy.lang.MissingPropertyException: No such property: Team for class: java.lang.String on line 1129 (method updated)
When I click the error it takes me to the Texans setup page but I don't know how to resolve the error so that the child device appears.
I've tried uninstalling/installing several times and only the Texans gives me this issue. I still have it installed on my original hub and it shows up just fine there.
What version of the app are you using? If the error relates to the line of code that I think it does, it suggests that the app thinks the Houston Astros are in the NFL, not the MLB. I'm not sure if it would even be possible in the app to do this, but can you confirm the Houston Astros app has MLB selected for the league and not the NFL?
The line of code at issue seems to be:
if (league == "NFL") key = standing.Team
else key = standing.Key
So for some reason it seems to think league == "NFL"
I'm using the latest version from HPM. I just checked all my HPM packages and they are up to date. I did confirm that the Astros have MLB selected both on my original hub and my new hub:
Another troubleshooting step I tried in the new hub is to delete the GameTime app and re-install it. Then I added Texans first but it still wouldn't create the child device in the device page. It just showed a parent device in the device page:
Lastly, I tried to export the Texans from the apps page on my old hub and then import it on my new hub. It still creates a parent device without the Texans child device.: