Blockly examples

Moderator: leecollings

cattoo
Posts: 60
Joined: Sunday 20 September 2015 17:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3072
Location: Sweden
Contact:

Re: Blockly examples

Post by cattoo »

Hi all,
I want my LUX sensor activate my lights between 15:00 and 22:30 when it goes below 60 Lux, and that part is working (ill think)
But when the time is between 06:00 and 09:00 ill want the motion sensor to handle the lights, but it does not work. What have i done wrong?

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 »

Not sure but try "And" in place of "Or" for your time periods.
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
mrf68

Re: Blockly examples

Post by mrf68 »

Let's assume it is 12:00 hours and LUX < 60. Then read line 1:

If LUX < 60

that is true, so we continu reading the condition, and because of the OR statement that follows one of the conditions need to be true:
TIME >=15:00
that is not true, but because of the OR we need to check the second condition:
TIME <=22:30
that is true, so it will activate the lights.

Try time = 17:00 hours, then both time conditions are true.
Try time = 23:19 hours, then the first condition (TIME >=15:00) is true.

In my opinion this part will always be true. Same goes for the second part of the script with the Motion sensor.

I must say I make this mistake myself every now and then. And maybe my interpretation at this moment is not correct, please feel free to correct me. :mrgreen:
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Blockly examples

Post by thecosmicgate »

Running this somebody home blokckly:
Image
But the problem is that the virtual switch flips every second on and off .
As the ping script i'am running chopperRob's script.
As geofence tool we run the android domofence app.

Somebody who can tell me , why the somebody home switch is flipping ?
It's nice to be important, but it's more important to be nice
Scooter ;)
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Blockly examples

Post by thecosmicgate »

thecosmicgate wrote:Running this somebody home blokckly:
Image
But the problem is that the virtual switch flips every second on and off .
As the ping script i'am running chopperRob's script.
As geofence tool we run the android domofence app.

Somebody who can tell me , why the somebody home switch is flipping ?
Changed it:
Image

but the somebody home switch keeps flipping on / off every second :(
It's nice to be important, but it's more important to be nice
Scooter ;)
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: Blockly examples

Post by Skippiemanz »

I think if you change the 2nd or in else if to and it will work. Because all the devices have to be off for the system to turn iemand thuis off
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Blockly examples

Post by thecosmicgate »

Skippiemanz wrote:I think if you change the 2nd or in else if to and it will work. Because all the devices have to be off for the system to turn iemand thuis off
Problem solved ...next ;-)

Sent from my MotoG3 using Tapatalk
It's nice to be important, but it's more important to be nice
Scooter ;)
Richardsnel
Posts: 2
Joined: Wednesday 11 November 2015 17:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by Richardsnel »

I created a Blockly script but how can i run it?
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Blockly examples

Post by thecosmicgate »

Richardsnel wrote:I created a Blockly script but how can i run it?
Domoticz does this for you ;-)

Sent from my MotoG3 using Tapatalk
It's nice to be important, but it's more important to be nice
Scooter ;)
Skippiemanz
Posts: 230
Joined: Sunday 14 July 2013 20:21
Target OS: Linux
Domoticz version: 4.10233
Location: Alkmaar, The Netherlands
Contact:

Re: Blockly examples

Post by Skippiemanz »

If you marked the blockly as active
Richardsnel
Posts: 2
Joined: Wednesday 11 November 2015 17:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by Richardsnel »

I marked it as active but wil it run every our?
djoeney
Posts: 15
Joined: Sunday 17 May 2015 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Blockly examples

Post by djoeney »

FYI
Automate turning off AV devices in combination with Logitech Harmony HUB and z-wave power switch (could also be a KAKU device or whatever power switch you use).

The logic is when you turn off activity's with your remote control the poweroff switch is turned ON. When this happens you have 5 minutes after that the power switch is turned off. If you put the power switch back on you have 5 minutes to turn on an activity on the remote otherwise the switch is turned off again.
Attachments
switch off activity.PNG
switch off activity.PNG (10.07 KiB) Viewed 4896 times
Compute RPi 2 : Domoticz latest beta, Synology : Domoticz tested beta on failover system.
Peripherals RFXCOM - RFXtrx433, Z-Wave.Me ZME_UZB1 USB Stick,P1 cable on smartmeter, Logitech Harmony Hub, 3 IP camera's
doxikus
Posts: 14
Joined: Friday 27 November 2015 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Dalj, Croatia
Contact:

Re: Blockly examples

Post by doxikus »

Hi to all,

I try to create simple rule to send notification with blocky, I hope that someone can help me to pint right direction.

Rule will be something like this, if temperature is larger than some value send notification each 5 minutes. I use dummmy/virtual sensor so notification don't work on sensor notification settings. Right now I have this rule but it will send mail each minute. Domoticz is installed on synology.
blocky.jpg
blocky.jpg (43.42 KiB) Viewed 4830 times
Thanks
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Re: Blockly examples

Post by Evelen »

Sending E-Mail when smokedetector is detecting smoke:
Image

EDIT: And turing on lamp:
Image
also video:

https://sendvid.com/tqnqdxcc
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 »

I'm trying to create a Blocky to toggle the dummy switch 'Someone home'.
If one of the 4 switches (2x Geo 2x ping) is on then 'Someone home' must me set on.

If none of the 4 switches is on then 'Someone home' must be set to off.

It's not working :(
SomeoneHome.png
SomeoneHome.png (81.79 KiB) Viewed 4730 times
Running Domoticz on Ubuntu 16.04 on VMware with RFXCOM - RFXtrx433 and Aeotec Z-Stick Gen5
alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: Blockly examples

Post by alfred_j_kwak »

If none of the switches are one then your AND part is ON not OFF.
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 »

alfred_j_kwak wrote:If none of the switches are one then your AND part is ON not OFF.
You mean this one?
onoff.png
onoff.png (30.29 KiB) Viewed 4687 times
Changed it, still no go... it won't turn it on even when everything else is on.
Running Domoticz on Ubuntu 16.04 on VMware with RFXCOM - RFXtrx433 and Aeotec Z-Stick Gen5
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 »

This one works for sure:-

Image
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
User avatar
Westcott
Posts: 423
Joined: Tuesday 09 December 2014 17:04
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: UK - Glos
Contact:

Re: Blockly examples

Post by Westcott »

Hi StanHD,

How do you do your Galaxy Geofence?
DomoFence?
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
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 »

Yes, Domo fence.
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest