Turning lights randomly on and off

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
MarkMills
Starting Member
Starting Member
Posts: 2
Joined: Fri Feb 22, 2013 7:32 pm

Turning lights randomly on and off

Post by MarkMills »

Hello,
I'm new to Domotiga and have spent just a couple of weeks trying to get my setup working as I want.
One of my aims is to set up a wall switch that I press on leaving the house which turns on some of the lights randomly when it gets dark. And stopping this action at midnight or so. Simulating someone in the house.
I'm OK with the switch and the activation when dark and turning off at midnight. But I'm not sure how to get a random loop on the lights operation. I thought, originally, that I would just add several light on, random delay, light off random delay events but this is not scalable and cumbersome.
Has anyone got any better ways of doing this? I would appreciate any tips or clues.
Best regards
Mark
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Turning lights randomly on and off

Post by RDNZL »

There is a hidden feature (well one of the many) that does exactly what you want!
If you set GlobalVar Simulation = "On" (you can do this from event action on the button) then all switch- and dimmable devices who are member of group 'Simulation' and have log option enabled are controlled with the logged data from 7 days back.
The code is in EventLoop.module if you want to see it.
Regards, Ron.
MarkMills
Starting Member
Starting Member
Posts: 2
Joined: Fri Feb 22, 2013 7:32 pm

Re: Turning lights randomly on and off

Post by MarkMills »

Ah, I see now. I had seen the Simulation idea but had dismissed it as I hadn't appreciated I could activate it remotely.
Now I just need to stop messing about with my lights for 7 days and get a sensible log file to replay.
Thank you Ron.
Regards
Mark
User avatar
Harry
Member
Member
Posts: 329
Joined: Mon Apr 10, 2006 1:43 am
Location: Drachten

Re: Turning lights randomly on and off

Post by Harry »

not sure how to get this feature working, are there more detaled how too's how i can get this working
User avatar
RDNZL
Forum Moderator
Forum Moderator
Posts: 1008
Joined: Sun Sep 24, 2006 1:45 pm
Location: Dordrecht, The Netherlands
Contact:

Re: Turning lights randomly on and off

Post by RDNZL »

Create device group called "Simulation", add devices to this group you would like to participate in this random behaviour, and enabled logging to database for these devices. (a week in advance of use)
Create globalvar called "Simulation" and set it to True to enable this, to False to disable again.

When enabled it will replay the states of those devices exactly like it was a week ago.
Regards, Ron.
Post Reply

Return to “DomotiGa Forum”