Event doesn't trigger automatically, only manually
Moderator: leecollings
-
- Posts: 7
- Joined: Tuesday 29 December 2015 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Event doesn't trigger automatically, only manually
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.
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.
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.
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
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.
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.
-
- Posts: 7
- Joined: Tuesday 29 December 2015 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Event doesn't trigger automatically, only manually
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.
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
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?
-
- Posts: 98
- Joined: Monday 28 July 2014 9:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Stockholm
- Contact:
Re: Event doesn't trigger automatically, only manually
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..
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..
/lennart
-
- Posts: 7
- Joined: Tuesday 29 December 2015 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Event doesn't trigger automatically, only manually
Correct, that is the case when the event ends inmrf68 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?
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
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.
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.
-
- Posts: 7
- Joined: Tuesday 29 December 2015 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Event doesn't trigger automatically, only manually
Sorry, almost forgotten about this!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.
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.
-
- Posts: 7
- Joined: Tuesday 29 December 2015 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Event doesn't trigger automatically, only manually
I've just set up two new events and the same thing happens:
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.
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.
- bizziebis
- Posts: 182
- Joined: Saturday 19 October 2013 14:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8805
- Location: The Netherlands
- Contact:
Re: Event doesn't trigger automatically, only manually
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.
Try to change your Blockly to:
.. AND 'Outside Light /= Off
DO ..
/= is the not equal to symbol.
-
- Posts: 7
- Joined: Tuesday 29 December 2015 22:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Event doesn't trigger automatically, only manually
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!
I'll try changing my other scripts now...
Many thanks!
Who is online
Users browsing this forum: No registered users and 1 guest