[SOLVED] Noob question: how to switch lights after powefailure

Moderator: leecollings

Post Reply
User avatar
Sjonnie2017
Posts: 365
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

[SOLVED] Noob question: how to switch lights after powefailure

Post by Sjonnie2017 »

Hi All,

I wanted to create a Blockly to switch of all ZiBee lights after a power failure or a brown-out. As it happens all my ZigBee devices turn on after a power failure which is a nuisance when I am not at home.

I created the following Blockly:

Image

EDIT: Changing the "or" to "and" made the blockly work :)

It works (or I think it does) when the sun has not set. Unfortunately the script switches of the lights even if the sun is set :shock:

Any help greatly appreciated :)

Greetz,

Sjonnie
Last edited by Sjonnie2017 on Thursday 20 February 2020 18:10, edited 1 time in total.
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
kuifje
Posts: 36
Joined: Wednesday 25 October 2017 16:38
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Heemskerk
Contact:

Re: Noob question: how to switch lights after powefailure

Post by kuifje »

Sjonnie,

If there is a sunrise there will be no sunset at the same time.
When there is a sunrise you need to connect a timestamp or a user variable to this action. This way no action will take place after sunrise.
For example: if sunrise and time is >7:00 and user variable sunrise =0 set user variable =1 and lights off. if then sunset and time = 23:00 and user variable =1 set user variable=0
I hope this gets you in the right direction and correct me if i am wrong with this example.

Kuifje
User avatar
Sjonnie2017
Posts: 365
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Noob question: how to switch lights after powefailure

Post by Sjonnie2017 »

Hi,

Thanks for your support. I changed the blockly a bit different than you suggested after reading some other completely unrelated thread. I changed it to:

Time > Sunrise and Time < Sunset and Plafond Haard is on

It is now well after sunset and I turned on the specified light. All other lights stay on now. Will have to wait till tomorrow to test is the blockly works when the sun has risen or set. Let's see what happens :)

EDIT: The thread/post I was referring to: https://www.domoticz.com/forum/viewtopi ... 09#p231492
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
mrf68

Re: Noob question: how to switch lights after powefailure

Post by mrf68 »

Because of the “or” between sunrise and sunset, this will always be true. When it’s 23:00h, it’s not < sunset, but it is certainly > sunrise. When it’s 03:45h, it’s not > sunrise, but definitely < sunset. So, if I’m correct, this will always switch the scene when Plafond Haard is turned on.
User avatar
Sjonnie2017
Posts: 365
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Noob question: how to switch lights after powefailure

Post by Sjonnie2017 »

mrf68 wrote: Tuesday 18 February 2020 10:07 Because of the “or” between sunrise and sunset, this will always be true. When it’s 23:00h, it’s not < sunset, but it is certainly > sunrise. When it’s 03:45h, it’s not > sunrise, but definitely < sunset. So, if I’m correct, this will always switch the scene when Plafond Haard is turned on.
You are right :) That's why I changed the "or" to "and". I noticed this change made the lights stay on after sunset (as they were supposed to) and I planned to test today before sunset. Unfortunately I was literally 5 minutes too late :oops: Testing will be tomorrow I suppose...
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
User avatar
Sjonnie2017
Posts: 365
Joined: Wednesday 02 August 2017 19:43
Target OS: Linux
Domoticz version: Latest ß
Location: The Netherlands
Contact:

Re: Noob question: how to switch lights after powefailure

Post by Sjonnie2017 »

I was on time this time :mrgreen:

Changing the "or" to "and" did the trick. Lights switch off nicely when "Plafond Haard" is on between sunrise and sunset.

Up to the next blockly (basically the same routine but then during nighttime) :)

Greetz,

Sjonnie
ConBee II - TRÅDFRI lights + switches, loads of ChingLing dimmers and switches, Heiman and Xiaomi sensors
SolarEdge SE4000H (with active modbus_tcp)
YouLess Energy meter
Shelly 2.5 in roller shutter mode
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest