Slack Notifications for Hubitat
I was looking to get notifications set up for our office, and didn't want to make people install a newfangled app. We use slack by default, so I (very quickly) threw this together. It's one-way only. No verification or anything fancy.
As you can see, it's being used very importantly right now:
Without further ado, I give you the Slack notifications driver!
Instructions (click to expand each step):
Step 1: Install the Device Driver
Copy and paste this link for direct driver code import.
Github repository:
hubitat/slackNotifier.groovy at master · adamkempenich/hubitat · GitHub
Step 2: Create Your Slack Notifier in Hubitat
- Go to Devices.
- Click "Add Virtual Device"
- Name your device, and select "Slack Notifier" for your device type (the list in the bottom right)
- Hit save, and open your new Slack Notifier device page. Open a new tab for the next steps.
Step 3: Create Your Slack App
- Log in, and create a new Slack App here
- Under Basic Information > Add Features and Functionality, select Incoming Webhooks.
- Create a new webhook URL at the bottom of the page and select the channel you'd like for notifications. Click Copy, once you've created your URL.
Step 4: Copy your URL into your device Preferences
- Take the URL you copied prior from Slack, and paste it into the * URL to Slack Hook * preference in your Hubitat Slack Notifier device page.
DO NOT SHARE THIS URL. ANYONE WITH THIS URL CAN USE IT TO POST TO YOUR SLACK
2. Click save, and send a test notification! Everything should work smoothly.
That's all there is to it. Honestly, I spent more time writing this post than the driver, so there's definitely work to be done.
Let me know if you're using it, where you'd like to see it go, and if you encounter any issues!
9 Likes
Brand new to HE and I gotta say this is all awesome. I love that a quick little driver can be written. Any clue how I can use this instead of text alerts for security?
2 Likes
Any chance of adding blocks support to it?
By "security", you mean Hubitat Security Manager?
Sure! As @corerootedxb said—what are you using for security? I use it with a lot of apps at our office.
Let me dig into this a bit more
1 Like
Yes... I mean the Hubitat Safety Monitor. Sorry-- still learning the nomenclature.
I guess what I'm really wondering (and this is probably an HE question in general) is I with all the built-in apps there is always a way of sending a text or audio. Is there a way to extended the notification class to include things like this slacker notification? I guess I just assumed that when you created something with notification capabilities it would then be available where notifications happened...
In other words... I still haven't figured out how to use this slacker things...
I think that would be a great feature. I’m just using the built-in notification methods, but that would be a feature you’d have to request from staff. I don’t personally use HSM, but I can play around with it later this week and see if I’m doing something wrong.
So I feel really stupid for asking this then... how do you use this slacker notification?
I just tested it with HSM. Works fine
Under your HSM Alerts section, open Text Alerts, and at the top, there is a section: “Send notification to device(s)?”. Click on that and select your slack notifier device.
Duh... I was an idiot. I saw all the places to enter your number and just assumed. Sorry.
I must be missing something here. I don't see where the driver is??
You need to add the driver manually following the directions at the beginning of the post.
1 Like
With the steps collapsed I didn't recognize it as a link. All good now.
2 Likes
Sorry! I’ll add revamping my release pages to my task list—didn’t mean to obfuscate the download link
I just didn't recognize it. I quite like the look. It cleans up the listing and make is easier to scroll through.
I can't tell you how often we had extensive meetings on how people were going to find their way around a website in 1992-3 when we talked to new clients.
I agree with @zarthan. It's nice and clean. Maybe just a quick parenthesis calling it out?
Instructions (please expand for each step)
2 Likes
Perfect. I think I may just start over again so I can follow the updated listing.
It was pretty easy to get this up and going. I have not used Slack before but it looks interesting.
2 Likes