I have created two events (blockly scripts I guess...)
I have a Aeon Gen5 multi sensor.
The first script: if lux < 50 and movement = on then set group (lighting) = on
The second script: if lux > 50 or movement = off then set group (lighting) = off
Fairly simple, but now in the logging of the group lighting I see hundreds of events. In most cases off, off, off, off, off etc. But also on, on, on etc.
Now I don't think this will really cause an issue, but perhaps there is something I can do better. Can I improve this?
Group logging flooded because of script
Moderator: leecollings
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Group logging flooded because of script
You should also check the status of the group. When it's on it's not needed to put it on again.
-
Plantje
- Posts: 451
- Joined: Friday 16 October 2015 7:58
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Group logging flooded because of script
Sounds logical
Will do
-
Plantje
- Posts: 451
- Joined: Friday 16 October 2015 7:58
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Group logging flooded because of script
Hmmm... I don't think I can check an entire group if it is on or off... so I took the status of one light of the group. Seems to work. Thanks!
-
Plantje
- Posts: 451
- Joined: Friday 16 October 2015 7:58
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Group logging flooded because of script
Ok... that works for switching on the lights... And to some extend it works for switching off as well... the log is not flooded anymore, but the lights are not switching off as well. I have done two attempts for this...what am I missing?
Attempt 1:
I added the brackets because that is how I nested them. This doesn't flood the logging.
Attempt 2:
The second attempt is still flooding the log. That is still strange I think.
Both scripts switch off the light now because the Lux > 50. I tried setting that to 1500 in the script at the moment, but every time I switch on the light using Domoticz right now (I am currently doing that remote) it switches off immediately. So it seems while I switch on the light this way it does work.
For switching on I've got
That seems to be working fine and I guess it is because Movement "switching" to On does actually trigger something. If there has not been any movement for 4 minutes the "switch" goes to off without triggering the event...right?
So, there are still two issues:
-How come the log is still flooding with code attempt two? It shouldn't get to the second "If..do" logic while the light is off.
-How come if I trigger the light to switch on by moving around in the room, leave the room, seeing the movement "switch" go to off then the light doesn't switch off?
Attempt 1:
Code: Select all
If ((Movement = off OR Lux > 50) AND Light = On)
Do Light = OffAttempt 2:
Code: Select all
If (Lux > 50 OR Movement = off)
Do If Light = On
Do Light = Off
Both scripts switch off the light now because the Lux > 50. I tried setting that to 1500 in the script at the moment, but every time I switch on the light using Domoticz right now (I am currently doing that remote) it switches off immediately. So it seems while I switch on the light this way it does work.
For switching on I've got
Code: Select all
If Light = Off AND (Lux < 50 AND Movement = On)
Do Light = OnSo, there are still two issues:
-How come the log is still flooding with code attempt two? It shouldn't get to the second "If..do" logic while the light is off.
-How come if I trigger the light to switch on by moving around in the room, leave the room, seeing the movement "switch" go to off then the light doesn't switch off?
-
Plantje
- Posts: 451
- Joined: Friday 16 October 2015 7:58
- Target OS: Windows
- Domoticz version:
- Contact:
Re: Group logging flooded because of script
Looked into this once again as some of my lights were not switching off. I had set them to switch of either if there is (no movement detected or the lux > 65) and if the KaKu light is set to more than (for example) 10%. However, it only does work if I alter the script to switch off in case (no movement is detected or the lux > 65) and if the KaKu light is not "off"
Who is online
Users browsing this forum: No registered users and 1 guest