Page 16 of 36

Re: Blockly examples

Posted: Thursday 01 September 2016 12:35
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.

Re: Blockly examples

Posted: Friday 02 September 2016 12:27
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)

Re: Blockly examples

Posted: Friday 02 September 2016 12:30
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.

Re: Blockly examples

Posted: Friday 02 September 2016 12:34
by emme
thanks! :P

Re: Blockly examples

Posted: Friday 02 September 2016 19:19
by cobra045
Thanks, I have now found it.
2016-09-02_19h12_24.png
2016-09-02_19h12_24.png (9.06 KiB) Viewed 4863 times
cobra045

Re: Blockly examples

Posted: Thursday 08 September 2016 22:15
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 4778 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 4778 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!

Re: Blockly examples

Posted: Friday 09 September 2016 21:10
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 4792 times
cobra045

Re: Blockly examples

Posted: Monday 12 September 2016 20:42
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 ?

Re: Blockly examples

Posted: Saturday 17 September 2016 12:18
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 4658 times
This one did not:
Blokly_UpdateLocation_NotWorking.PNG
Blokly_UpdateLocation_NotWorking.PNG (90.37 KiB) Viewed 4658 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 4658 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

Re: Blockly examples

Posted: Saturday 17 September 2016 17:44
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 4643 times

Re: Blockly examples

Posted: Saturday 17 September 2016 22:51
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.

Re: Blockly examples

Posted: Sunday 18 September 2016 16:42
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 4599 times

Re: Blockly examples

Posted: Tuesday 20 September 2016 20:46
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 4545 times

Re: Blockly examples

Posted: Wednesday 21 September 2016 9:26
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.

Re: Blockly examples

Posted: Wednesday 21 September 2016 11:45
by deejc
Ok thanks I'll change it


Sent from my iPhone using Tapatalk

Re: Blockly examples

Posted: Thursday 06 October 2016 21:13
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 4404 times

Re: Blockly examples

Posted: Saturday 08 October 2016 0:45
by Domosapiens
AFAIK,
Set can not be combined with an AND statement.
Use 2x Set:
Set Twig1 =On
Set Twig2 =On

Re: Blockly examples

Posted: Saturday 08 October 2016 1:09
by deejc
Ah ha, thanks I'll try that


Sent from my iPhone using Tapatalk

Re: Blockly examples

Posted: Saturday 08 October 2016 20:55
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

Re: RE: Re: Blockly examples

Posted: Saturday 08 October 2016 21:36
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