Send notifications via Activities possible?

I’m pretty much using Reactor exclusively now - scenes are just not needed… except where sending a notification/alert is concerned. Am I correct in saying that you cannot send a notification to a Vera user from Activities directly? The only way I’ve worked out how to do this is by creating a manually triggered scene which sends an alert, and then call this scene from reactor.

Even Vera themselves create a scene for this. If you go in to the Notifications tab on a device, and set up a notification that way, it actually creates a scene with a “hidden” attribute that does the work. Otherwise, there is no way I can “stimulate” Luup to send a notification.

So… not perfect, but, you can go into the “Notifications” tab on a ReactorSensor and set a notification there. Vera then manages the hidden scene and you don’t have to.

Oh, I never thought of doing it that way. Thank you.

I use Prowl for this. I’m new to Reactor, but I’m sticking with Prowl for handling all sorts of notifications. Here’s one I just set up for when Vera reboots. Under the Activities tab of that Reactor sensor, I select Run Lua, and placed this in the code box:

– Inform me when Vera restarts.
luup.inet.wget(“https://prowl.weks.net/publicapi/add?apikey=1234567890&application=Vera&event=Alert&description=Vera+has+rebooted&priority=0”)
return true

@rigpapa - Sorry to resurrect this topic. I’m trying something which may not be supported…

I have a Reactor group which checks if a door is opened and when true, I call a (manually) triggered Vera scene which sends an alert to my phone. That’s all this scene does.

Reactor trips just fine (condition is true) and I have manually checked the scene in Vera to ensure the notification is sent, but I never receive the notification via this Reactor activity.

Maybe the problem is that the scene contains no actions as it’s just sending an alert?

Yes, you are correct. Reactor will run the scene itself, but is unable to send notifications. There are a couple of workarounds (choose one):

  1. If your Reactor uses its tripped/untripped state (root group) activity to run the scene for notification, you can set up the notification on your RS’s Notifications tab instead of making your own scene.
  2. A variant on the foregoing, you can run your existing scene by setting your RS as the scene’s trigger, rather than using a RunScene activity.
  3. You can set UseReactorScenes in your RS to 0, which will cause that RS to run any Vera scene using Vera’s native scene runner, at the cost of task survivability across reload/reboot.

I didn’t know about “UseReactorScenes”. Thanks.

I knew about your first two suggestions but the problem I have is that in my RS, I have many subgroups with their own notification requirements so triggering at the root level isn’t granular enough. I could break out the logic into separate RS’s but I was trying to reduce the number of them.

No biggie though and thanks for clarifying.

@sm2117, then UseReactorScenes is definitely the way to go for you. It lets you keep your groups, and the notifications via your Vera scenes, both.

If a change UseReactorScenes in my RS to 0 how can I then create a notification for a specific condition in the RS? I have 4 subgroups that should generate notifications when the condition is met.
Should I manually create a vera scene for each condition?
This situation was handled when using PLEG like this:
image
Maybe a similar implementation could be implemented in Reactor?

Vera does not provide a Luup API for generating a notification, but there are ways. You can either use one of the common external notification interfaces (Prowl, etc.), or you can use the Vera-native notifications (hidden scenes automatically created by Vera) triggered by a ReactorSensor’s overall tripped state by going to the “Notifications” tab of a ReactorSensor (this only works for overall tripped state, you cannot do it per condition group).

I’m using VeraAlerts, so I now created Vera scenes for each notification and just run the scenes from the specific condition in the Reactor sensor. It is not as elegant as the PLEG solution but it works.

I’ve been able to run VeraAlerts directly from the Reactor Activities as a Device Action.

I now have a development version of Reactor that has the ability to send notifications natively (on Vera, without additional plugins). Although Vera doesn’t have an API to initiate a notification, I figured something out that can work, I think, and you can even send multiple notifications per activity/group, each with different messages–much better than the single scene triggering.

If you would like to test this version, install the stable branch release of Reactor on Github:

  1. Go to the “Backup and Restore” tab on your current Reactor master device and take a backup! I also recommend that you download the backup file (link on that page) for safe keeping. Just in case.
  2. Go here for the Github stable branch: GitHub - toggledbits/Reactor at stable
  3. Click the green “Clone or download” button and choose “Download ZIP”
  4. Unzip the file.
  5. Open the Vera uploader at Apps > Develop apps > Luup files.
  6. Drag all of the unzipped files except the .md files to the “Upload” button/area. This will upload the files and then reload Luup.
  7. Do a hard refresh of your browser. Do not skip this step.

You will then find the “notify” action in the Activities of your ReactorSensors. If you don’t see it, either you didn’t install the correct version, or you didn’t hard refresh (the version number shown in the footer should be “3.4develop-19222”).

The first notification after configuration sometimes doesn’t make it out (Luup notices there’s been a reconfiguration of user_data–part of the setup for notifications–and sometimes does a restart, and this interrupts the first send before it completes. But after that, things seem to go pretty well so far in my testing. I’ll be curious to see what you all might come up with.

There are some other fixes and new features in this version. See the CHANGELOG.md file for more information.

1 Like

don know why vera just doesnt hire you

2 Likes

@rigpapa you are awesome! Thanks for this!!

hey in vera alerts is shows this

Well what do you know, that is right :smiley: This simplifies it a great deal. Thanks for the hint!
The only downside to this is that the notifications cannot be managed from VeraAlerts itself.

They may be. VeraAlerts extends the standard Vera notifications mechanism that uses hidden scenes; this is the same mechanism Reactor must use. VA’s extension is to add scene Lua that calls a VA action to do the notification its way.

Without going into a lot of technical detail, if you override the message in VA, that should work fine. The message in the ReactorSensor will not be used, because VA will always prefer its override, but if you are consistent and always edit your messages in VA, you should have no problems. I also may be able to detect VA and back-port any override message into the ReactorSensor.

VA also appears to keep its own list of recipients and does not use the fields provided on the hidden scene for that purpose. So if you change the recipients on the ReactorSensor, I’m not sure if VA picks that up without going into its editor with refreshed data, and if you change the recipients in VA, I can tell you for sure the ReactorSensor has no idea about that change. I can address the latter issue in the same way as the override message. It remains to be seen (via testing) what the impact of the former may be, and it could be that it will simply be an issue VA users will need to be aware of.

But it certainly appears that, right now today without any changes whatsoever, edits to recipients and messages done in VA should work perfectly fine, they just won’t be visible in your ReactorSensor, so you’ll see different data there. I’ll tinker with that, and make the RS messages appear as something other than “_notify” so you can tell what you’re actually looking at.

OK. I now have a version of the ReactorSensor activity editor that’s “VeraAlerts-aware”. It’s up in the stable branch on Github, and the install instructions are the same as in the previous instructions post. If you’re into the whole brevity thing, the only file you need to upload is J_ReactorSensor_UI7.js (but it doesn’t hurt to upload everything). Don’t forget to hard-refresh those browsers, folks!

IMPORTANT: For everyone who installed yestreday’s stable release whether you use VeraAlerts or not, please update to this newer release. I found a nasty little bug in the UI that will not cause any problems for your Vera, but may cause the activity editing UI some serious heartburn to your browser.

When everything is correctly installed, the version displayed in config editing footers is “3.4develop-19224”.

1 Like

Great stuff. Works a treat. Is there a way to send a value from a multistring or an expression within Reactor? I would like to send a daily message with my previous day’s power consumption. Also is there a message length limit?