Virtual Switch for Day vs Night

I have truly enjoyed UI5 and the many new plug-ins. I have numerous virtual switches used in establishing global states, eg home vs away. A virtual switch which would simply toggle for day vs night would be very helpful. Now I do this with scenes and schedules, but if Vera is busy at the time of sunset or sunrise, it seems my scene will not trigger the virtual switch.

I belive there is a day or night variable somewhere in the code based on the header in UI4. This in a virtual switch would be great.

Keep up the great work with plug-is.

Combination Switch + Heliotrope will do this. Use the condition “Altitude in range 0 … 90”.

That is so cool. Will be testing shortly. Thank you.

The Day or Night plugin is now available.

It works great. Thank you.

Great add a review …

Someone added a negative review because they did not set the Location and/or the Timezone on their Vera …

As a result it appeared to not work.

Will be happy to.

Hi,

I am a total noob here. How do I use the plugin to turn on certain lights at dusk or is this not what its for?

The Day or Night plugin can be used for:

[ul][li]Triggers for a Scene.[/li]
[li]Triggers for Countdown Timer plugin.[/li]
[li]Triggers for Combination plugin.[/li]
[li]Input Trigger for Program Logic Event Generator plugin.[/li]
[li]Input Trigger for Program Logic Timer Switch plugin.[/li][/ul]

By making it a virtual switch … you can test your Night Time vs Day Time logic for all of the above.
[hr]
The latter two plugins were developed by me, and motivated this development.

so if I wanted to turn on several lights, I create a scene by first selecting the switches I want to turn on and then select this device for a trigger? I’m a total noob with creating scenes as well

so if I wanted to turn on several lights, I create a scene by first selecting the switches I want to turn on and then select this device for a trigger?

That’s correct.
[hr]
The problem with a Scene … is that any trigger for the scene will cause the scene to activate.
Say you wanted the Scene to run at night, but only when a motion detector was triggered.

You need to use LUUP code with a scene.
[hr]
If you use PLEG …
You would create two input triggers:
Motion - When Your Motion Device is Tripped
Night - When Day or Night Indicates Night
You would create a condition
LightsOn = Motion and Night
Then you would create an action (same as adding devices to a scene) for condition:
LightsON - Specify the set of lights to turn on.

The neat thing is that if you want to add a auto turn off to the above.
Just add another condition:
LightsOff = LightsOn; Now > 30:00
Then create another action for the condition:
LightsOff = Specify the set of lights to turn off.

Thanks Richard.

I have no idea of what you are talking about :slight_smile:

If I can get a scene to work, I will be happy.

I haven’t passed basic programming 101 yet :slight_smile: