Blocky script need help

Moderator: leecollings

Post Reply
Kerneldomoticz
Posts: 40
Joined: Friday 25 March 2016 22:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5248
Location: Paris, France
Contact:

Blocky script need help

Post by Kerneldomoticz »

Hello all,

I'm facing an issue here with my fibaro FGMS001 and my fibaro dimmer using blocky script for simple dummy script :

what i want to do is :
blocky1.JPG
blocky1.JPG (37.56 KiB) Viewed 2822 times
but i get this error message that i don't understand :

Code: Select all

2016-06-14 22:03:00.253 Error: EventSystem: Lua script error (Blockly), Name: Dressing light day time_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: unexpected symbol near ']'
also here is my group and network :
group&net1.JPG
group&net1.JPG (42.6 KiB) Viewed 2822 times

can you polease guys help ... i don't know why it is not working.

PS : Lumière = light & capteur = sensor/PIR ( :D let me know if you needs translation)

Cheers,
FLo
Kerneldomoticz
Posts: 40
Joined: Friday 25 March 2016 22:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5248
Location: Paris, France
Contact:

Re: Blocky script need help

Post by Kerneldomoticz »

any idea ?

did someone succeed in using Fibaro FGMS 001 motion sensor to turn light ?

Cheers,
Flo
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blocky script need help

Post by StanHD »

Hi,

The below Blockley uses FGMS001 to switch my Hall Lights using both the motion detection and the light level information. (I also have a dummy "Auto" switch to disable the automation when needed.)

Note:- The off delay settings etc. are set in the Z-Wave Hardware settings for the FGMS001

This all works very well for a year now.

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
Kerneldomoticz
Posts: 40
Joined: Friday 25 March 2016 22:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5248
Location: Paris, France
Contact:

Re: Blocky script need help

Post by Kerneldomoticz »

Thank you StanHD ;) can you post your FGMS 001 settings maybe i've somoething wrong or forgotten in mine ....
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blocky script need help

Post by StanHD »

Here you go:-

1. Motion sensor's sensitivity:
10
(actual: 10)

2. Motion sensor's blind time (insensitivity):
15
(actual: 15)

3. PIR sensor's pulse counter:
Default setting: 1 (2 pulses)

4. PIR sensor's window time:
Default setting: 2 (12 seconds)

6. Motion alarm cancellation delay:
30
(actual: 30)

8. PIR sensor operating Mode:
Default setting: 0 (always active)

9. Night / day:
200
(actual: 200)

12. Basic command class frames configuration:
Default setting: 0 (ON and OFF)

14. BASIC ON command frame value:
255
(actual: 255)

16. BASIC OFF command frame value:
0
(actual: 0)

20. Tamper sensitivity:
15
(actual: 15)

22. Tamper alarm cancellation delay:
30
(actual: 30)

24. Tamper operating modes:
Default setting: 0 (Tamper)

26. Tamper alarm broadcast mode:
0
(actual: 0)

40. Illumination report threshold:
200
(actual: 200)

42. Illumination reports interval:
0
(actual: 0)

60. Temperature report threshold:
10
(actual: 10)

62. Interval of temperature measuring:
900
(actual: 900)

64. Temperature reports interval:
0
(actual: 0)

66. Temperature offset:
0
(actual: 0)

80. LED signaling mode:
Default setting: 10 (flashlight)

81. LED brightness:
50
(actual: 50)

82. Ambient illumination level below which LED brightness is set to 1%:
100
(actual: 100)

83. Ambient illumination level above which LED brightness is set to 100%:
1000
(actual: 1000)

86. Minimum temperature resulting in blue LED illumination:
18
(actual: 18)

87. Maximum temperature resulting in red LED illumination:
28
(actual: 28)

89. LED indicating tamper Alarm.
Default setting: 1 (on)

2000. Wake-up Interval:
1800
(Seconds) (actual: 1800)
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
Kerneldomoticz
Posts: 40
Joined: Friday 25 March 2016 22:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5248
Location: Paris, France
Contact:

