Blockly examples

Moderator: leecollings

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:and its weird because below does work

Schermafbeelding 2016-06-05 om 22.03.06.png
And if you try this with a fixed time?
So when the "door?" is open on that time?
User avatar
BullHead
Posts: 11
Joined: Sunday 05 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8771
Location: Oxelösund/Sweden
Contact:

Re: Blockly examples

Post by BullHead »

Hi,
can anyone explain why this doesn't work?
Event not working
Event not working
Skärmavbild 2016-06-09 kl. 20.40.47.png (12.38 KiB) Viewed 4586 times
Simplest event there can be and it's not working.
I'm not able to get any event to work that i have tried.
Timers working fine but not events :cry:
I found a similar post earlier but no solution for the problem.

I'm actually getting this error in the logg

Code: Select all

2016-06-09 20:59:00.497 Error: EventSystem: Lua script error (Blockly), Name: test_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'NaN'
Best regards
Jonas
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Blockly examples

Post by Minglarn »

BullHead wrote:Hi,
can anyone explain why this doesn't work?
Skärmavbild 2016-06-09 kl. 20.40.47.png

Simplest event there can be and it's not working.
I'm not able to get any event to work that i have tried.
Timers working fine but not events :cry:
I found a similar post earlier but no solution for the problem.

I'm actually getting this error in the logg

Code: Select all

2016-06-09 20:59:00.497 Error: EventSystem: Lua script error (Blockly), Name: test_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'NaN'
That's strange...
However, seems to me that you are using wrong kind of logic...
Skärmklipp.PNG
Skärmklipp.PNG (6 KiB) Viewed 4537 times
And this is from the log:

Code: Select all

 2016-06-09 21:55:00.435 EventSystem: Event triggered: 01 - Test_1
2016-06-09 21:55:02.427 (RFXCOM) Lighting 2 (N1 - Lampa Groventre) 
Using Domoticz V3.5228
Build Hash: 76374d0
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
User avatar
BullHead
Posts: 11
Joined: Sunday 05 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8771
Location: Oxelösund/Sweden
Contact:

Re: Blockly examples

Post by BullHead »

Minglarn wrote:
That's strange...
However, seems to me that you are using wrong kind of logic...
Skärmklipp.PNG

And this is from the log:

Code: Select all

 2016-06-09 21:55:00.435 EventSystem: Event triggered: 01 - Test_1
2016-06-09 21:55:02.427 (RFXCOM) Lighting 2 (N1 - Lampa Groventre) 
Using Domoticz V3.5228
Build Hash: 76374d0
What kind of logic should I use?
How did you get the bluish "Time field"?

I think i have found whats causing the problem...
I use a Raspberry Pi B+ with no built in WiFi so i have used a USB WiFi.
Tp-Link TL-WN725N V2.... i have to install the drivers manually for that device.

So i tried with a fresh install of Domoticz and skipped the WiFi part and now everything is working again! :P
Best regards
Jonas
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 »

I doubt it has anything to do w/ the wifi. I have a RPi3 and not using WiFi, but nothing with time is working for me (still)
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 »

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
Schermafbeelding 2016-06-11 om 22.58.58.png (58.61 KiB) Viewed 4493 times
Thomasdc
Posts: 133
Joined: Wednesday 11 March 2015 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Blockly examples

Post by Thomasdc »

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..
User avatar
BullHead
Posts: 11
Joined: Sunday 05 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8771
Location: Oxelösund/Sweden
Contact:

Re: Blockly examples

Post by BullHead »

