Page 1 of 1

kill lamps that "turn on a event" off with a "masterswitch"

Posted: Monday 11 March 2019 21:57
by TankySpanky
Hello all,

I have tried to search the forum and the internet, but cant really find the solution for my problem.
Seen some simular things but they didnt help me.

I have a blocky script that turns on lights at sunset, till 23.00 hours
But if i wanna go to bed sooner i created a "naar bed" switch that should override the rest

But when i say to google home "turn on naar bed" then all lights go out. (that should happen)
And in about a minute the tv lights jumps on again,(and because tv lamps are on also other lamps jump on in the room)

"Naar bed" switch is still "on" but get ignored ??

Im new to this all and try to find all myself but im stuck here

ty in advance

Re: kill lamps that "turn on a event" off with a "masterswitch"

Posted: Tuesday 12 March 2019 15:27
by Seagate
Hi!
You could add ' And "Naar bed" ≠ "On" ' to the conditions for each day. (I would also add ' And "TV Lampen" ≠ "On" ' to each of them, because in the current situation the lamps receive a lot of switch on commands even if they are already on.)

But why use a blockly script for this? Is it not more easy to use the timer option of the 'TV Lampen' switch for this? There you can set timers for each day, to switch the lights at a certain time or at sunset/sunrise. You could even set an offset. E.g. Switch on the lights 30 minutes before sunset.
In that case you only need the blockly for the lower part (and you don't even need blockly for that if you use scenes with 'Naar bed' and 'Masterswitch')

Re: kill lamps that "turn on a event" off with a "masterswitch"

Posted: Tuesday 12 March 2019 18:07
by mrf68
These are all “else/if” statements. So if the first one does not return “true” it will check the second and so on. So you can turn the lights off, but when it is still Monday, after sunset and before 23:00h, it will turn on the lights again. And because “Naar bed” is not changing its state, this will not trigger the Turn off action.

I am not a fan of else/if structures, because it looks easy, but you need to specify everything it should take into account. So with that Monday thing, it should also check if the Naar bed is Off and only if that is true turn on the lights.

But again, it ismeasier to understand what is happening if you start small. Create a time based blockly: if time = sunset then turn on lights. Create a new one device changed based: if Naar bed is on, then turn off lights.

Re: kill lamps that "turn on a event" off with a "masterswitch"

Posted: Wednesday 13 March 2019 17:28
by TankySpanky
ooo yeah now i see it :)
thanx both for the explanation, im a lot smarter now :) hehe

back to timers and small blockys

Aad

Re: kill lamps that "turn on a event" off with a "masterswitch"

Posted: Wednesday 13 March 2019 17:44
by TankySpanky
I created something like this for a "workday" lamp to turn on in the living now,
Much much shorten then a week "plan" in blocky :)


Actief Type Datum Tijd Willekeur Commando Dagen
Ja Op Tijd 05:00 Nee Aan Door de week
Ja Op Tijd 05:40 Nee Uit Door de week

On time on and off :)
I shall also check the scene options ( maybe for more lights at once in the living room )

You both helped really a lot :)