-
Notifications
You must be signed in to change notification settings - Fork 1
Scripting
e1z0 edited this page Jun 18, 2025
·
1 revision
for i = 1, 50 do
Log("Script says count: " .. i)
end
function on_start()
SubscribeToMqtt("BlueIris/Camera/Status", "on_mqtt_message")
end
function on_mqtt_message(payload)
Notify("Camera","Person detected",5000)
Log("Received MQTT: " .. payload)
end
on_start()
-- Prevent script from exiting
while Running() do
Sleep(1000)
end
if Log ~= nil then
Log("Lua script finished cleanly.")
end
function on_start()
SubscribeToMqtt("anotherrtsp/testas1", "on_mqtt_message")
end
function on_mqtt_message(payload)
Notify("MQTT",payload,5000)
Log("Received MQTT: " .. payload)
end
on_start()
-- Prevent script from exiting
while Running() do
Sleep(1000)
end
if Log ~= nil then
Log:WriteLog("Lua script finished cleanly.")
end
function on_start2()
SubscribeToMqtt("anotherrtsp/testas2", "on_mqtt_message2")
end
function on_mqtt_message2(payload)
BalloonTip("MQTT",payload, "Info" ,5000)
Log("Received MQTT: " .. payload)
end
on_start2()
-- Prevent script from exiting
while Running() do
Sleep(1000)
end
if Log ~= nil then
Log:WriteLog("Lua script finished cleanly.")
end
function on_start()
SubscribeToMqtt("anotherrtsp/testas3", "on_mqtt_message")
end
function on_mqtt_message(payload)
Sound("battle1_")
end
on_start()
-- Prevent script from exiting
while Running() do
Sleep(1000)
end
if Log ~= nil then
Log("Lua script finished cleanly.")
end
function on_start()
SubscribeToMqtt("anotherrtsp/testas1", "notif")
SubscribeToMqtt("anotherrtsp/testas2", "bln")
SubscribeToMqtt("anotherrtsp/testas3", "snd")
end
function notif(payload)
Notify("MQTT",payload,5000)
Log("Received MQTT: " .. payload)
end
function bln(payload)
BalloonTip("MQTT",payload, "Info" ,5000)
Log("Received MQTT: " .. payload)
end
function snd(payload)
Sound("battle1_")
end
on_start()
-- Prevent script from exiting
while Running() do
Sleep(1000)
end
if Log ~= nil then
Log:WriteLog("Lua script finished cleanly.")
end