Node-RED Events/Location node and Cloud Backup Event

I want to create a notification via Node-RED when Cloud backup fails but I don't see that event being published either through the "event" node or the "location" node. I do see that event under Hub Events in the Logs tab.

Has anyone tried to do something similar or have an alternate solution? I don't use Hubitat rules so hoping that there is something that I can do with Node-RED.

EDIT: C-8 with FW 2.3.9.184

Thanks for your help

1 Like

@thebearmay - in thought I had seen a driver that you had created for the Cloud Backup event but I can't find it any longer. Is that something that you still have?

Are you looking for the code to check the backup event?

I think that was it. I was hoping that I could simply grab that event in Node-RED but neither of the nodes see it. What I’m hoping now is something that sets a state (success/fail and maybe the text) in a virtual device that I could then get in NR.

In one of the threads on the Z-Wave crash/backup issue, you had posted some code that I thought did that. But I can't find it now☹️

I'll have to look for it, but do recall that it was looking at the location event cloudBackup ≠ success

1 Like

Yes! That was it....

Found it!!!

1 Like

Aargh - looks like it won't work as it requires a notification device to be set up in HE :frowning:. Let me look around and see if I can find another solution. Thanks again for your quick response.

If it helps I have a Virtual Notification Device driver you can use. It basically does a log.trace for the message which you could look for in NodeRed
https://raw.githubusercontent.com/mlritchie/Hubitat/refs/heads/master/Drivers/Virtual_Notification_Device.groovy

I use it for testing of a few of my apps that send notifications.

1 Like

Wouldn't be too hard to have a virtual notification device push the event to an attribute.

1 Like

Try this:

Dirver Code
/*
* Notify to Attribute Device
*
*  Licensed Virtual the Apache License, Version 2.0 (the "License"); you may not use this file except
*  in compliance with the License. You may obtain a copy of the License at:
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
*  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
*  for the specific language governing permissions and limitations under the License.
*
*  Change History:
*
*    Date        Who            What
*    ----        ---            ----
*   
*/

static String version()	{  return '0.0.0'  }


metadata {
	definition (
			name: "Notification Attribute", 
			namespace: "thebearmay", 
			description: "Simple driver to act as a destination for notifications, and set an attribute to the value",
			author: "Jean P. May, Jr.",
			importUrl:"https://raw.githubusercontent.com/thebearmay/hubitat/main/xxx.groovy",
            singleThreaded: true
		) {
			capability "Notification"
            capability "Actuator"

			attribute "notification", "STRING"


			}   
		}

preferences {
		input("debugEnable", "bool", title: "Enable debug logging?")

}

void installed() {

}

void updated(){
        if (debugEnable) log.trace "updated()"
		if(debugEnable) runIn(1800,logsOff)

	}

void configure() {
}

void deviceNotification(notification){			
    sendEvent(name:"notification", value: "$notification")
}    

void logsOff(){
    device.updateSetting("debugEnable",[value:"false",type:"bool"])
}
1 Like

@thebearmay @ritchierich - thanks so much for the sample code. I was able to use the notification drivers along with the Cloud Backup Attribute app and see the event in Node-RED.

Then it turned out that I could ALSO see the original backup event in both the event and location nodes! Not sure why it did not work the first time I tried it but it does appear to be working now.

2 Likes