I have a TKB TZ77 RGBW controller which is pretty rubbish to be honest. I don’t know if its the module itself or Vera’s control over it but its not great and has issues.
However I have created several Vera scenes that each change the colour of the connected LED RGBW strip.
I then found this code on the forum for randomising running scenes. So random colours in my case.
local scenes = {"172", "173", "174", "175", "176", "271", "272"}
local tmp_random_number = math.random(1,7)
local scene_id_to_launch = scenes[tmp_random_number]
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = scene_id_to_launch}, 0)
This code works fine and randomly runs my change colour scenes.
The LED strip has an On / Off schedule in PLEG.
“Schedule - Turns on the front garden LED lights every Friday Saturday Sunday after sunset +2 hours”
And I have an off schedule set for 00:30 am.
So whilst this LED strip is turned on according to its schedule, I’d like to run the above Lua code every 15 minutes to change the colour randomly.
I’m not sure how to set this up in PLEG. or via another scene with script.
In PLEG there are counters which I have never used or understood before. I can however create a new counter and start that counter when my turn on LED strip schedule is run.
Ordinal Counter:
Time Counter:
What is the value 161.47726893425? Using a Unix time convertor they are all 1st of Jan 1970. Yet the date is correct on my Vera unit when I SSH in and issue the “date” command. So not sure what time stamp that is meant to be on the counter in PLEG ?
But I am not sure about the PLEG Condition syntax to use to monitor that counter for when it reaches every 15 minutes. Counters are not covered in the PLEG basics user manual.
Any other ideas ?
Thanks.