From 2263d6475ab7d37dbc20476fa61073471624da17 Mon Sep 17 00:00:00 2001 From: krisibe Date: Thu, 15 Aug 2024 23:16:54 +0200 Subject: [PATCH] doorbell sound --- index.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.mjs b/index.mjs index 78d7781..f62c4f4 100644 --- a/index.mjs +++ b/index.mjs @@ -59,7 +59,14 @@ async function handleCommand(roomId, event) { const text = event["content"]["body"]; if (!text) return; - console.log(text); + if (["doorbell", "open", "ring", "knock", "ding", "dong", "dingdong"].includes(text)) { + fetch('https://homeassistant.pvv.ntnu.no:8123/api/webhook/doorbell-oRkXU_ZUFzkc4wTtc6_m9PFR', { + method: 'POST', + headers: { + 'Content-Type' : 'application/json' + }, + }) + } var tags = [];