[Release] Join Api Notification Driver

community_driver

#21

Quick Guide: Creating Actionable Notifications that run Tasks in Tasker

This is NOT a comprehensive tutorial on the options available between Join and Tasker. That would require a small book. This is how I connected my Join notification to my already created Tasks. This assumes at least basic familiarity with creating tasks and profiles in Tasker.

I have a task that I use to connect my phone to my home network via Vpn. A lot of times I get a notification that alerts me of something in my home and I then need to connect to my Vpn in order to view my Grafana graphs or the HE admin page. Having an actionable link in the notification itself is very convenient. Here's how I set it up. My existing task is call "Home Vpn"

  1. Create a profile in Tasker that can process incoming commands from Join (and any other AutoApp) and use them to run Tasks.
  • Create profile using the AutoApps Command event:

  • Configure a command filter. I use "task" as my prefix but you can use any variable you like.

Once configured it will display the variables below that you can use for various things. We will only need the %aacomm for this scenario

  • Once the event has been configured Tasker will prompt you to associate with a task. Choose the New Task option and create a "Perform Task" as below

  1. Create a Join action that sends the command to Tasker.

  • Create a custom actions as follows

The above "Vpn" action will run my "Home Vpn" task when called. However, you can replace "Home Vpn" with the name of any task you have created in Tasker.

  1. Last but not least, Add the "Vpn" task to my Join notification via HE.
  • simply list the action you would like in the action section of the driver (multiple actions can be added..separated by commas). This screenshot would add my Grafana, Restart Hub and Vpn actions as actionable links in my notification.

Which produces

The following are useful links/tutorials:


#22

Update 6/11/19:
v1.0.20190611a

  • fixed sms bug
  • added Notification Icon (if Status Bar icon is not set, this will set the image to both notification and status bar icon)

#23

@cwwilson08 - requested changes have been posted to github :point_up_2:


#24

Is there a way to pass icon and sound URLs alongside with the category in each message? Otherwise I would need to create multiple Join 'devices' to categorize messages. And that doesn't sit well with webCore, which doesn't allow to choose a specific device to send notification to.


#25

Different combinations have different effects depending on what you want to do. I use the Join Api (linked in OP) to test any variation before setting it up in the driver. The driver simply talks to the Api so if it doesn't work there, it won't work in the driver. All the inputs are "passed" to the Api and it determines how the notification is built.

The icon and category should work together. I really can't say how the sound url works because I don't use it. I use the category to determine how the notification plays on my phone.

That being said, please let me know specifically what you are trying to accomplish because I can be a bit dense sonetimes and it's not clear to me in your post above. I don't use webCore with HE so I don't understand the limitation you are describing.


#26

What do you mean WebCoRE doesn't allow you to choose different devices to send a notification to? All you have to do is select the device and then the command "Device Notification". It works just fine.


#27

I think the question is, can URL for icon / sound and category be set up when setting up the Join API device, or can you format the message and pass it to a Join API device. From the message description I don't see an option to pass an icon URL for example.

messageTextHere[A]action1,action2,action3...[D]device1,device2,device3[T]title[C]category[S]phone#


#28

yes, but it's going to be a global device for all Location/Send notification or Location/Send PUSH Notification to.
I don't see an option in a webCore PISTON (not webCore config) to specify Location/Send notification to (in which case device would be a pre-defined join api device with its own icon / sound / category.


#29

No it won't. You can't use the location "send push notification" command in HE. At least I never have. You have to select the actual device and then the command Device Notification. Don't use Location as your device. It is a lot simpler than you are making it out to be.

Even if you wanted to send a push notification to your mobile phone, you would have to select that device and then the command Device Notification. There is no requirement that someone have a mobile app installed in HE so it doesn't have the same architecture as ST (which is what webcore was built for).


#30

Interesting, I'll need to check that. Send PUSH notification works fine for me, however the only reason i use it cause I basically moved all pistons from ST and that's what I used there.

So if that's the case I am fine with creating multiple Join API devices, like Security, Lights, Misc etc, giving them diff icons, categories and all that.


#31

All the driver inputs will be used by default...unless you include the inline shorcuts ([A], [C], etc). The inline shorcuts will override what is in their respective input.

For example, if you set you driver up with the follwing inputs
icon = myIcon.png
title = my tile here
category = low

and then also setup the follwowing message:
my message goes here [C]high

Then your message will be sent with the icon and title specified in the inputs but you category will be "high" (because you chose to override it with the inline [C]).

Make sense?


#32

That is what I have done. I have 5 of them.


#33

@stephack he is asking if you can add the option to define them in the custom commands I think.

Which short answer is currently no.


#34

right, but which square-bracketed parameter stands for icon URL and which for sound URL?

I see [A] action [D] device [T] title [C] category [S] phone


#35

That is not an option.
Do you plan on changing the icon depending on the message being sent? If you are using the same icon every time, then you would just set it up in the inputs. Otherwise...yes you would need to create a separate Join device for every message that would require it's own separate icon.


#36

ok, separate devices it is, thanks!


#37

I'm just using the hubitat icon for all of my devices. That way I see it on my phone easier.


#38

That's an option of course, and I am not shooting for a sleuth of icons, but I definitely want to easily recognize security messages from others, like lights, misc, etc.


#39

Same here. I only have different icon for the different systems sending me notifications. One for Hubitat and one for NodeRed. I didnt anticipate anyone needing a custom icon for every message.


#40

I do this using the "category" option and using different ringtones depending on the severity of the notification.