Page 12 of 16

Re: Events system feedback thread

Posted: Friday 04 October 2013 17:04
by mbliek
Is it possible to add support for taking a camera snapshot with lua?

Re: Events system feedback thread

Posted: Friday 04 October 2013 17:56
by CopyCatz
Set a trigger to a dummy device in the cam setup and trigger the dummy in lua?

Re: Events system feedback thread

Posted: Sunday 03 November 2013 0:07
by anderssan
Hi,

I think it would be a good idea to have weekdays and weekends in the blocky

Re: Events system feedback thread

Posted: Thursday 14 November 2013 1:06
by davidw
Hi,

I'm trying to create a blockly script which detects if my server is down. With Lua a ping is performed every minute, when it's a succes it's switches "DUM Ping" on. If it's a fail, it's switches "DUM Ping" off.

The Lua part works perfectly. The blockly part however won't start and it has to do something with the time part. The time part's purpose is for not getting notifications at night when the server is turned off.

What's wrong?
PingConroe.PNG
PingConroe.PNG (19.13 KiB) Viewed 3712 times

Re: Events system feedback thread

Posted: Thursday 14 November 2013 9:49
by gertjuhh
When having a time span over midnight use OR instead of AND (for time time part obviously)

Re: Events system feedback thread

Posted: Thursday 14 November 2013 14:11
by bistoury
gertjuhh wrote:When having a time span over midnight use OR instead of AND (for time time part obviously)
Not sure OR statement in the time part would be ok, because you will EVER be >= 9 AM or <= 1 AM... So you'll be notified regardless of the time it is....


Regards

Re: Events system feedback thread

Posted: Thursday 14 November 2013 15:06
by gertjuhh
Nope, try it out and you'll see
Look at it like this: a day is from 00:00 - 23:59

This covers the time from 00:00 - 01:00
TIME <= 01:00
This covers the time from 09:00 - 23:59
TIME >= 09:00

So a time can't be >= 09:00 AND <= 01:00
Therefore, use OR

Re: Events system feedback thread

Posted: Thursday 14 November 2013 17:12
by davidw
gertjuhh wrote:When having a time span over midnight use OR instead of AND (for time time part obviously)
That did the trick. Thanks!

Re: Events system feedback thread

Posted: Friday 15 November 2013 11:56
by commodore white
anderssan wrote:I think it would be a good idea to have weekdays and weekends in the blocky
Some of this was discussed in the old forum. The problem is that weekends are not standard across the globe or in everyones working habits. My barber's weekend is Sunday and Monday, for example.

Domoticz application settings would need to have a setting that defined which days of the week constituted a weekend. The developers didn't take my suggestion so weekends can't really be used. It's a shame. It would be nice to just have to change what your weekends were in one place rather than everywhere if you did shift work, for example. Sigh.

Hmmm, just a thought. Why not have a virtual device called "Weekend" say, and knock up a script that turns it on on Friday evening and off on Monday morning. It's then a simple matter to test the device - simplez. You could also turn on the device by hand if you had a day at home midweek or switch it off if you had a weekend away.

Re: Events system feedback thread

Posted: Friday 15 November 2013 22:17
by bistoury
I've learned something new, thanks !
obviously blocky logic is somehow...not that logic !

Re: Events system feedback thread

Posted: Thursday 12 December 2013 18:43
by mbliek
A question about this blocky:
Blocky_slapen.png
Blocky_slapen.png (43.66 KiB) Viewed 3608 times
The alarm only needs to be deactivated when I press the switch "slapen" to off.
But when the dummy switch "licht/donker" (light/dark) change to off, the Alarm will also deactivated when "slapen" is off.

How can I make this happen?

Re: Events system feedback thread

Posted: Friday 13 December 2013 17:55
by laugscom
Hi,

I tried this simple blocky, to test if i can use my X10 motion detector to switch on a lamp.
The X10 pir has status Motion / No Motion , i can't see this in the "blocky" selection screen.
Is there a way to get it working with blocky?
Event sample.jpg
Blocky
Event sample.jpg (41.3 KiB) Viewed 3594 times

Re: Events system feedback thread

Posted: Wednesday 18 December 2013 23:22
by mobisat
I have a LUA query for implementing a "Delay ON" function

commandArray = {}
if (devicechanged['Boiler on/off'] == 'Off' then
Wait 5 mins <<<<<<how do I do that part??
commandArray['Boiler off only']='On'
end
return commandArray



This way every time my boiler turns off via the device timer, it will wait say 5 mins then turn on my dummy switch to turn off the boiler, in case the first command wasn't sent/received

Re: Events system feedback thread

Posted: Wednesday 18 December 2013 23:49
by mbliek
mobisat wrote:I have a LUA query for implementing a "Delay ON" function

commandArray = {}
if (devicechanged['Boiler on/off'] == 'Off' then
Wait 5 mins <<<<<<how do I do that part??
commandArray['Boiler off only']='On'
end
return commandArray



This way every time my boiler turns off via the device timer, it will wait say 5 mins then turn on my dummy switch to turn off the boiler, in case the first command wasn't sent/received

You could try if you use domoticz on a raspberry:

commandArray = {}
if (devicechanged['Boiler on/off'] == 'Off' then
os.execute('sleep 300')
commandArray['Boiler off only']='On'
end
return commandArray

Re: Events system feedback thread

Posted: Thursday 19 December 2013 1:12
by mobisat
@mbliek,

Thanks for the reply, unfortunately the os.execute('sleep 300') doesn't appear to be a usable option as the system basically froze for those 5 minutes. Surely there must be some sort of on delay after all we have off delays on the switches side. Seems a simple option but not so easy to implement :(

Re: Events system feedback thread

Posted: Thursday 19 December 2013 1:20
by alfred_j_kwak
Make another dummy switch with off delay. Switch this new dummy on when first dummy goes off. After delay new dummy goes off and send additional off command for boiler.

-Jussi-

Re: Events system feedback thread

Posted: Thursday 19 December 2013 10:14
by l0gic
I'm using the command 'On For x' for randomly switching my lights on for while I'm away.
I've not checked but is there a Off in equivalent?

If I get a minute I'll take a look.

Kevin

Re: Events system feedback thread

Posted: Thursday 19 December 2013 10:35
by l0gic
OK, I knocked up a quick script to test it but it's a bit strange.
I set up a commandArray['myDevice'] = 'Off IN 5'
but it didn't trigger, the device remained on.
However the script did not error either.

Perhaps someone who has used scripting more than me will have an insight.....

Kevin

Re: Events system feedback thread

Posted: Saturday 21 December 2013 3:31
by mongoose
Took me a while, I thought that the blocky system was not working for me, I wanted a light to come on when the door was open, little did I know that when you set the klik aan klik uit AMST 606 door sensor you have to use on / off in blocky instead of open / closed, hope this helps anyone else that is a bit stuck with this :)

Re: Events system feedback thread

Posted: Sunday 05 January 2014 16:36
by willie-p
I've made a blocky event for security purposes.
So I've a couple of sensors and a dummy switch called alarm. If alarm is on and sensor is on then trigger the fire alarm (panic).

The only "problem" is that the fire alarm is on for a few seconds. What I would like to have the alarm on continuously until the dummy switch is turned off.

Thank you in advance!
Will