Drunkenstein alert webhook guide

What can the webhook do?

When an alert happens in Drunkenstein the webhook can trigger things like smarthome integration (speakers, voice assistant, lights etc), a Discord message, a phone notification, send a SMS, a phone call, an email, social messenge, a Slack message and such.

Where do I get, setup and connect a webhook to something?

Easiest and a free solution is probably Discord messages, as webhooks are directly integrated (There are many Youtube videos on Discord webhooks). Else you might have to use a service that can create and host the webhook, and then connect it to something else. These are services like IFTTT and zapier.com. Feel free to ask your IT friend (or research via youtube, chatgpt, google etc).

Discord examples - IFTTT examples

How?

For each alert you can set up a different webhook (or the same)

Simple request (GET)

Per default the webhook request will be a GET request. $msg$ will insert the alert message (urlecoded)

Example:
https://mywebhookservice.com/myuserid/drunkensteinalert?msg=$msg$

Advanced request (POST)

In the Url text input field in Drunkenstein you can insert a JSON object to represent a POST request like the follow.

Example (can be modified and copy/pasted to Drunkenstein Url text input field):

{
 "method": "post",
 "data": {"message":"$msg$","myuserid":"12345","event":"drunkensteinalert"},
 "headers": {"Authorization":"OAuth2: token"},
 "url": "https://mywebhookservice.com",
 "encode": "urlencoded"
}
Example explained: Tags that will be replaced (If part of the url they will also be urlencoded):

Discord webhook examples

You need to replace the "url" value (https://.....) with your Discord webhook url
Watch the first 50 seconds of the following YouTube video on how to create and get the Discord webhook "url" YouTube video
{
 "method": "post",
 "data": {"content":"$msg$"},
 "url": "https://discord.com/api/webhooks/abc123/abc123"
}
Another Discord example where more details are added like time, name, drinks, pace and time when sober
{
 "method": "post",
 "data": {"content":"$time$ - $name$: $msg$ (Drinks: $units$, Pace: $pace$, $paceinfo$, Sober: $sober$)"},
 "url": "https://discord.com/api/webhooks/abc123/abc123"
}

Examples screenshot from Discord, using a standard alert and also the broadcast alert type

IFTTT webhook examples

Follow this link to see IFTTT examples.

Notes

If in demand I'll add some more detailed guides/videos here on the precise setup with some specific services. Alternatively I might also implement an easier solution myself not requiring webhooks, but that would probably have to cost some service fee for running such a setup.

Ehh what?

All this might sound too complex, so ask an IT friend for help if needed (perhaps offer a beer for helping).


back to drunkenstein.com