Page 31 of 36

Re: Blockly examples

Posted: Friday 28 December 2018 7:07
by welby
Your right in using the 10% for the gateway as that will play the siren sound. What your problem is that while the 300 second wait is happening the code then moves to the next line and cancels it after the 5 seconds. You need to combine the wait time and the off time together in the same line.

Re: Blockly examples Script not found

Posted: Friday 28 December 2018 23:03
by Patou
Hello I am new on this forum
I use Domoticz on a Synology NAS to control some ESP Easy units
Version: 4.9700
Build Hash: a3a4590-modified
Compile Date: 2018-06-23 16:24:51
dzVents Version: 2.4.6
Python Version: None


With one switch I want to send 2 HTTP commands to the ESP easy unit
So I use blockly to make the 2 commands with One switch see screenshoot attached The file is named "A"
In the switch setting I have put : On action : script://A
When I turn on the switch I have a log error as follow :
2018-12-28 22:00:34.299 (Switches) Light/Switch (Open-Close)
2018-12-28 22:00:34.298 Status: User: Admin initiated a switch command (8/Open-Close/On)
2018-12-28 22:00:34.298 Error: SQLHelper: Error script not found '/usr/local/domoticz/var/scripts/A'

Can somebody tell me what I am doing wrong ?
Thanks in advance
Patou

Re: Blockly examples Script not found

Posted: Friday 28 December 2018 23:40
by Patou
Hello again,
I found my mistake ....
The 2 blocks must be linked with the else if statement
Hope this can help somebody else ...
Patou

Re: Blockly examples

Posted: Saturday 05 January 2019 16:39
by frigide
Image

Why is this not working?

Re: Blockly examples

Posted: Saturday 05 January 2019 17:39
by StanHD
frigide wrote:Image

Why is this not working?
Try with the other "if" block that does not have the blue gear icon. The one you have used needs an "else if" to work.

Sent from my SM-T820 using Tapatalk


Re: Blockly examples

Posted: Saturday 05 January 2019 19:44
by frigide
StanHD wrote: Saturday 05 January 2019 17:39
frigide wrote:Image

Why is this not working?
Try with the other "if" block that does not have the blue gear icon. The one you have used needs an "else if" to work.

Sent from my SM-T820 using Tapatalk
Thanks for answering. But if that is it, why is this not working?

Image

Re: Blockly examples

Posted: Wednesday 09 January 2019 17:56
by tozzke
Which version of Domoticz are you running? In the older versions you can select what type of event you want it to be, All/Device/Security/Time/Uservariable. In the newer versions of Domoticz this dropdown menu doesn't exist anymore and I don't know whether the event can trigger on a variable

Re: Blockly examples

Posted: Monday 21 January 2019 16:13
by MarcelMAH
Hi,

I'm trying to create a Blocky for the following, but I keep getting errors (tried multiple ways, all result in errors with syntax in the Domoticz logs):
Enable a scene when it's 07:00 but only when sunrise is after 07:00 and then enable another scene when sunrise is now.

Any help would be appreciated.

Re: Blockly examples

Posted: Monday 21 January 2019 22:33
by tozzke
Something like this should work I'd say:

Image

'Light' should be one of the devices from the scene to prevent retriggering, or you could use user variables

Re: Blockly examples

Posted: Thursday 24 January 2019 15:58
by shamie
i have the Blocky below running to turn a light on when a PC is turned on but only in the evening, but i noticed in the log that the ON command every minute is resend due to this Blockly, what is the trick that it doesnt send it continously ? my best guess is some sort of check that when light is on it should not be resending a ON command?

Image

Re: Blockly examples

Posted: Thursday 24 January 2019 16:07
by JimmyH1969
Or add a "and Bureaulamp Wendy = Off" to the IF line.

Re: Blockly examples

Posted: Thursday 24 January 2019 16:26
by shamie
JimmyH1969 wrote: Thursday 24 January 2019 16:07 Or add a "and Bureaulamp Wendy = Off" to the IF line.
Thank you for your quick reply.

i added the line like below, i hope the sequence is correctly, i will find out this evening.

Image

