Page 9 of 16

Re: Events system feedback thread

Posted: Wednesday 07 August 2013 14:22
by gertjuhh
I think you misunderstood me, my proposition is actually not that complex.
Events already have a boolean/checkbox "Event active", all I'm suggesting is being able to toggle that boolean from within a (nother) event.

Another valid example of where this could be used:
Event A: Rain sensor (not sure if these work yet) current rainfall > 1mm AND bedroom windows sensor = open --> Send notification + disable "Event A"
Event B: Rain sensor current rainfall = 0mm OR bedroom window senor = closed --> enable "Event A"
This way you wouldn't get a notification each time the rain sensor checks in.

Blockly gives a LUA error

Posted: Wednesday 07 August 2013 14:44
by willie-p
ls,

I've made a blockly event which should work in my opinion but I look at my log I see:
Error: Wed Aug 07 14:43:22 2013 Lua script error: [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: ')' expected near 'comparevariable'

What am I doing wrong?

Re: Events system feedback thread

Posted: Wednesday 07 August 2013 15:05
by Dynamic
+1 for gertjuhh's idea!

Re: Events system feedback thread

Posted: Friday 09 August 2013 16:39
by willie-p
ls,

Could still use some help on the post above.
Any idea anyone?

Cheers,
Will

Re: Events system feedback thread

Posted: Friday 09 August 2013 16:59
by macaidwin
You can use a 'fake' lightswitch for this. This switch tells the event if it should check the rainfall or not.
Event A: If rain > 1mm AND window = open AND lightswitch=ON then send mail AND switch lightswitch=OFF
Event B: If rain < 1mm OR window = closed then lightswitch=OFF
Something like that
Only thing is, that something has to reset the situation. You have to play with it until it is right.

Re: Events system feedback thread

Posted: Friday 09 August 2013 17:00
by maxtrash
I've made some basic blocky script to interface with Eventghost. Eventghost can receive events and payloads using the webserver plugin. I can send them this way, but I would like the payload to be a dim-value (e.g. create a virtual dimmer device).
Image
would this be possible in blockly?

if not, what is the corresponding LUA-statement for Open URL? If I understand correctly internally domoticz changes blockly into lua, right?

Re: Events system feedback thread

Posted: Friday 09 August 2013 17:04
by gertjuhh
macaidwin wrote:You can use a 'fake' lightswitch for this. This switch tells the event if it should check the rainfall or not.
Event A: If rain > 1mm AND window = open AND lightswitch=ON then send mail AND switch lightswitch=OFF
Event B: If rain < 1mm OR window = closed then lightswitch=OFF
Something like that
Only thing is, that something has to reset the situation. You have to play with it until it is right.
The whole point of my suggestion is not having to create a fake switch for such events.
That way you don't clutter up your whole system with fake switches, and as an extra bonus the events system will be (theoretically) faster.

Re: Events system feedback thread

Posted: Friday 09 August 2013 17:08
by macaidwin
gertjuhh wrote:
macaidwin wrote:You can use a 'fake' lightswitch for this. This switch tells the event if it should check the rainfall or not.
Event A: If rain > 1mm AND window = open AND lightswitch=ON then send mail AND switch lightswitch=OFF
Event B: If rain < 1mm OR window = closed then lightswitch=OFF
Something like that
Only thing is, that something has to reset the situation. You have to play with it until it is right.
The whole point of my suggestion is not having to create a fake switch for such events.
That way you don't clutter up your whole system with fake switches, and as an extra bonus the events system will be (theoretically) faster.

Okay and you can't manage to make 1 complex event with every check in it, you want?
I made these events: http://www.domoticz.com/forum/viewtopic ... t=20#p1118
With checks that prevent the events from repeating itself because of values that keep steady for hours.

Re: Events system feedback thread

Posted: Friday 09 August 2013 17:18
by gertjuhh
macaidwin wrote:
gertjuhh wrote:
macaidwin wrote:You can use a 'fake' lightswitch for this. This switch tells the event if it should check the rainfall or not.
Event A: If rain > 1mm AND window = open AND lightswitch=ON then send mail AND switch lightswitch=OFF
Event B: If rain < 1mm OR window = closed then lightswitch=OFF
Something like that
Only thing is, that something has to reset the situation. You have to play with it until it is right.
The whole point of my suggestion is not having to create a fake switch for such events.
That way you don't clutter up your whole system with fake switches, and as an extra bonus the events system will be (theoretically) faster.

Okay and you can't manage to make 1 complex event with every check in it, you want?
I made these events: http://www.domoticz.com/forum/viewtopic ... t=20#p1118
With checks that prevent the events from repeating itself because of values that keep steady for hours.
Sure you can solve a problem multiple ways, my addition would give you one more, one i myself happen to prefer.
But you seem to be missing the point here...
I'm merely making a suggestion which could improve the events system.

I shared my thoughts, given my argumentation, let's just leave it at that.

Re: Events system feedback thread

Posted: Friday 09 August 2013 19:17
by macaidwin
It's okay, I get your point to switch events on and of using another event.
I am not a programmer, but I think it is not easy to programm this. So that's why I tried to help with other ideas.

Re: Events system feedback thread

Posted: Sunday 11 August 2013 1:49
by asjmcguire
willie-p wrote:ls,

Could still use some help on the post above.
Any idea anyone?

Cheers,
Will
Will - unless I have missed an announcement somewhere (which is quite possible with so much activity happening across the forum) I don't think the Blockly editor supports working with scenes yet?

Re: Events system feedback thread

Posted: Sunday 11 August 2013 9:00
by bistoury
I can confirm blocky works with scene

to run a scene named "SCENE1" you have to add a block such as : set SCENE1 = ON

et voila !

cheers,

bistoury.

Re: Events system feedback thread

Posted: Sunday 11 August 2013 16:05
by Skippiemanz
I'am experimenting with the event system.

Looking very promising. But when i try to get my foscam fi9821 PTZ cam to a default preset when a door sensor is triggerded using the follwoing url:

192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Kamer&usr=xxxxx&pwd=xxxxxx

I get an error when trying to save the event. if i shorten the url in halve i can save the event without problems.

the url after the saving atempt looks like this: 192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi?

Is this a setting in the database or something else?

Re: Events system feedback thread

Posted: Sunday 11 August 2013 16:33
by hemmelot
Hi Guys, first of all my compliments for this great piece of software.

I ran into a problem with the following:
I have a virtual switch (controlled via XBMC, this works) and a dimmer (also works).

Code: Select all

IF virtualswitch=ON AND dimmer=ON
DO set dimmer level to 30%
ELSE IF virtualswitch=OFF AND dimmer=ON
DO set dimmer level to 80%
This won't work.
Losing the "AND dimmer=ON" makes it work, but i only want XBMC to control the light if the dimmer/lamp is on because during daytime i don't want it on (dimmer is on a after sunset timer).

Any ideas?

Re: Events system feedback thread

Posted: Sunday 11 August 2013 17:13
by pepijn
I'am trying to create a nice presence simulation in Blockly, some questions

1) Is it possible to start a sequence (turn of the lights, turn on dimmer hallway, turnoff dimmer hallway, turn on bathroom etc) on a random time? I know you can do this for one switch but is would be nice if this can be done for a bunch actions.

2) Can you add a wait/delay block? So Switch 1 --> Wait 1 min --> Switch 2 etc?

Re: Events system feedback thread

Posted: Monday 12 August 2013 12:24
by sebquid
I'am experimenting with the event system.

Looking very promising. But when i try to get my foscam fi9821 PTZ cam to a default preset when a door sensor is triggerded using the follwoing url:

192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Kamer&usr=xxxxx&pwd=xxxxxx

I get an error when trying to save the event. if i shorten the url in halve i can save the event without problems.

the url after the saving atempt looks like this: 192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi?

Is this a setting in the database or something else?
I have got the same issue (see my post http://www.domoticz.com/forum/viewtopic.php?f=15&t=246) and I think It is because blocky doesnt' accept "&" symbol in the URL... Let me know if you managed to save your event without the "&"

Re: Events system feedback thread

Posted: Monday 12 August 2013 14:47
by robpow
what happens if you change

Code: Select all

192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Kamer&usr=xxxxx&pwd=xxxxxx
to

Code: Select all

192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint%26name=Kamer&26usr=xxxxx%26pwd=xxxxxx
?

Matt

Re: Events system feedback thread

Posted: Monday 12 August 2013 16:40
by Skippiemanz
The link works ok when i try it in my chrome browser.

But unfortunetly i still cant save the event.

Still get the same error and the link is shortened at the same place

Re: Events system feedback thread

Posted: Monday 12 August 2013 17:28
by robpow
What if you urlencode all the special characters like this?

Code: Select all

192.168.xxx.xx:xxxxxx/cgi-bin/CGIProxy.fcgi%3Fcmd%3DptzGotoPresetPoint%26name%3DKamer%26usr%3Dxxxxx%26pwd%3Dxxxxxx

Re: Events system feedback thread

Posted: Monday 12 August 2013 17:52
by Skippiemanz
Hmm still not saving.

Also the url doesnt work an gives me a 404 error.

Any more ideas?