All,
I searched already the forum but could not find my answer. If it is already there please redirect me, no problem otherwise here is my problem.
I created a blocky script to sitch on/off light in the morning and the evening. But it is switched on and a few seconds later off. During the period it should be on. I am sure I miss something but I am just a beginner so maybe someone can help me.
This is the log:
2018-01-15 07:04:01 Off
2018-01-15 07:04:00 On
2018-01-15 07:03:00 Off
2018-01-15 07:03:00 On
2018-01-15 07:02:00 Off
2018-01-15 07:02:00 On
2018-01-15 07:01:01 Off
2018-01-15 07:01:00 On
2018-01-15 07:00:01 Off
2018-01-15 07:00:00 On
2018-01-14 22:30:01 Off
2018-01-14 22:30:00 On
2018-01-14 22:29:00 Off
2018-01-14 22:29:00 On
2018-01-14 22:28:01 Off
2018-01-14 22:28:00 On
2018-01-14 22:27:01 Off
2018-01-14 22:27:00 On
2018-01-14 22:26:01 Off
2018-01-14 22:26:00 On
2018-01-14 22:25:01 Off
2018-01-14 22:25:00 On
2018-01-14 22:24:01 Off
2018-01-14 22:24:00 On
2018-01-14 22:23:01 Off
Blocky diagram is also attached:
Switch On/Off every minute with Blocky
Moderator: leecollings
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: Switch On/Off every minute with Blocky
So in a timeframe you are switching "Telefoon Marc" to On, and in the Else If you are switching it Off when it is On.
Because it's a timed blocky this happens every minute.
The blocky works as it should
Because it's a timed blocky this happens every minute.
The blocky works as it should
-
- Posts: 19
- Joined: Monday 15 January 2018 10:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands
- Contact:
Re: Switch On/Off every minute with Blocky
Okay,
But how should I switch off if it is outside the timewindow.
I thought I could achieve the switch off out side the time window with the "else if" if it is not in the time window there is an else and this is switch off. If it is in the time window I thought it would not use the "else if" or am I wrong?
But how should I switch off if it is outside the timewindow.
I thought I could achieve the switch off out side the time window with the "else if" if it is not in the time window there is an else and this is switch off. If it is in the time window I thought it would not use the "else if" or am I wrong?
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: Switch On/Off every minute with Blocky
Split it in two blocky events. That would work.
Is "telefoon Marc" a switch ? if so, Why don't you set it in Timers?
Is "telefoon Marc" a switch ? if so, Why don't you set it in Timers?
-
- Posts: 19
- Joined: Monday 15 January 2018 10:06
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands
- Contact:
Re: Switch On/Off every minute with Blocky
Thanks for your reactions, I am only a beginner so two blocky events? Could you please make an example.
I am a bit confused with the else statement, if I understand it correctly the "else" is carried out even if the "if" is matched? It is not a "normal" "if then else" statement?
Why not add it with timers, if sunset is after 22:30 (maybe not possible in the Netherlands ) but it would not switch off at 22:30.
I want also to add 07:00 to sunrise and sunrise could be before 07:00 then it is not necessary to switch on. And I try to learn
I am a bit confused with the else statement, if I understand it correctly the "else" is carried out even if the "if" is matched? It is not a "normal" "if then else" statement?
Why not add it with timers, if sunset is after 22:30 (maybe not possible in the Netherlands ) but it would not switch off at 22:30.
I want also to add 07:00 to sunrise and sunrise could be before 07:00 then it is not necessary to switch on. And I try to learn
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: Switch On/Off every minute with Blocky
The else statment isn't working as expected or is not working at all.
So your understanding of programming is ok, but the blocky is s***t
Lets start with the first step.
Why do you switch on the phone every minute between 07:00 and 10:00?
You could switch on at 07:00 single shot correct?
For the second step. only switch on after sunset but only till 22:30 ?
But still doing this every min.
Start splitting in two scripts as a first step.
Still this is much easier doing it in timers sorry..
So your understanding of programming is ok, but the blocky is s***t
Lets start with the first step.
Why do you switch on the phone every minute between 07:00 and 10:00?
You could switch on at 07:00 single shot correct?
For the second step. only switch on after sunset but only till 22:30 ?
But still doing this every min.
Start splitting in two scripts as a first step.
Still this is much easier doing it in timers sorry..
- Denny64
- Posts: 53
- Joined: Friday 03 February 2017 11:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.1
- Location: Italy
- Contact:
Re: Switch On/Off every minute with Blocky
Try in this way. It should be working.
- Attachments
-
- Screenshot at 2018-01-17 07-34-52.jpg (49.17 KiB) Viewed 2048 times
Who is online
Users browsing this forum: No registered users and 1 guest