Re: Blockly examples

Posted: Thursday 24 January 2019 16:30
by JimmyH1969
Looks good to me :-)

Re: Blockly examples

Posted: Friday 25 January 2019 7:17
by shamie
JimmyH1969 wrote: Thursday 24 January 2019 16:30 Looks good to me :-)
and it works good too, tnx :D

Re: Blockly examples

Posted: Friday 25 January 2019 10:40
by JimmyH1969
shamie wrote: Friday 25 January 2019 7:17
JimmyH1969 wrote: Thursday 24 January 2019 16:30 Looks good to me :-)
and it works good too, tnx :D
No problem :D

Re: Blockly examples

Posted: Wednesday 30 January 2019 14:34
by PetervandePol
Hi,

I am afraid I need some help. I can't figure out how to switch two lamps on between sunset and sunrise with a motion sensor. It works without the time restiction, but I do not want the lights on and off during the day. Based on the examples in this forum I have made this:

Image

But nothing happens :( Where do I go wrong?

Re: Blockly examples

Posted: Wednesday 30 January 2019 14:49
by geezerrr
PetervandePol wrote:Hi,

I am afraid I need some help. I can't figure out how to switch two lamps on between sunset and sunrise with a motion sensor. It works without the time restiction, but I do not want the lights on and off during the day. Based on the examples in this forum I have made this:

Image

But nothing happens :( Where do I go wrong?
A day is from 00:00 till 23:59.

You need to adjust your blockley like sunset till 23:59 and a second line from 00:00 till sunrise


Verzonden vanaf mijn iPhone met Tapatalk

Re: Blockly examples

Posted: Wednesday 30 January 2019 14:56
by waaren
PetervandePol wrote: Wednesday 30 January 2019 14:34 Hi,

I am afraid I need some help. I can't figure out how to switch two lamps on between sunset and sunrise with a motion sensor. It works without the time restiction, but I do not want the lights on and off during the day. Based on the examples in this forum I have made this:

Image

But nothing happens :( Where do I go wrong?
There is no such time :D
Try > sunset OR < sunrise

Re: Blockly examples

Posted: Thursday 31 January 2019 21:46
by tozzke
PetervandePol wrote: Wednesday 30 January 2019 14:34 Hi,

I am afraid I need some help. I can't figure out how to switch two lamps on between sunset and sunrise with a motion sensor. It works without the time restiction, but I do not want the lights on and off during the day. Based on the examples in this forum I have made this:

Image

But nothing happens :( Where do I go wrong?
what @geezerrr and @waaren said with the addition that the Set part should be split in two. So you'll have to add a Set block for YeeLight 1 and another Set block for YeeLight 2, you can't use the 'and' block in the output

Also the 'On for x minutes' doesn't always react as you might think it does. When the device is off when the 'if' is triggered, it'll turn on and after the set time it'll turn off like you'd expect. Is the device already on however (when the 'if' is triggered) it won't turn off but will turn to the state it was at the trigger, so "back" on in that case.

Re: Blockly examples

Posted: Saturday 02 February 2019 9:48
by PetervandePol
tozzke wrote: Thursday 31 January 2019 21:46
PetervandePol wrote: Wednesday 30 January 2019 14:34 Hi,

I am afraid I need some help. I can't figure out how to switch two lamps on between sunset and sunrise with a motion sensor. It works without the time restiction, but I do not want the lights on and off during the day. Based on the examples in this forum I have made this:

Image

But nothing happens :( Where do I go wrong?
what @geezerrr and @waaren said with the addition that the Set part should be split in two. So you'll have to add a Set block for YeeLight 1 and another Set block for YeeLight 2, you can't use the 'and' block in the output

Also the 'On for x minutes' doesn't always react as you might think it does. When the device is off when the 'if' is triggered, it'll turn on and after the set time it'll turn off like you'd expect. Is the device already on however (when the 'if' is triggered) it won't turn off but will turn to the state it was at the trigger, so "back" on in that case.
Thank you, @tozzke.
I changed to:

Image

... and this works to switch "on" but like you predicted the lights do go on, but not off. How do I achieve that then?