Needed - an app to display multiple alerts in a common dashboard tile

I'm wondering if anyone has developed or is aware of an app/driver that can display multiple alerts on a dashboard tile? In order to do this I'm having to use multiple rules and variables. It works but it's very clunky and a bit of a mess on to add additional alerts to. To explain what I'm looking for, it might be easier to explain/show what I've done to achieve it with Rule Machine. This was also discussed in another post when I first set this up:

  1. For each alert that I want to display I have an individual rule and a global variable. When the rule is triggered, it populates it's global variable with %time% - %alert_goes_here%. When the condition is cleared the variable is set to null in the rule. I have a number of these rules - one for each alert (put the bins out, washing complete, dishwasher complete, get outta here the house is on fire etc). All of these alert rules also run the actions from a second rule, both when the alert condition activates and when it clears....

  2. The second rule (with no triggers) has conditions to check each of the variables. If any string is populated with anything, it sets another global variable (notificationLive) to true, otherwise it sets it to false.

  3. A third rule is triggered by the notificationLive variable above changing. When true it looks at each variable from the individual rules in step 1 and if there's a string in that variable it populates ANOTHER variable (notificationActive) with the contents, waits a few seconds and moves on to the next.

The end result that I have a dashboard tile that remains blank until one or more event rule triggers. Then it scrolls through each alert continually and doesn't clear until there are no active events.

What would be great, would be an app or maybe device driver that handled this, so that I only needed my individual rules for the alerts and could send that alert to another device for display rather than messing around with so many rules and variables.

One of my alert rules:

The second rule that checks the variables ('Notification - Enable')

And finally the rule that populates my variable tile on the dash:

What about something like @sburke781 ’s Status Avatar: [RELEASE] Status Avatar

3 Likes

My avatar driver that @mattias mentioned could certainly be part of a solution. It depends on whether you want the notification text to always visible on the dashboard or to have an indicator that there are notifications through something like an avatar image, then for the user to click on that image to display them, like notifications here in the Community. I can't remember if I ever really got a pop-up dashboard properly working when clicking on a notification dot, or just an external link... It could be something I could look at doing if you are interested.

The display of the rolling text is definitely possible. My go to would be outputting the text to a file and then using an html file to display the text as an iFrame in a tile. I did something similar with a prototype of an EPG tile here. There are also examples on the CSS thread for scrolling text on a tile here.

In terms of the logic, that's probably a hard one to wrap up neatly in an app, but the retention of notifications until they have been actioned / dismissed or some other logic deems them obsolete, that is something I have been interested in for a while, and am not sure I have seen something like that yet. Can't commit to building it, I have enough half finished projects at the moment :slight_smile: Although, I would probably derail it slightly by wanting to extend it to dismissing notifications sent to my phone as well.... Using Tasker.

1 Like

Thanks for the info. What I'm doing at the moment with RM is to have any active alert permanently displayed until it clears and if there is more than one alert (generated by my individual rules) it switches between them very few seconds. When all are clear the tile goes blank (as the variable gets set to null). In order for the notification to clear - the rule that generated it in the first instance will set it's associated variable to null, rerun the actions in the second rule, which will then set the variable on the dash to null. It's important the way I've done this that each rule successfully clears when the condition ends as I've no means to clear it manually other than mess around with the variables (I'll probably have to write another rule with a virtual button trigger to set all variables to null and reset booleans where necessary!). For instance - I've just got in and the Dishwasher Program Complete triggered:

