[RELEASE] App Watchdog 2


#1

Introducing 'App Watchdog 2'
See if any compatible app needs an update, all in one place.

Benefits of V2... Each app will now 'talk' to App Watchdog, sending the version info directly to AW and then checked against Github to see if there is an update available!

*** All BPTWorld Apps have been updated to be v2 compliant. Look for version 2.x.x of each app! This was a HUGE undertaking so please report any typos that may have gotten in. Thanks ***

** All developers are welcome to setup a compatible json file on their own GitHub! See post #3.**

Features:

  • See at a glance if any apps have an update available
  • If update available, all links to raw code displayed
  • No need to actually go to GitHub
  • Create a time to run daily
  • Can also hit a button to get an up to the minute report
  • Display report on any Dashboard
  • Turn on a device is there is something to report
  • Option to have the report Pushed
  • Parent/Child App structure
  • Each developer can use a seperate child app or add them all into one!

NOTE: This does NOT update the apps for you. But it does make it so much easier!

App can be found on my Github:

Parent:
v2.0.1 -

Child:
V2.1.0 - 08/28/19 - Found a big bug in Developer 1 selection

Driver:
V2.0.3 - 08/27/19 - add a 'Clear Data' option, Minor code changes


How to keep your apps and drivers up to date?
[RELEASE] NOAA Weather Alerts
[RELEASE] You Got Mail
New user-def app & driver code- what and how to update?
[RELEASE] NOAA Weather Alerts
New user-def app & driver code- what and how to update?
[RELEASE] Sonoff (Connect)
#2

To install:
Please visit my GitHub and follow the installation instructions provided. This installs just like any other parent/child/driver app.

Usage:
Once everything is installed, go ahead and create your first child device.

Setup Section:
Developers can be selected from a dropdown list within the app. You can also find a Masterlist of Developers below. If your favorite developer isn't listed, you could always ask them (nicely) to join in on the fun! :wink:

Once a developer is selected, a line will popup under the URL with the name of the developer.

Also, at this point the 'Select which apps you have installed' will populate with the developers apps.

The rest of the app options should be pretty self describing.

After you have filled out all the options you would like, hit 'Done' to exit.

Running the Report for the first time:
Now go back into the child app and hit 'App Watchdog Report'

A new report will display with all of the Apps you choose from the dropdown list. Notice that every one of them says 'No Data' and that there is an update. Don't worry, this will work itself out.

The data will populate as you open each app selected. Also, each app will report its version every morning @ 3am. Again, this will only work for compatible apps.

Now from this point forward, anytime the developer posts a new version this app will notify you of the pending update!

Once you are notified that there is an update to an App. Go back and run the 'Report' again. You will now see which app it is and what needs updating (parent, child, driver). Links to the raw code will also be displayed. Follow the instructions within the report on how to update.

While this may seem like a lot to do, once you set it up once, it'll only take 2 minutes the next time. :grin:

MASTERLIST OF WORKING DEVELOPERS

App Watchdog ver 2

BPTWorld: https://raw.githubusercontent.com/bptworld/Hubitat/master/bptworldApps.json
Aaron: https://raw.githubusercontent.com/PrayerfulDrop/Hubitat/master/AaronWardAppUpdate.json


#3

Developers:
All developers are invited to have their apps work within this system. All that is needed is a simple json file and a little code added to each app to make it compatible.

  • Simply copy my json file (link in 2nd post) to your GitHub
  • Name it whatever you like
  • Fill in the information for your apps, each file can have unlimited apps
  • Post the 'raw' link here and I'll add it to the 'Masterlist' and to the app itself. Users can simply select your name to follow your gitHub!

Your app users (and I) will thank you!

Code to add in each Parent App (also add this code to non parent/child apps)

def setVersion(){
    // *  V2.0.0 - 08/18/19 - Now App Watchdog compliant
	if(logEnable) log.debug "In setVersion - App Watchdog Parent app code"
    // Must match the exact name used in the json file. ie. YourFileNameParentVersion, YourFileNameChildVersion or YourFileNameDriverVersion
    state.appName = "AppWatchdog2ParentVersion"
	state.version = "v2.0.0"
    
    try {
        if(sendToAWSwitch && awDevice) {
            awInfo = "${state.appName}:${state.version}"
		    awDevice.sendAWinfoMap(awInfo)
            if(logEnable) log.debug "In setVersion - Info was sent to App Watchdog"
	    }
    } catch (e) { log.error "In setVersion - ${e}" }
}

This also goes into the parent app...

// ** App Watchdog Code **
            section("This app supports App Watchdog 2! Click here for more Information", hideable: true, hidden: true) {
				paragraph "<b>Information</b><br>See if any compatible app needs an update, all in one place!"
                paragraph "<b>Requirements</b><br> - Must install the app 'App Watchdog'. Please visit <a href='https://community.hubitat.com/t/release-app-watchdog/9952' target='_blank'>this page</a> for more information.<br> - When you are ready to go, turn on the switch below<br> - Then select 'App Watchdog Data' from the dropdown.<br> - That's it, you will now be notified automaticaly of updates."
                input(name: "sendToAWSwitch", type: "bool", defaultValue: "false", title: "Use App Watchdog to track this apps version info?", description: "Update App Watchdog", submitOnChange: "true")
			}
            if(sendToAWSwitch) {
                section(" App Watchdog 2") {    
                    if(sendToAWSwitch) input(name: "awDevice", type: "capability.actuator", title: "Please select 'App Watchdog Data' from the dropdown", submitOnChange: true, required: true, multiple: false)
			        if(sendToAWSwitch && awDevice) setVersion()
                }
            }
            // ** End App Watchdog Code **