micbou wrote:I doubt it has anything to do w/ the wifi. I have a RPi3 and not using WiFi, but nothing with time is working for me (still)
Well I have tried four times and as soon as i plug in the usb wifi events stop working.
Not able to get it to work unless i use a fresh img. :(
Best regards
Jonas
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 »

Maybe a shot in the dark but is the time on you're router right? Maybe as soon as you place the WiFi stick the system time gets altered.

Verstuurd vanaf mijn SM-G925F met Tapatalk
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 »

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.
pluggin
Posts: 45
Joined: Tuesday 26 May 2015 22:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Argentina
Contact:

Re: Blockly examples

Post by pluggin »

Minglarn wrote:
BullHead wrote:Hi,
can anyone explain why this doesn't work?
Skärmavbild 2016-06-09 kl. 20.40.47.png

Simplest event there can be and it's not working.
I'm not able to get any event to work that i have tried.
Timers working fine but not events :cry:
I found a similar post earlier but no solution for the problem.

I'm actually getting this error in the logg

Code: Select all

2016-06-09 20:59:00.497 Error: EventSystem: Lua script error (Blockly), Name: test_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'NaN'
That's strange...
However, seems to me that you are using wrong kind of logic...
Skärmklipp.PNG

And this is from the log:

Code: Select all

 2016-06-09 21:55:00.435 EventSystem: Event triggered: 01 - Test_1
2016-06-09 21:55:02.427 (RFXCOM) Lighting 2 (N1 - Lampa Groventre) 
Using Domoticz V3.5228
Build Hash: 76374d0
I use this kind of logic for one of my lamp and work fine. My Domoticz version V3.5113
Razberry + 4 Eversrping HSM02 + 2 Aeotec Multi-Sensor + 1 Aeotec Micro Dimmer + 4 Aeotec Micro Smart Energy Switch, 2nd + 1 Remotec ZXT-120 + 1 Aeotec Smart Energy Monitor + 1 Everspring SE812 indoor Siren + 2 fibaro motion sensor + Aeotec water sensor
User avatar
BullHead
Posts: 11
Joined: Sunday 05 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8771
Location: Oxelösund/Sweden
Contact:

Re: Blockly examples

Post by BullHead »

Skippiemanz wrote:Maybe a shot in the dark but is the time on you're router right? Maybe as soon as you place the WiFi stick the system time gets altered.

Verstuurd vanaf mijn SM-G925F met Tapatalk
I just checked the router time.... it's the same as on my computers.

thanks for input and ideas.
Best regards
Jonas
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 solution yet... so any blocky events involving time don't work plus Im still looking for a way to keep my lights on unless there hasnt been movement in a room for >15mins.

Anybody?
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 »

bump
dilepa
Posts: 8
Joined: Thursday 16 June 2016 6:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by dilepa »

I also second, Time events not working at all... Am running the lastest beta 5271.
Is there a bug?
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 »

dilepa wrote:I also second, Time events not working at all... Am running the lastest beta 5271.
Is there a bug?
I opened an issue on the Github, but it got closed right away directing me to this forum. Still seems like a bug of some sort to me.
Hokkie001
Posts: 4
Joined: Monday 27 June 2016 23:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by Hokkie001 »

micbou wrote:
dilepa wrote:I also second, Time events not working at all... Am running the lastest beta 5271.
Is there a bug?
I opened an issue on the Github, but it got closed right away directing me to this forum. Still seems like a bug of some sort to me.
Me to! I've experience with Indigo Domotica software (OSX) and there's a virtual (countdown) switch you can set for eg. 15 minutes and can be triggered by time/events/sensors/etc... After x minutes you can set an action (lights off), but you can set a second condition trigger (again the motion sensor by example) to reset the timer to 15 minutes again. This routine repeats itself over and over again until this 15 min reached 0 min. Off course this countdown timer runs again when the first condition triggers the timer

I found this 'variable':
viewtopic.php?t=6565
juankar
Posts: 221
Joined: Saturday 30 August 2014 20:20
Target OS: Linux
Domoticz version: 4.
Location: Spain
Contact:

Re: Blockly examples

Post by juankar »

Yes I've found that time triggered for Blockly doesn't work.
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Blockly examples

Post by tozzke »

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.
This should do the trick:
Image
edit to suit your needs
The variable is to prevent retriggering. Once the 2nd line triggers and the 10 second timer on 'TESTlamp1' starts, it'll be "over written" once 'TESTknop' is activated again within these 10 seconds. This results in activating 'TESTlamp1' once again but since it was already on, it won't really matter anyway. This also cancels the 10 second timer.
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Blockly examples

Post by desertdog »

After a power failure all Philips Hue lights are turned on at 100%. So I build this script to notify me if this happens and autmatically turns the lights. The function is based on all lights being on between sunrise and sundown, a situation that would never happen being set manually, no matter how dark and stormy a day is as there are also some colored moodlights which are never turned on during the day
Attachments
hue_off.png
hue_off.png (90.8 KiB) Viewed 3891 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest