Random effects/animations
Randomly select an effect or animation every 5 minutes.
About this flow
| System | Domoticz |
|---|---|
| AWTRIX version | AWTRIX 3 |
| Topic | Miscellaneous |
| Built by | joro75 |
| File | GjKxAYL65mze.json · 2.0 KB |
| Icons | — |
| Published | 6 Jan 2025 · updated 6 Jan 2025 |
| Downloads | 23 |
Is this your flow?
If you created this flow, open your saved edit link to add it to your account. You can then manage it whenever you sign in. Adding it to your account replaces the edit link.
🏁 Purpose
Having some fun with different effects and animations on the AWTRIX3 clock.
🔄 Activation and Timing
This domoticz dzVents script is marked as active by active = true.
It executes every 5 minute as specified in the trigger section: timer = {'every 5 minutes'}.
⚙️ Script Logic
Every time the script is run, it randomly selects one of the available effects from the effects array.
That effect is then activated as a custom app on the AWTRIX3 unit, using a duration of 10 seconds. If auto transition is activated on the AWTRIX3 the random effect will be included in the loop with the other apps, changing it to another effect/animation every 5 minutes.
📝 Logging
- Logs are generated with the marker "AWTRIX3_Screensaver" to identify entries related to this script.
- The logging level is set to
domoticz.LOG_INFO, ensuring that informational messages are captured.
🎚️ Effects Adjustment
Undesired effects can be out-commented from the effects array by include a 'Lua' comment (' -- ') in front of the line.
✂️ Required plugins and more information:
- Domoticz: www.domoticz.com
- Domoticz AWTRIX3 Plugin: GitHub - Domoticz-AWTRIX3-Plugin
GjKxAYL65mze.json
return {
-- The script is active
active = true,
on = {
timer = {
'every 5 minutes'
}
},
-- Custom logging level for this script
logging = {
level = domoticz.LOG_INFO,
marker = "AWTRIX3_Screensaver"
},
-- Event execution when the timer triggers the script
execute = function(domoticz)
local function getRandomEffect()
-- Define the array of 10 strings
local effects = {
"Fade",
"MovingLine",
"BrickBreaker",
"PingPong",
"Radar",
"Checkerboard",
"Fireworks",
"PlasmaCloud",
"Ripple",
"Snake",
"Pacifica",
"TheaterChase",
"Plasma",
"Matrix",
"SwirlIn",
"SwirlOut",
"LookingEyes",
"TwinklingStars",
"ColorWaves"
}
-- Generate a random index between 1 and the length of the array
local randomIndex = math.random(#effects)
-- Return the string at the random index
return effects[randomIndex]
end
screensaverPage = {
appname = "screensaver",
effect = getRandomEffect(),
duration = 10
}
local pageJSON = domoticz.utils.toJSON(screensaverPage)
domoticz.log("Sending screensaver to AWTRIX3: " .. pageJSON, domoticz.LOG_INFO)
local appDevice = domoticz.devices('AWTRIX3 - Send Custom App')
if appDevice then
appDevice.setDescription(pageJSON)
appDevice.switchOn().afterSec(2)
else
domoticz.log("'AWTRIX3 - Send Custom App' device not found", domoticz.LOG_ERROR)
end
end
}
More flows for Domoticz or Miscellaneous
Something wrong with this flow? Report it.