Last step for Parent App is to add this to the Initialize() section...

if(awDevice) schedule("0 0 3 ? * * *", setVersion)


Add this code to the Child app...

def setVersion(){
    // *  V2.0.0 - 08/18/19 - Now App Watchdog compliant
	if(logEnable) log.debug "In setVersion - App Watchdog Child app code"
    // Must match the exact name used in the json file. ie. YourFileNameParentVersion, YourFileNameChildVersion or YourFileNameDriverVersion
    state.appName = "AppWatchdog2ChildVersion"
	state.version = "v2.0.0"
    
    try {
        if(parent.sendToAWSwitch && parent.awDevice) {
            awInfo = "${state.appName}:${state.version}"
		    parent.awDevice.sendAWinfoMap(awInfo)
            if(logEnable) log.debug "In setVersion - Info was sent to App Watchdog"
	    }
    } catch (e) { log.error "In setVersion - ${e}" }
}

And then Add this to the Initialize() section...

if(parent.awDevice) schedule("0 0 3 ? * * *", setVersion)

As always, feel free to look at any of my code to see how this is implemented.


[RELEASE] NOAA Weather Alerts
[RELEASE] Roomba Scheduler
[RELEASE] You Got Mail
#4

This looks brilliant. Nice work once again. :smile:


#5

Ah, I didn't realize quite how new this was.

It is failing validation when I press Done and highlighting the GitHub URL in red .
I'm using https://raw.githubusercontent.com/bptworld/Hubitat/master/bptworldApps.json
and it does indeed have a list of apps to check, so it feels like it should be working


#6

When 'pasting' in to any field, sometimes it won't recognize that something is in the field unless you actually type something in. Just hit the spacebar after the end of the data and then hit the 'backspace' to get rid of the space. This happens with any web based form.


#7

still no joy ..
so before typing in the url I have
no "GitHub: BPTWorld" and the list of apps is all "null"

pasting in the url without the https .. I see
"GitHub: Not found" .. which is 100% as I would expect.

adding the https to the front and tabbing I now have
GitHub: BPTWorld
and a populated list of apps .. ofc I checked "App Watchdog".. so the list reads:
AppWarchdog, Must Keep Checked

enter a time, click done, and the github url goes red

after pasting, and "real" editing it updates the owner field "GitHub: BPTWorld"
and popu


#8

odd, it finally "took", going to remove and add again to see exactly what I did
edit .. not sure..
clicking on the "cog" and going to app + setting the "time" until it showed in the "cog" view seems to have done the trick
edit ..
Don't know if this is really what's going on, but I think the "time" fields are dicky..
IF I hand type in an hour press enter, repeat for the minute... then it works


#9

New version on GitHub...

V1.0.4 - 02/08/19 - Dashboard tile now works

Also, here are some screenshots of the output...
Regular screen output...


and on a Tile...


#10

@bangali, @ogiewon, @Cobra might be nice to add your apps?


#11

I soon hope to release my LIFX app and set of drivers, it's not clear from your sample JSON file whether you can have multiple drivers associated with an app (in case it matters the drivers a for different types of LIFX device and they're all created as children of the main app).

Given there will be at least 8 drivers associated with the app this looks like a great solution to the updating problem, which is something that has concerned me.


#12

I think you'll like the next update, couple more things to tweek and it'll be ready.


#13

New version on GitHub...

V1.0.5 - 02/10/19 - Now have two templates available: apps/driver and just drivers. Can now have up to 6 drivers in one section. If more are needed, simply make another section. Added in a new report, 'Current App Versions', shows a list of all apps with versions. DEVELOPERS, please see new GitHub json template.


#14

That would be a duplication of my current work.
I see it might be useful for devs that have not implemented any update code, but I created the original .json update code which I released more than 6 months ago.

All my apps will inform you if there is an update, will tell you what the update is and give you a link to updated code
It would also mean that I would have to maintain two or more sets of json files.

Andy


#15

And then there is www.HubitatApps.com

It's going to become a circus with no central repository for HE apps/devices


#16

Oh my bad! Haven't touched my hub in months and i saw it while updating. Working good indeed!

@sgrayban Oh never heard of it, thanks :wink:


#17

New version on Github...

V1.0.7 - 02/24/19 - Fixed Pushover reports.
V1.0.6 - 02/17/19 - New field added to json, xxUpdateNote. A place to put any notes you want to show up in the update report.


#18

@bptworld I am getting this in the App Current Report. The App Watchdog report is working fine

Apps Watchdog - Current App Versions

Apps - All

GitHub: BPTWorld

null


#19

After updating the apps, did you run the 'Maintenance' section?


#20

Yes I did