Author: HCA Central Version: 3 Added to Library: 07-Nov-23 HCAVersion needed: 18 Keywords: Utility
Package Description: What's new? 17-Oct-23
Added the programs Hubitat Check and Hubitat Watch and sub-programs that they use.
Hubitat Check is started by a reception from the Hubitat of commands received by the HTTP Server package. Also started by and reports received from the Hubitat by the HTTP Server package. This looks for the Hubitat to go offline or to stop reporting.
If you want to see how long it was since the last command the Hubitat sent to HCA, run the program "Hubitat Command Timing Info".
If you want to see how long it was since the last report the Hubitat sent to HCA, run the program "Hubitat Command Timing Info".
Also added the program "Check if the Hubitat needs updating"
Note that before importing this package you must have previously imported these packages:
- File Tools
- Messaging Tools
- Elapsed Time Image
- Network Tools
- HTTP Server
- Hubitat
- Hubitat State Connector
Also, there were changes to the code for the Hubitat HCAApp implementation. That's a change you need to make in the Hubitat. Make sure it shows 10-17 in the "What's new" section of the app's code.
Program Description: Program to add Hubitat timing info to the Daily Report and then clear the saved datat. Schedule this for a few minutes before when you have the daily report sent.
Global Variable Use:
Name | Description |
---|---|
HE_MaxSecondsBetweenReports | Max time between reception of Hubitat reports |
HE_MaxSecondsBetweenCmds | Max time between reception of Hubitat commands |
HE_LastReportTime | Time of last message received from the Hubitat Maker API |
HE_LastCmdTime | Time of last command received from the Hubitat HCA drivers |
Program Description: Checks to see if there is a more recent version of the Hubitat firmware available past what is currently in the hub.
If the tag on this program "SendMessage" is present and set to "1" then a priority 3 message is sent via the messaging package.
Return value: Returns a text string if there is more recent firmware available, a boolean value if not
Program Description: Gets the version of the firmware running in the Hubitat hub
Program Description: Started by Hubitat Watch each time a HTTP reception happens from the Hubitat.
This program has this configuration in tags:
CheckMinutes: The number of minutes a reception before another should have arrived. Perhaps the Hubitat has gone offline or suffered a software problem.
UsePing: Value is either a 0 or a 1. If a 1 then a PING is done to the Hubitat IP address and if it responds then no action need be taken. Note that on some networks PINGs don't work so test this before enabling.
MessagePriority: This program uses the "Send Message" program in the "Messaging Tools" package to send a message. This is the priority of the message. See the program notes on the message sending program to understand what the priorities mean.
All the program does is to delay for the number of minutes as set in the tag. Normally if the Hubitat is alive and reporting things to HCA, before that delay completes this program will be stopped by HubitatWatch and restarted. If it happens to get all the way through the delay that means the Hubitat has not sent anything for the time period specified.
Program Description: Returns a displayable string showing the time of the last received Hubitat command (sent from the Hubitat HCA drivers) and the maximum time between command receptions.
Example:
Last Hubitat HCA driver request 10 minutes ago (31-Oct 05:19:29). Max time between driver requests 1 hour 7 seconds.
Global Variable Use:
Name | Description |
---|---|
HE_MaxSecondsBetweenCmds | Max time between reception of Hubitat commands |
HE_LastCmdTime | Time of last command received from the Hubitat HCA drivers |
Program Description: Returns a displayable string showing the time of the last received Hubitat report (message from MakerAPI) and the maximum time between report receptions.
Example:
Last Hubitat state report message 5 seconds ago (31-Oct 05:29:24). Max time between report messages 1 minute 3 seconds.
Global Variable Use:
Name | Description |
---|---|
HE_MaxSecondsBetweenReports | Max time between reception of Hubitat reports |
HE_LastReportTime | Time of last message received from the Hubitat Maker API |
Program Description: Starts whenever the "HTTP Server - Receive HTTP" or "Hubitat Elevation - Hubitat Event Handler" programs gets a reception.
Uses the global variable HE_HubAddress that should hold the IP address of the Hubitat.
The two programs that process receptions from the Hubitat are these:
HTTP Server - Receive HTTP (port 80). This is used by the HCA object device drivers, so they are called by Hubitat when it handles a voice command from a voice assistant.
Hubitat Elevation - Hubitat Event Handler (port 8080). The MakerAPI sends to this port to report state changes in Hubitat managed devices
Both programs update tags where the Tag Name is the IP address of the reception, and the tag value is the time of that reception.
This program uses those tags in a clever manner. When this program is started by the tag change trigger, HCA supplies the tag name as an argument so this program checks that that argument is the IP address of the Hubitat.
(The Hubitat Event Handler program should only be receiving from the Hubitat, but the HTTP Server - Receive HTTP could be getting receptions from other sources)
This program doesn't have to at the reception time, it just uses the act of the reception to start a delay. If the delay expires that means the Hubitat has not "talked" in a while and an alert is made.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Object | Object | The object whose tag changed | |
TagName | Value | The name of the tag | |
TagValue | Value | The value of the tag |
Global Variable Use:
Name | Description |
---|---|
HE_MaxSecondsBetweenCmds | Max time between reception of Hubitat commands |
HE_MaxSecondsBetweenReports | Max time between reception of Hubitat reports |
HE_LastReportTime | Time of last message received from the Hubitat Maker API |
HE_LastCmdTime | Time of last command received from the Hubitat HCA drivers |
HE_HubAddress | Hubitat hub IP address. Find from your router and configure the router to not change the IP address. Example of how to enter: 192.168.0.31 |
Program Description: Program that receives tag change triggers from any device when the value of the tag HE_Power changes. This tag has its value set with data supplied by the Hubitat and is the current wattage being consumed by the device.
If that device has the tag "Track Power" defined - value is unimportant - then this program creates an entry in the power track file for the device.
Important: In the properties of the device, you should NOT tick the "Power Track" option in the "power track" tab but should fill in the maximum wattage the device will ever report.
When that's all configured, then all the power track charts for current power and historical power will use this data.
Example:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
Object | Object | Object on whose tag changed | |
TagName | Value | Tag Name | |
TagValue | Value | Tag Value |