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
kill lamps that "turn on a event" off with a "masterswitch"
Moderator: leecollings
-
- Posts: 43
- Joined: Wednesday 06 February 2019 18:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Belgium
- Contact:
kill lamps that "turn on a event" off with a "masterswitch"
- Attachments
-
- Blocky naar bed switch.png (60.76 KiB) Viewed 821 times
Raspberry Pi 3 B+ & Domoticz Beta & Dashticz Beta = Headache :)
But it keeps you van the straat
But it keeps you van the straat
Re: kill lamps that "turn on a event" off with a "masterswitch"
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')
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"
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.
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.
-
- Posts: 43
- Joined: Wednesday 06 February 2019 18:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Belgium
- Contact:
Re: kill lamps that "turn on a event" off with a "masterswitch"
ooo yeah now i see it
thanx both for the explanation, im a lot smarter now
hehe
back to timers and small blockys
Aad

thanx both for the explanation, im a lot smarter now

back to timers and small blockys
Aad
Raspberry Pi 3 B+ & Domoticz Beta & Dashticz Beta = Headache :)
But it keeps you van the straat
But it keeps you van the straat
-
- Posts: 43
- Joined: Wednesday 06 February 2019 18:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Belgium
- Contact:
Re: kill lamps that "turn on a event" off with a "masterswitch"
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
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

Raspberry Pi 3 B+ & Domoticz Beta & Dashticz Beta = Headache :)
But it keeps you van the straat
But it keeps you van the straat
Who is online
Users browsing this forum: Amazon [Bot] and 1 guest