Page 1 of 1

Event doesn't trigger automatically, only manually

Posted: Tuesday 29 December 2015 23:27
by bubbaphatass
Hi!

I'm quite new to home automation and Domoticz but I've been getting on OK and created quite a few blocky events, but I'm having an issue with one of them.

I understand I need to put in checks into the event to see if devices are on or not before continuing so that events aren't triggered every minute. With one event though, it doesn't trigger at all if I put this check in (Is light on?) unless I trigger the light on manually within Domiticz. If the light has been switched on by another event, it does't trigger.
Screen Shot 2015-12-29 at 22.14.49.png
Screen Shot 2015-12-29 at 22.14.49.png (30.93 KiB) Viewed 2948 times
Screen Shot 2015-12-29 at 22.15.18.png
Screen Shot 2015-12-29 at 22.15.18.png (14.73 KiB) Viewed 2948 times
This is how the event is now, obviously it turns the lights off every minute from 21:00. If I put in 'AND bathroom light = on' to the end of it, it doesn't trigger, even when all conditions are met.

If I click on the device to turn the light off and then on, the event then triggers.

Re: Event doesn't trigger automatically, only manually

Posted: Wednesday 30 December 2015 2:12
by mrf68
Hi bubbaphatass,

Question: does the other event that switches the light on, also update the status of ['Bathroom Lights'] in Domoticz?

The blockly in your first screenprint does not run every minute. It only runs whenever the ['Landing PIR'] or ['Bathroom Door Switch'] changes its state.
It will run every minute though if you add the statement that is shown in your second screenprint, because the time will change every minute.

Re: Event doesn't trigger automatically, only manually

Posted: Wednesday 30 December 2015 11:09
by bubbaphatass
Hi,

Thanks for the reply.

The images are from the same event, I couldn't view it all in one go to capture the images, so it does have the TIME part at the end. So every minute it turns off the Bathroom Lights (which is seen in the log). If I add 'AND Bathroom Lights = ON' to the end of this event to stop this triggering every minute, it doesn't trigger at all, even though the lights are on and showing on in Domoticz (unless I switch the light off then on in Domoticz manually) .

Yes the other event does change the status of Bathroom Lights within Domoticz.

Many thanks.

Re: Event doesn't trigger automatically, only manually

Posted: Thursday 31 December 2015 17:15
by mrf68
So if I understand it correctly: the script does work when you activate the switch manually in Domoticz, but when the other event activates the switch the script does not work? In that case the cause of the problem could be in that event. Is it a switch that is a slave for the main device?

Re: Event doesn't trigger automatically, only manually

Posted: Thursday 31 December 2015 18:34
by leby
If you right click on the IF statement and choose "External Input" it will be easier to see the full expression in one screen.
Not sure if its applicable in this case but there is a block on script triggering scripts....
Try to sett a variabel to ON with the Blockly instead of turning of the light, if that that works you can add a second Blockly that turns off the light if the variabel is set to for example ON (and change the variable to OFF). Not the most elegant solution but it could be a workaround..

Re: Event doesn't trigger automatically, only manually

Posted: Friday 01 January 2016 22:15
by bubbaphatass
mrf68 wrote:So if I understand it correctly: the script does work when you activate the switch manually in Domoticz, but when the other event activates the switch the script does not work? In that case the cause of the problem could be in that event. Is it a switch that is a slave for the main device?
Correct, that is the case when the event ends in
Screen Shot 2016-01-01 at 20.35.50.png
Screen Shot 2016-01-01 at 20.35.50.png (15.03 KiB) Viewed 2861 times
If I leave the end bit off, it triggers fine (but triggers every minute, which isn't really an issue but I was trying to keep the script efficient)

To clarify I have 3 events to control the bathroom light:

LandingPIR - Turns on the light for 1 minute if motion detected, it is dusk, bathroom lights are off and between certain times
DoorShut - Keeps the light on if the door is shut, it is dusk and between certain times, so that it doesn't turn of when someone is in the bathroom longer than 1 minute
LightsOff - Switches the lights off after 1 minute if no motion detected, Door open and between certain times

If I add 'and Bathroom light = ON' to LightsOFF, it does't trigger, unless I switch the light manually

Also, just to test, I added 'and Bathroom light = ON' to DoorShut script, it does't trigger, again unless I switch the light manually.

Re: Event doesn't trigger automatically, only manually

Posted: Tuesday 05 January 2016 15:38
by mrf68
Okay. I still keep askingquestions if you don't mind, because at this moment I still think that the problem is with the light turning on without manually switching it in Domoticz. That must be the first event you mention. Let's see:

The LandingPIR detects motion and all other requierements are met, so the light turns on. Does this part work?

When this happens, the status of the switch ['Bathroom Lights'] in the GUI of Domoticz should be 'On'. Is that the case?

I ask this because you could learn the code from the LandingPIR directly to the Bathoorm Lights receiver. The lights will go on, but Domoticz won't turn the switch in the GUI to On. And then when you check if it's On, it's not. Then when you add the check Bathroom Lights = On, that won't work, because to Domoticz the Bathroom Lights are Off.

If this is not the case, I think I'm out of options then. :(

Re: Event doesn't trigger automatically, only manually

Posted: Friday 15 January 2016 23:04
by bubbaphatass
mrf68 wrote:Okay. I still keep askingquestions if you don't mind, because at this moment I still think that the problem is with the light turning on without manually switching it in Domoticz. That must be the first event you mention. Let's see:

The LandingPIR detects motion and all other requierements are met, so the light turns on. Does this part work?

When this happens, the status of the switch ['Bathroom Lights'] in the GUI of Domoticz should be 'On'. Is that the case?

I ask this because you could learn the code from the LandingPIR directly to the Bathoorm Lights receiver. The lights will go on, but Domoticz won't turn the switch in the GUI to On. And then when you check if it's On, it's not. Then when you add the check Bathroom Lights = On, that won't work, because to Domoticz the Bathroom Lights are Off.

If this is not the case, I think I'm out of options then. :(
Sorry, almost forgotten about this!

Yes the LandingPIR part of it works

Yes it changes in the GUI of Domoticz

The PIR is not paired with anything - just used with Domiticz.

I'm not sure what the issue is either so have left the check if bathroom light is on out of the event, not efficient but it works.

Re: Event doesn't trigger automatically, only manually

Posted: Wednesday 20 January 2016 19:44
by bubbaphatass
I've just set up two new events and the same thing happens:
Pic1.png
Pic1.png (35.03 KiB) Viewed 2716 times
Screen Shot 2016-01-20 at 18.15.42.png
Screen Shot 2016-01-20 at 18.15.42.png (33.38 KiB) Viewed 2716 times
The first event runs fine and switches on the light. When the dusk sensor goes off, the second event doesn't trigger, unless I switch the light off then on manually in Domoticz, or remove the 'and light is on' check from the event as before.

It seems that if an event uses the status of a device that is changed by another event, it doesn't seem to trigger correctly.

Re: Event doesn't trigger automatically, only manually

Posted: Wednesday 20 January 2016 22:22
by bizziebis
You check if Outside Light = ON, when it actually has the status SET LEVEL 100.

Try to change your Blockly to:
.. AND 'Outside Light /= Off
DO ..

/= is the not equal to symbol.

Re: Event doesn't trigger automatically, only manually

Posted: Wednesday 20 January 2016 22:36
by bubbaphatass
Ta da! That seems to of worked. So although setting the light level turns it on and it shows as on in the GUI, the actual status used for triggering etc might not be 'ON' ?

I'll try changing my other scripts now...

Many thanks!