Page 1 of 1

Blockly script "ghost triggered" without condition beeing met?

Posted: Wednesday 22 November 2023 20:46
by baustromverteiler
I have a blockly script to turn on/off a heating element if the average solar power return to the grid in the past 5 minutes exceeds 1000 watts, trigger type is set to device, it looks like this:
Screenshot 2023-11-22 203618.png
Screenshot 2023-11-22 203618.png (38.49 KiB) Viewed 2086 times
Now the script triggers every 5 minutes _without_ the condition being met (return to the grid beeing 0 at the moment), the logfile gives me these entrys on turn on / off:

2023-11-22 20:35:00.885 EventSystem: Event triggered: Heizstab_Ueberschuss_2
2023-11-22 20:35:00.911 RelaisboardEG2: Light/Switch (Heizstab Badezimmer)

2023-11-22 20:40:00.888 EventSystem: Event triggered: Heizstab_Ueberschuss_2
2023-11-22 20:40:00.928 RelaisboardEG2: Light/Switch (Heizstab Badezimmer)

Also strangely the script is named "Heizstab_Ueberschuss" and not "Heizstab_Ueberschuss_2" as it shows up in the log. I found another post where someone states that the number after the underline refers to the trigger type but I could not find any reference to this.

Any help to get rid of these ghost triggers is appreciated :)

regards, max

Re: Blockly script "ghost triggered" without condition beeing met?

Posted: Saturday 25 November 2023 17:18
by waltervl
What is the trigger you have defined (all, device, time etc)?
From the script it should be device. But from your issue you probably selected All which could lead it to be triggered every 5 minutes. But if you update the device every 5 minutes with another script it would lead to an update of the device and so trigger of your script.

https://www.domoticz.com/wiki/Blockly

Re: Blockly script "ghost triggered" without condition beeing met?

Posted: Saturday 25 November 2023 19:25
by willemd
I am no expert in blockly, I moved away from it to dzVents after some initial tries, but looking at your setup, I would expect:

1) you have something that calculates a 5 minute average and then updates a device
2) you have a blockly logic that must do something depending on the updated value, so it seems logical that it triggers after that update
3) then it checks the blockly logic and finds that 0<=999 and therefore switches heiztab badezimmer off

Is that not what your are seeing? Why do you consider it to be a ghost trigger?