Error eventsystem

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Error eventsystem

Post by jacobsentertainment »

Recently I have this reoccurring error, I noticed that it always hapens at a full hour, i wouldnt think it's a specific script then it would be more common and irregular.
Does any have this issue and even more interesting a solution?

Code: Select all

 2023-02-03 00:00:10.767 Error: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 seconds
2023-02-03 04:00:10.576 Error: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 seconds
2023-02-03 11:00:10.373 Error: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 seconds
2023-02-03 13:00:10.964 Error: EventSystem: Warning!, lua script /home/pi/domoticz/dzVents/runtime/dzVents.lua has been running for more than 10 seconds 
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Error eventsystem

Post by waltervl »

Could be related to an event system script that runs something with an URL or OS command just when the hourly backup kicks in. Not really something to worry about but check your scripts and see if they use the asynchronous way of calling URL or OS commands.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
solarboy
Posts: 345
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: Error eventsystem

Post by solarboy »

I have a dzvents script that calls on another OS script that plays a long MP3 file. This will often throw this error. Also, like Walter says, during the hourly Domoticz backup.

Would be nice if we had the ability to schedule these backups as we see fit. I have now purposely made sure scripts never run on the hour for now.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Error eventsystem

Post by waltervl »

solarboy wrote: Monday 06 February 2023 0:48 I have a dzvents script that calls on another OS script that plays a long MP3 file. This will often throw this error. Also, like Walter says, during the hourly Domoticz backup.

Would be nice if we had the ability to schedule these backups as we see fit. I have now purposely made sure scripts never run on the hour for now.
Did you use the DzVents Asynchronous shell command execution in that script? https://www.domoticz.com/wiki/DzVents:_ ... tion_3.1.0
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
solarboy
Posts: 345
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: Error eventsystem

Post by solarboy »

I did, I've only ever used that way to call a system script.
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Re: Error eventsystem

Post by jacobsentertainment »

I found out that this error is from my camera script.
Is there a easier way to get and send the snapshots?


I use

Code: Select all

return {
    on = { 
       devices = { 620, },
    },
	logging = {
		level = domoticz.LOG_DEBUG,
		marker = 'PIR-cam script',
	},
    execute = function(domoticz, device)
        local home = domoticz.devices(65)
        local Deurbel = domoticz.devices(146)
         
        --if(device.state == 'On' and home.state == 'Off') then
        if device.state == 'On' then
            --device.switchOff().afterSec(1).checkFirst().silent()
		    local teleTok   = '#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**#' --Not sharing this ;-)
		    local chatId    = '#*#*#*#*#*#*#'
            local snapFile  = '/home/pi/domoticz/scripts/camera_'
            local domoReqA  = 'http://192.168.178.144/snapshot.jpg?user=admin&pwd=8974'
            local domoReqB  = 'http://192.168.178.248/snapshot.jpg?user=admin&pwd=8974'
            local domoReqC  = 'http://192.168.178.247/snapshot.jpg?user=admin&pwd=8974'
            local camNameA  = 'Oprit'
            local camNameB  = 'Voordeur'
            local camNameC  = 'Achterdeur'
            os.execute('wget -O "'..snapFile..camNameA..'.jpg" "'..domoReqA..'"')
            os.execute('wget -O "'..snapFile..camNameB..'.jpg" "'..domoReqB..'"')
            os.execute('wget -O "'..snapFile..camNameC..'.jpg" "'..domoReqC..'"')
            os.execute('curl -s -X POST "https://api.telegram.org/bot'..teleTok..'/sendPhoto?chat_id='..chatId..'" -F photo="@'..snapFile..camNameA..'.jpg"')
            os.execute('curl -s -X POST "https://api.telegram.org/bot'..teleTok..'/sendPhoto?chat_id='..chatId..'" -F photo="@'..snapFile..camNameB..'.jpg"')
            os.execute('curl -s -X POST "https://api.telegram.org/bot'..teleTok..'/sendPhoto?chat_id='..chatId..'" -F photo="@'..snapFile..camNameC..'.jpg"')
            os.execute("rm " ..snapFile..camNameA..'.jpg')
            os.execute("rm " ..snapFile..camNameB..'.jpg')
            os.execute("rm " ..snapFile..camNameC..'.jpg')
            --domoticz.notify("Camera", 'Beweging gedetecteerd bij de ' ..device.name.. '', domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "telegram")
        end
    end
}
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Error eventsystem

Post by waltervl »

If the camera is available in domoticz you can send it with dzvents snapshot() to email.

Code: Select all

snapshot(cameraID(s) or camera Name(s)3.0.13,subject): Function. 
Sends email with a camera snapshots if email is configured and set for attachments in Domoticz. 
Send 1 or multiple camerIDs -names in ; separated string or array.
    dz.snapshot()                  -- defaults to id = 1, subject domoticz
    dz.snapshot(1,'dz')            -- subject dz
    dz.snapshot('1;2;3')           -- ; separated string
    dz.snapshot({1,4,7})           -- table
    dz.snapshot('test;test2')      -- ; separated string
    dz.snapshot({'test', 'test2'}) -- table
But if you are on telegram use domoticz.executeShellCommand('some shell command') instead of os.Execute('some shell command')

https://www.domoticz.com/wiki/DzVents:_ ... _execution
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest