Blockly examples

Moderator: leecollings

mKotek
Posts: 68
Joined: Wednesday 30 December 2015 23:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

Re: Blockly examples

Post by mKotek »

Martijn85 wrote:Hello everybody,

Maybe someone can help me out with this small issue. These are my blocks:
2016_02_03_21_31_54_Domoticz.png
This works but when one phone is off and one phone is on the switch Iemand Thuis (Someone Home) is switching every second from on to off. When the second phone is coming online the switch keeps on like ik should. Why, when one phone is off, the switch is switching from on to off?
As far as I can see, in the second part, you should have AND instead of OR between the phones. As it is now, just one phone fulfils the condition and swithc is set to OFF. Next, it detects one phone and sets it to ON again.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
Martijn85
Posts: 53
Joined: Wednesday 20 January 2016 20:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Blockly examples

Post by Martijn85 »

Thanks for the fast reply mKotek, it seems that did the trick! Thank you :)
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Re: SCRIPS - EVENT MANAGEMENT SAMPLE

Post by Evelen »

Jochen wrote:Turn on a Light when open a door
This example will turn on a light when
1. A door is opening
2. It is between 22:00 and 07:00
A notification will be send everytime the is opening (00:00 - 24:00)
dooropenlighton.PNG
PS: The device Garagentor is the door (Garagentor = Garagedoor), the light is light is Licht Garage (Light Garage)
how to set a if-do inside a if-do?
Yoshiii
Posts: 3
Joined: Wednesday 21 October 2015 23:17
Target OS: Windows
Domoticz version:
Contact:

Re: Blockly examples

Post by Yoshiii »

rtulp wrote:
elmortero wrote:I don't know about curtains but with blinds you use Off for open and On for closed
Thanks! That makes sense!
Does the script work now? I cannot get my blinds to work... :(
brianprak
Posts: 2
Joined: Tuesday 23 February 2016 13:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by brianprak »

Whats wrong with the following blockly i get an error 'then' expected near 'comparevariable'

Image
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 »

Hi, I think the problem is in the Else if section where the "On & "Or" are incorrectly arranged. Try right clicking all of the "And" "Or" blocks and setting them as "External Inputs" It might be easier to see the logic then.
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
djgodlike
Posts: 32
Joined: Wednesday 27 January 2016 16:37
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: RE: Re: Blockly examples

Post by djgodlike »

brianprak wrote:Whats wrong with the following blockly i get an error 'then' expected near 'comparevariable'

Image
Compare with this picture very precisely!
uploadfromtaptalk1456261191844.png
uploadfromtaptalk1456261191844.png (25.96 KiB) Viewed 4408 times
Aeon Labs Gen5 USB
Greenwave Powernode 6 NS310
2x Greenwave Powernode 1 NS310
Philips Hue
Logitech media Server
Plugwise Smile P1
marktn
Posts: 233
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Blockly examples

Post by marktn »

Hello,

I have made my first blocky event.
Is it possible to test this, without waiting till the sunn is under? (simultion of a day)
The script is sending nog from 23:00 till 00:00 email, a lot of emails!! I just want one email that i am not at home. How to do this?
Afwezig.png
Afwezig.png (24.67 KiB) Viewed 4352 times
Thanks for reading,
Mark
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
sweup
Posts: 37
Joined: Friday 19 February 2016 13:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by sweup »

Hi

I have build a Blockly with a manual switch to toggle alarm on/off.
Unfortunately my alarm not working, when I set my alarm "on", the alarm goes off - I want to set blockly to "when alarm is on and sensor 1 register motion, I will be notified and siren should beep". What I have done wrong?

Im using Aeon labs sensor+Razberry

Image
JayKudo
Posts: 5
Joined: Thursday 17 March 2016 20:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by JayKudo »

So I am trying to create a group dimmer and want to use blocky for it.

How can I detect a change in a (virtual) dimmer switch. So if the virtual switch changes value, than I want to set two real dimmers to that value.

Do I need to create a user var and save the current value and than compare the value with the virtual dimmer, or is there an easier method (or should I use blocky at all for this)?
assenzuid
Posts: 135
Joined: Friday 13 November 2015 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands, Emmen Area
Contact:

Re: Blockly examples

Post by assenzuid »

I have created below blockly, but unfortunately it's not working.
Capture.JPG
Capture.JPG (32.38 KiB) Viewed 4006 times
assenzuid
Posts: 135
Joined: Friday 13 November 2015 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands, Emmen Area
Contact:

Re: Blockly examples

Post by assenzuid »

assenzuid wrote:I have created below blockly, but unfortunately it's not working.
Capture.JPG
Solved by using.
Capture.JPG
Capture.JPG (10.27 KiB) Viewed 4005 times
micbou
Posts: 86
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Blockly examples

Post by micbou »

so what am I doing wrong here? this feels so straight forward but it doesn't work
snip_20160605203940.png
snip_20160605203940.png (16.06 KiB) Viewed 3695 times
hjvingen
Posts: 14
Joined: Thursday 21 May 2015 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Blockly examples

Post by hjvingen »

micbou wrote:so what am I doing wrong here? this feels so straight forward but it doesn't work

snip_20160605203940.png
Please try again with setting the group to "on" instead of "active",
this works for me.
Attachments
Schermafbeelding 2016-06-05 om 20.51.35.png
Schermafbeelding 2016-06-05 om 20.51.35.png (13.36 KiB) Viewed 3691 times
micbou
Posts: 86
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Blockly examples

Post by micbou »

Unfortunatly not working neither. Time doesn't seem to work in any scenario and Domoticz does show the correct time.
hjvingen
Posts: 14
Joined: Thursday 21 May 2015 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Blockly examples

Post by hjvingen »

micbou wrote:Unfortunatly not working neither. Time doesn't seem to work in any scenario and Domoticz does show the correct time.
Do you get something in the log, like this?
Schermafbeelding 2016-06-05 om 21.04.28.png
Schermafbeelding 2016-06-05 om 21.04.28.png (12.12 KiB) Viewed 3688 times
Do other events (not time related) work?
micbou
Posts: 86
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Blockly examples

Post by micbou »

No, the log shows no activity from the event.

Only events that seem to work are those activating a device after a device has been activated (for example 'turn on left light when the right light is on)
hjvingen
Posts: 14
Joined: Thursday 21 May 2015 18:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Blockly examples

Post by hjvingen »

That's strange, because the event system is working but somehow the time related triggers don't work.

in the editor there is also a selector which can be set to time or device, did you already try these?
Schermafbeelding 2016-06-05 om 21.35.29.png
Schermafbeelding 2016-06-05 om 21.35.29.png (34.73 KiB) Viewed 3662 times
micbou
Posts: 86
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Blockly examples

Post by micbou »

Yup, tried that too...

Schermafbeelding 2016-06-05 om 21.48.43.png
Schermafbeelding 2016-06-05 om 21.48.43.png (56.45 KiB) Viewed 3660 times
micbou
Posts: 86
Joined: Sunday 01 May 2016 0:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Blockly examples

Post by micbou »

and its weird because below does work
Schermafbeelding 2016-06-05 om 22.03.06.png
Schermafbeelding 2016-06-05 om 22.03.06.png (28.71 KiB) Viewed 3657 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest