Blockly examples

Moderator: leecollings

Jawi
Posts: 1
Joined: Wednesday 31 August 2016 9:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by Jawi »

micbou wrote:
Thomasdc wrote:
micbou wrote:Also I want to make my light turns off after 20 minuten of no activity, but this doesnt seem to work. Instead it just shuts off the lights 20 minutes after it's in turned 'off' state.

Schermafbeelding 2016-06-11 om 22.58.58.png
i think The problem you have is:

1) motionsensors turnes off
2) command to turn lights off after 1200 seconds (timer starts running)
3) motionsenser turns on again because of some motion

but even after event '3' the timer of event '2' is still running (timer is still running) so when timer is done.. it will still set your lights off..
so '2' is actualie setting a timer for 1200 seconds.. once the time is up turn the lights off. but once the timer is started.. it cant be stopped anymore so it will always turn your lights independent of other events..
Correct, so how do you suggest I'd set it up. So I want my light to turn on when the light in the room is under an x-amount of Lux (MotionSensor6), but only when motion is detected in the living room. If there hasnt been any motion for >15 minutes the lights need to be turned off.
Hi,

If you have a multisensor you can set the time in the settings menu of the sensor.
Attachments
Multisensor.JPG
Multisensor.JPG (68.95 KiB) Viewed 4750 times
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Blockly examples

Post by emme »

OT:
sorry guys... but... you have a specific block for logic operator (AND)

I cannot find it in my blocky editor not under "control", nor under "Logic"....
do I have to upgrade my blocky interface? (domo SD image, v3.5582b)
The most dangerous phrase in any language is:
"We always done this way"
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 »

emme wrote:OT:
sorry guys... but... you have a specific block for logic operator (AND)

I cannot find it in my blocky editor not under "control", nor under "Logic"....
do I have to upgrade my blocky interface? (domo SD image, v3.5582b)
Rightmouseclick on the and operator block and click 'external outputs' will make it look like that.
Running Domoticz on Ubuntu 16.04 on VMware with RFXCOM - RFXtrx433 and Aeotec Z-Stick Gen5
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Blockly examples

Post by emme »

thanks! :P
The most dangerous phrase in any language is:
"We always done this way"
cobra045
Posts: 46
Joined: Friday 12 February 2016 20:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Contact:

Re: Blockly examples

Post by cobra045 »

Thanks, I have now found it.
2016-09-02_19h12_24.png
2016-09-02_19h12_24.png (9.06 KiB) Viewed 4733 times
cobra045
RMU
Posts: 17
Joined: Wednesday 19 February 2014 22:48
Target OS: Linux
Domoticz version:
Location: Netherlands
Contact:

Re: Blockly examples

Post by RMU »

I'm trying to make a blocky, and it works but not the way i wanted.

I have made two, which should do the same;
The one that works:
working.PNG
working.PNG (19.64 KiB) Viewed 4648 times
Here are all switches seperate as you can see.

But what i want is working with groups:
not-working.PNG
not-working.PNG (13.81 KiB) Viewed 4648 times
This should do the same as the first picture, but when i set "Iemand thuis" to "off" then only the first group gets done, so in this case: "Lampen woonkamer" is set to off. But the second "Apparaten woonkamer" is not set to off.

Can someone tell me why this does not work and how i can fix it? Thanks!
cobra045
Posts: 46
Joined: Friday 12 February 2016 20:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Contact:

Re: Blockly examples

Post by cobra045 »

Hallo RMU,

I also had the problem with switching off
Try it with a delay in the group
see the picture
2016-09-09_20h58_05.png
2016-09-09_20h58_05.png (89.42 KiB) Viewed 4662 times
cobra045
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 »

I've build a blackly when using a pir to power on a lamp. But when using this blockly it's to slow.
Because when we enter the room with this pir the light must be powered on instantly. Is lua faster ?
It's nice to be important, but it's more important to be nice
Scooter ;)
Bart77
Posts: 8
Joined: Saturday 17 September 2016 9:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Latest
Location: Netherlands
Contact:

Re: Blockly examples

Post by Bart77 »

Hi all,

I've just installed my Domoticz server and was pretty impressed, so next step was to start implementing use cases.

I downloaded the Pilot app to enable geofencing on my phone which is linked to 2 dummy switches, one @Work and one for @Home.

For this I made some basic Blockly scipts where I experienced some strange behavior.
1. User variables do not seem to be updated inside the script itself
2. Nested if and else if statement do not deliver expected results

This script works:
Blokly_UpdateLocation_Working.PNG
Blokly_UpdateLocation_Working.PNG (95.85 KiB) Viewed 4528 times
This one did not:
Blokly_UpdateLocation_NotWorking.PNG
Blokly_UpdateLocation_NotWorking.PNG (90.37 KiB) Viewed 4528 times
When updated this always returns ERROR, which is stange, looking at the log all nested if actions are executed.

Result in the log:
Blokly_UpdateLocation_NotWorking_Log.PNG
Blokly_UpdateLocation_NotWorking_Log.PNG (4.54 KiB) Viewed 4528 times
Does anyone have any tips/suggestions?
Should I switch to LUA scripting or does this have the same restrictions?

Many thanks for your input
rickybee
Posts: 8
Joined: Thursday 31 March 2016 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by rickybee »

This is a simple script to turn off a light when my wife leaves and back on when she returns. This works fine except at the end of the day when we want to turn it off manually it comes right back on. I had thought that the script would only be triggered upon the cell phones' change of state but apparently not. Any advice would be appreciated.
blockly.JPG
blockly.JPG (33.57 KiB) Viewed 4513 times
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 »

If it helps, I would add a dummy Auto/Manual switch which is controlled with the built in timers. Then simply check the state of the switch in the blockly before carrying out the action.
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
rickybee
Posts: 8
Joined: Thursday 31 March 2016 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by rickybee »

Thanks StanHD, as you suggested I created a 'Manual On' switch which is on between 9pm and 7am and added it to the script. Testing it now but I think it should work for what I need.
blockly.JPG
blockly.JPG (40.66 KiB) Viewed 4469 times
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: Blockly examples

Post by deejc »

hello
i have an RFXCom doorbell that has multiple chimes, i captured each chime in domoticz nd created a bell for each and now i am trying to get a camera snapshot to send if any one of the bells is triggered (it seems to rotate each sound) so it could be one of the seven that chimes, this blockly does not seem to fire at all???

the end of the first line of the blockly is or bell7 = on
bells.png
bells.png (43.13 KiB) Viewed 4415 times
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
four2six
Posts: 53
Joined: Wednesday 24 February 2016 9:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NRW, Germany
Contact:

Re: Blockly examples

Post by four2six »

deejc wrote:this blockly does not seem to fire at all???
not sure i understood your 'capturing' correctly, but it lacks the 'logic'-part. It should be something like "if bell1='on' " or "if bell2='on' "... etc.
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: Blockly examples

Post by deejc »

Ok thanks I'll change it


Sent from my iPhone using Tapatalk
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: Blockly examples

Post by deejc »

another one i cant get to work, this one does nothing, nothing in the logs, the 1 minute timer doesn't fire.. i know the 3in1 motion is triggered…
twig 1 and twig 2 are leds on their own plugs, so just off and on, 3 in 1 motion is fibaro eye motion sensor which is working correctly, 1 min timer is taken from a previous post in this thread.

any ideas ?
pir_light.png
pir_light.png (95 KiB) Viewed 4274 times
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
User avatar
Domosapiens
Posts: 232
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: Blockly examples

Post by Domosapiens »

AFAIK,
Set can not be combined with an AND statement.
Use 2x Set:
Set Twig1 =On
Set Twig2 =On
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555
User avatar
deejc
Posts: 168
Joined: Tuesday 22 September 2015 18:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5641
Location: UK
Contact:

Re: Blockly examples

Post by deejc »

Ah ha, thanks I'll try that


Sent from my iPhone using Tapatalk
Domoticz 3.5641 on RPI (Raspbian GNU/Linux 8)
bacinatorz
Posts: 2
Joined: Saturday 08 October 2016 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by bacinatorz »

Hi all,

Is there a possibility to make sure this event does not turn on again after I turned letstrips off by hand (in domoticz web) because now it tries every few minutes.

Image
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: RE: Re: Blockly examples

Post by thecosmicgate »

bacinatorz wrote:Hi all,

Is there a possibility to make sure this event does not turn on again after I turned letstrips off by hand (in domoticz web) because now it tries every few minutes.

Image
Sure, when you use variables
It's nice to be important, but it's more important to be nice
Scooter ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest