Open jcallaghan opened 4 years ago
How is this different from https://github.com/CCOSTAN/Home-AssistantConfig/issues/606
@CCOSTAN it isn't more of a companion.
I've never built out an automation to notify me of build updates. #103 was focused more on generic issue and battery. I might even leverage a script in front of the rest_command to add conditions so I can better handle labels etc. In terms of the Updater integration. This is perfect but with the addition of the Version integration, I can report on the current version and then use this in templates and things such as create a GitHub and tracking the version the issue was reported in.
PS. I really need to sort out why I get "No history state found" on some of my entities. It feels like this has started since I migrated over to MariaDB #11.
@CCOSTAN fun fact. The version sensor also seems to report more quickly than the updater.
To much surprise after some tinkering, I managed to build something that will close the GitHub issue raise when a new version is available when Home Assistant has upgraded to this version. This leverages the rest integration and rest command integration. The jsonpaths were a little tricky but I got there in the end and JSONPAth Online Evaluator was a real help. Sadly the rest_command isn't able to provide any response data from a success or error. This could have been used to get the GitHub issue number. Instead, I've achieved this with two automations and some helpers.
While it was fun. Due to the limitations, I experienced with filtering in jsonpath I'm not sure this can be used reliably due to the jsonpath not being specific enough.
I think was similar to what Jeff thejeffreystone/home-assistant-configuration#61 was looking for
binary_sensor.updater
turns on triggering an automation. rest_command.github_new_issue_upgrade
service which creates a new GitHub issue. binary_sensor.updater
turns off after an upgrade, a second automation is triggered.rest_command.github_close_issue
. I need to look at the triggers as I don't think the upgrade completed automation is getting triggered. Additionally, I need to change the close process as it is changing the issuing body rather than adding a comment like intended.
These are the two rest sensors I've created to provide me with the most recent issue number and the issue number where there is a match for my upgrade issue.
I've noticed that updater doesn't update automatically at all, while version does. Update 0.111.4 came through yesterday and the version latest sensor updated while updater still shows no update.
Lovelace card with my helpers
Version number as a Label would be pretty slick. Then you could extend that framework out to integrations etc..
There is a label API so could easily be added as an action to the upgrade available automation. https://developer.github.com/v3/issues/labels/#create-a-label
Expand on this a little @CCOSTAN. As in I added integration x with version x? Or I had an issue with version x?
https://developer.github.com/v3/issues/comments/#create-an-issue-comment
GitHub DeveloperGet started with one of our guides, or jump straight into the API documentation.
https://developer.github.com/v3/issues/labels/#create-a-label
GitHub DeveloperGet started with one of our guides, or jump straight into the API documentation.
Home Assistant upgrades rock and there is nothing nicer than upgrading to a fresh new release and getting access to all the updates. Inspired by Carlo I decided to track upgrades as an issue in GitHub.
To help you track when there is a new there are two integrations you can make use off the Updater integration which provides a
binary_sensor
. This also has attributes that provide more information about the new update. Then there is the Version integration integration that creates a number ofsensors
based on how you configure the integration. I've always found the version integration to be more responsive at alerting me about a new release.With help from the above integrations, I've created a #DevOps process (similar to #103) to help me automate my upgrades. When a new release is available an automation is triggered. This creates a notification within Home Assistant and creates a new issue in GitHub. I use the
rest_command
integration with the GitHub APIs to create, comment and close issues. The issue that is created in GitHub allows me to track any issues or feedback about the release and also acts as a reminder that I need to perform an upgrade. To help me track if an issue has been created I use the restsensor
to find if there is an open issue in GitHub relating to upgrading Home Assistant. This helps me avoid creating duplicate issues when an update is available and is used to help me close the issue automatically. Once the upgrade has completed I automatically comment on the issue and close it.Features