That rule will set its variable back to null when I open the door to empty it (no more telling my wife I didn't realise it was finished)

I know a lot of HE users aren't particularly fussed about dashboard control, but I quite like them for an at a glance display of device status and something like this to bring attention to anything needing to be actioned is useful.

2 Likes

@johnwill1 - I don't suppose you've made any progress on this? I'm a very basic user compared to you guys - but I've been trying to figure out a solution to the exact same question as you....how to display multiple alerts on a dashboard tile..... my only additional complication is that I'm using a sharp tools dashboard, so I'm trying to figure out a way to pull it all together!

I haven't. I'm still using multiple RM rules as detailed in the top post. It works but it's a PITA. I'm surprised that something (an app or means to do this via rule machine) isn't available. I'd imagine it would be very useful to many.

One thing that may make it a bit easier is the notification tile driver. You can create a virtual device and use that driver, then from any rule you can display a message on the tile. It can only show a single message though. I notice that in the current states for the device it can store the last 5 to 20 events. I'm not sure whether there's a way that history could be used and cycled through, as there would need to be some way to clear the tile/switch completely when no event was active (to prevent a rule from continuously processing). You would use a rule per alert to send the alert to that one common notification tile device.

@thebearmay - is there any way you can think of that your notification tile driver could be used for multiple events, either in its own tile or using the paste events to cycle using another variable? It seems like it might be something that could be used.

In essence what we/I'm trying to do, is have multiple individual rules send a message (once on an alert going active) to a single instance of your notification tile driver. That tile device (or another linked hub variable maybe) would cycle the '%time% - this is my alert' messages from the individual events. Some means to cancel the individual messages is needed though, either by sending something from the triggering rule or after a certain period of time maybe, so that the tile goes blank or switches to 'No Alerts Active'

FYI - Apologies, I'm full of great ideas but just don't have the skills to implement them (IE my idea/cry for help/suggestion that led to your 'Daily Reminder' driver :laughing:)

The driver is set up to hold 1 to 20 (respecting the 1024 character tile limit) messages and automatically puts them on the top of the stack and pushes off the bottom of the stack. Easy to add a clear command if you need it.

1 Like

Actually looks like the Configure command will clear the tile.

What I'm trying to do is replace the mess of rules I have at the moment, but get a similar end result to what I've got working.

The starting point is an empty tile on the dashboard. When one of my RM rules for something I need a warning for (or just a notification) triggers, it writes to a variable that displays within a tile. If a second, third, fourth rule create a warning, the variable tile will switch to display each individual alert in sequence continuously - message 1 (3 seconds pause), message 2 (3 second pause), message 3 (3 second pause) and so on in a continuous loop. As each rule clears it's own variable (example - the laundry rule that creates '15:37 - Wash Cycle Complete' will empty its string variable when I open the washer door for more than 10 seconds), that particular alert will no longer display in the sequence. When all alerts have cleared, the tile is empty again. What I have works but is overly complicated/not scalable for more than a few different alerts.

It might be that the only way I can do it is to have each rule update the same instance of Notification Tile Device and put repeat while active in each rule. The two problems there are:

1 - With more than 1 rule active, each will update the tile and they won't sequence cleanly - it could be messy with multiple rules all trying to update the tile at the same time.

2 - When I tried to do everything in the rules at the top of this page originally with a single hub variable, I had an issue using %time% - as the time displayed was the time the variable updated, rather than the time the original event occurred (as it updates continuously it basically showed the current time)

I could make the Notification Tile do something close to that but it would be better/cleaner to write something a little more specific for the use case. How many messages are you thinking would be active at a time?

1 Like

I imagine that even as I add rules that will create alerts it would be unlikely unlikely to have more than 5 ever active at the same time. If my wife comes home and the tile is cycling "Wash Cycle Complete", "Dishwasher Complete", "Put the bins out" - I'm in for some serious grief :face_with_hand_over_mouth:

I suppose it boils down to what other users would find useful, but for me I'd never exceed 5.

Sharptools has you covered for this. Check out the "supertile" function, it's ace.

@djh_wolf - Unfortunately a SuperTile won’t do what I’ve described. It’s a means to create a single tile with multiple devices and/or multiple device attributes. I use them on all of my dashboards to combine multiple ’things’. Someone did do something similar for multiple doors open in SharpTools but that used their Rule Machine and was as awkward and clunky to create as what I’ve already done in Hubitat. I’m a heavy SharpTools user but want to keep this within Hubitat so that it could be used locally or on any dashboard.

What we are looking for is a single target device tile (or variable) for unconnected RM rules. It needs to enable a single tile to display an alert while active and sequence through them when there are more than one.

So far as I’m aware there is currently no Hubitat or a community device app that will do this easily (though my awfully unmaintainable RM rules do)

Yeah but why introduce cloud stuff when you don't have to?

I made it open ended...

https://raw.githubusercontent.com/thebearmay/hubitat/main/msgRotate.groovy

Default cycle time is 3 seconds, but can be changed with a preference. If debug is turned on it will turn itself off after 30 minutes. Messages will be cycled into the html parameter, which can be displayed on the dashboard using an attribute tile template.

The commands for the device will be under custom commands for RM, device capability Actuator

Commands
addMessage(String messageID, String messageContents)
Used to add or modify a message string

The addMessage command takes 2 parameters:
messageID - short identifier for the message (no special characters)
messageContents - actual message you want the device to serve up

To modify a message use the same messageID as the message previously entered and put the new content in the messageContents parameter

remMessage(String messageID)
Used to delete a message from the list

remMessage requires one parameter
messageID - the ID of the message to be deleted (no special characters)

clearAll()
Removes all messages from the list

5 Likes

:smiley: Thanks - I'll give it a whirl

1 Like

Very nice! Tried it out with my Hubitat Dashboard for Android and looks like it will suit my needs perfectly. However it seems that using 'Rem Message' (using the button from the device page) with any single message ID clears them all. I was thinking it would delete the one specified from the rotation.

1 Like

Should only clear the one, let me look to see what I typoed after testing that piece.

2 Likes

Was just about to post the same issue. Just playing with it in the device page currently.

Think I've fixed it.... v0.0.2

1 Like

Download the Hubitat app