Created
February 29, 2020 21:49
-
-
Save Kagee/bdbc89d0c548116bbccab835bf6e810a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ii -s irc.homelien.no -n botname -i ./irc | |
echo "/join #some_channel" > irc/irc.homelien.no/in | |
tail -n 0 -f irc/irc.homelien.no/#some_channel/out | stdbuf -oL -eL grep -v -- '-!-' | sed -u -r -e 's/(")//g' -e "s/(')//g" -e 's/.*<([^>]*)>\s(.*)/{ "nick":"\1", "msg":"\2" }/' | while read D; do echo "$D"; curl | |
--header "Content-Type: application/json" --request POST --data "$D" https://home-assistant:8123/api/webhook/irc_tts; done | |
home-assistant/config/automations.yaml: | |
- id: 'irc-tts' | |
alias: Talking irc | |
description: 'Talking #irc (desc)' | |
trigger: | |
- platform: webhook | |
webhook_id: irc_tts | |
action: | |
- service: tts.google_cloud_say_no | |
data: | |
entity_id: media_player.livingroom | |
data_template: | |
message: > | |
{{ trigger.json.nick }} sa {{ trigger.json.msg }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment