Converted presence notification into lua callback

This commit is contained in:
2025-08-31 00:54:15 +02:00
parent 2d9e3d26f2
commit 6c9d2c16c1
3 changed files with 27 additions and 37 deletions

View File

@@ -39,6 +39,25 @@ automation.device_manager:add(Presence.new({
topic = mqtt_automation("presence/+/#"),
client = mqtt_client,
event_channel = automation.device_manager:event_channel(),
callback = function(_, presence)
ntfy:send_notification({
title = "Presence",
message = presence and "Home" or "Away",
tags = { "house" },
priority = "low",
actions = {
{
action = "broadcast",
extras = {
cmd = "presence",
state = presence and "0" or "1",
},
label = presence and "Set away" or "Set home",
clear = true,
},
},
})
end,
}))
automation.device_manager:add(DebugBridge.new({