Page 15 of 36

Re: Blockly examples

Posted: Sunday 05 June 2016 22:06
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?

Re: Blockly examples

Posted: Thursday 09 June 2016 20:46
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 4587 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'

Re: Blockly examples

Posted: Thursday 09 June 2016 21:58
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 4538 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

Re: Blockly examples

Posted: Friday 10 June 2016 15:58
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

Re: Blockly examples

Posted: Saturday 11 June 2016 22:40
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)

Re: Blockly examples

Posted: Saturday 11 June 2016 22:59
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 4494 times

Re: Blockly examples

Posted: Saturday 11 June 2016 23:43
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..

Re: Blockly examples

Posted: Sunday 12 June 2016 17:47
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. :(

Re: Blockly examples

Posted: Sunday 12 June 2016 20:14
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

Re: Blockly examples

Posted: Sunday 12 June 2016 21:23
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.

Re: Blockly examples

Posted: Monday 13 June 2016 15:17
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

Re: Blockly examples

Posted: Monday 13 June 2016 17:53
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.

Re: Blockly examples

Posted: Saturday 18 June 2016 10:52
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?

Re: Blockly examples

Posted: Friday 24 June 2016 19:58
by micbou
bump

Re: Blockly examples

Posted: Saturday 25 June 2016 12:34
by dilepa
I also second, Time events not working at all... Am running the lastest beta 5271.
Is there a bug?

Re: Blockly examples

Posted: Sunday 26 June 2016 1:18
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.

Re: Blockly examples

Posted: Tuesday 12 July 2016 20:58
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

Re: Blockly examples

Posted: Thursday 04 August 2016 13:41
by juankar
Yes I've found that time triggered for Blockly doesn't work.

Re: Blockly examples

Posted: Friday 12 August 2016 3:15
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.

Re: Blockly examples

Posted: Sunday 14 August 2016 13:53
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