Blockly examples

Moderator: leecollings

welby
Posts: 36
Joined: Monday 20 November 2017 3:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Australia
Contact:

Re: Blockly examples

Post 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.
Patou
Posts: 3
Joined: Friday 28 December 2018 22:08
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples Script not found

Post 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
Attachments
2018-12-28_22h43_28.png
2018-12-28_22h43_28.png (14.35 KiB) Viewed 4521 times
2018-12-28_22h57_10.png
2018-12-28_22h57_10.png (2.95 KiB) Viewed 4521 times
Patou
Posts: 3
Joined: Friday 28 December 2018 22:08
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples Script not found

Post 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
Attachments
2018-12-28_23h39_38.png
2018-12-28_23h39_38.png (13.98 KiB) Viewed 4517 times
frigide
Posts: 4
Joined: Friday 08 September 2017 18:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by frigide »

Image

Why is this not working?
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post 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

Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
frigide
Posts: 4
Joined: Friday 08 September 2017 18:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Blockly examples

Post 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
User avatar
MarcelMAH
Posts: 53
Joined: Friday 04 December 2015 23:35
Target OS: Linux
Domoticz version: v3.8025
Location: Goes, Netherlands
Contact:

Re: Blockly examples

Post 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.
Running Domoticz on Ubuntu 16.04 on VMware with RFXCOM - RFXtrx433 and Aeotec Z-Stick Gen5
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Blockly examples

Post 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
shamie
Posts: 8
Joined: Wednesday 20 June 2018 22:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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
JimmyH1969
Posts: 153
Joined: Tuesday 28 June 2016 16:38
Target OS: Windows
Domoticz version: Beta
Location: Amersfoort NL
Contact:

Re: Blockly examples

Post by JimmyH1969 »

Or add a "and Bureaulamp Wendy = Off" to the IF line.
shamie
Posts: 8
Joined: Wednesday 20 June 2018 22:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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
JimmyH1969
Posts: 153
Joined: Tuesday 28 June 2016 16:38
Target OS: Windows
Domoticz version: Beta
Location: Amersfoort NL
Contact:

Re: Blockly examples

Post by JimmyH1969 »

Looks good to me :-)
shamie
Posts: 8
Joined: Wednesday 20 June 2018 22:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by shamie »

JimmyH1969 wrote: Thursday 24 January 2019 16:30 Looks good to me :-)
and it works good too, tnx :D
JimmyH1969
Posts: 153
Joined: Tuesday 28 June 2016 16:38
Target OS: Windows
Domoticz version: Beta
Location: Amersfoort NL
Contact:

Re: Blockly examples

Post 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
User avatar
PetervandePol
Posts: 23
Joined: Wednesday 09 January 2019 11:24
Target OS: Linux
Domoticz version:
Location: Scherpenzeel, GLD, NL
Contact:

Re: Blockly examples

Post 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?
geezerrr
Posts: 79
Joined: Tuesday 02 December 2014 22:16
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Blockly examples

Post 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.
User avatar
PetervandePol
Posts: 23
Joined: Wednesday 09 January 2019 11:24
Target OS: Linux
Domoticz version:
Location: Scherpenzeel, GLD, NL
Contact:

Re: Blockly examples

Post 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest