antonengelhardt / kicktipp-bot

A bot which can submit tips for a Kicktipp competition based on quotes.
MIT License
14 stars 5 forks source link

Notifications to generic webhook (e.g. Homeassistant) #36

Closed DenisMir closed 3 weeks ago

DenisMir commented 4 weeks ago

It would be nice if you could add notifications to a generic POST webhook. For example homeassistant allows to generate webhook URLs that you can POST generic data to. (e.g. JSON data) The notification itself is done inside HA with a custom automation that you do not have to take care off. Just post the notification data to the webhook URL.

antonengelhardt commented 4 weeks ago

Hey @DenisMir,

thanks for the idea!

I have opened a PR. Can you test and let me know if this works for you? I dont have HA, so i cannot test.

DenisMir commented 3 weeks ago

Hey @antonengelhardt. Yeah for sure I will test it and get back to you here. The first thing I would change is naming the whole env var etc more generic since the webhook call is not limited to homeassistant. A lot of other systems do have this generic webhook pattern. (like TYPO3 etc.)

DenisMir commented 3 weeks ago

Das ganze funktioniert auf jeden Fall. 👍

Bildschirmfoto 2024-08-25 um 10 10 12 Bildschirmfoto 2024-08-25 um 10 16 29

Die Daten kommen sauber als JSON an. Ich habe mir nur keine große Mühe gegeben sie jetzt sauber auszuwerten.

antonengelhardt commented 3 weeks ago

@DenisMir awesome! Great to hear. I'll make the environment variable generic and the rest too.

Might take some time as I am on vacation right now and I am trying to get less screen time :)

LG!

DenisMir commented 3 weeks ago

Perfect. Enjoy your holiday. 😊

antonengelhardt commented 3 weeks ago

PR is updated @DenisMir