Re: Blocky script need help

Post by Kerneldomoticz »

Thx for you fast answers !!! much appreciated.

i have the exact same config !!! and it doesn't work... even a simple if sensor is ON turn on light doesn't work ...

this is realyl weird.

ps: how do you get the blocky script to show like this .. mine has horizontal layout ...

FLo
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blocky script need help

Post by StanHD »

Right click the "and" block and set "external inputs". I find the logic much easier to follow like that.
Just a thought, assume as you are using "level%" that your switch is a dimmer type?
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
Kerneldomoticz
Posts: 40
Joined: Friday 25 March 2016 22:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5248
Location: Paris, France
Contact:

Re: Blocky script need help

Post by Kerneldomoticz »

Thx ;-) yes my switch is a dimmer type ;-)
Kerneldomoticz
Posts: 40
Joined: Friday 25 March 2016 22:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5248
Location: Paris, France
Contact:

Re: Blocky script need help

Post by Kerneldomoticz »

StanHD i don't know why but i think the main problem was a cache issue with firefox .... as soon as i started using chrome (clean cache) it worked right away !!! the script colours are now corret caus eif you ceck my first post time switches were not blue but green etc etc ...

well now everything is working like a charm ! and also Thx for the AND "external inputs" way better to work on Blocky scripts
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blocky script need help

Post by StanHD »

Glad you got it sorted
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
EddieT
Posts: 5
Joined: Monday 30 January 2017 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Manchester
Contact:

Re: Blocky script need help

Post by EddieT »

Hi stan,

How long do your light's activate for once triggered,
also which line is it in the fibaro config setting's that alters the on time.

Many thanks,

Eddie.

StanHD wrote:Hi,

The below Blockley uses FGMS001 to switch my Hall Lights using both the motion detection and the light level information. (I also have a dummy "Auto" switch to disable the automation when needed.)

Note:- The off delay settings etc. are set in the Z-Wave Hardware settings for the FGMS001

This all works very well for a year now.

Image
Raspi 2b, Aeon labs gen 5 Z stick, 2 x gen 5 fibaro multi sensor, Fibaro dual relay,
Foxx, Hue, RFXcom 433E, plus a few others.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blocky script need help

Post by StanHD »

Hi Eddie,

In my hallway I use the default 30 seconds, in other rooms 3 or 5 minutes. Set from parameter 6:-

6. Motion alarm cancellation delay:

Motion alarm will be cancelled in the main controller and the associated devices after the period of time set in this parameter. Any motion detected during the cancellation delay time countdown will result in the countdown being restarted. In case of small values, below 10 seconds, the value of parameter 2 must be modified (PIR sensor's "Blind Time"). Available settings: 1 - 65535 Default setting: 30 (30 seconds)

Hope that helps.

Stan
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
EddieT
Posts: 5
Joined: Monday 30 January 2017 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Manchester
Contact:

Re: Blocky script need help

Post by EddieT »

Hi Stan,

Blocky works great but when i change the setting in the sensor it reverts back to 30, i tried to change it
to 600, Then click the apply configuration to this device.

Also do you have to create a dummy switch for each blocky script, or can you use the same one for each.

Thanks,

Eddie.
Raspi 2b, Aeon labs gen 5 Z stick, 2 x gen 5 fibaro multi sensor, Fibaro dual relay,
Foxx, Hue, RFXcom 433E, plus a few others.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blocky script need help

Post by StanHD »

Eddie,

After you apply the setting the sensor needs to wake up before the value is applied. I have my wake up set to 1/2 hour, so that changes don't take too long to update. As an alternative you can wake the node up by pressing the button inside 3-4 times and applying the new setting then.

You can reference a single dummy auto/manual switch to as many scripts/blockly as you like, but I have one for each of mine just for versatility. For example you can use the built in timers to turn on and off the Auto function which is pretty handy for say a bedroom when you don't want the light coming on when you turn over in the middle of the night.

Stan.
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