lua scripts not fired up

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
DonLeo
Posts: 6
Joined: Saturday 12 March 2016 17:00
Target OS: Raspberry Pi
Domoticz version: V4.9700
Location: Purmerend, Netherlands
Contact:

lua scripts not fired up

Post by DonLeo » Tuesday 10 July 2018 22:59

Hi there,

'Suddenly' if I change something in the setup, doesn't matter what, and I save the database my lua scripts are not fired up anymore, the Event system seems to be stopped. I have to load a previous version of domoticz.db to fire up the lua scripts again and are loosing report information.
Can someone tell me how I can check / restart the event system? or maybey my database is corrupt or...

Thxs, DonLeo

Version: 4.9700
Platform: Pi 2 with Strech Debian
Hardware: Aeon Zwave and self made RF link
------------------------
Raspberry Pi II + Image 4834
AeonLabs Z-stick 5
Domoticz Latest version

DonLeo
Posts: 6
Joined: Saturday 12 March 2016 17:00
Target OS: Raspberry Pi
Domoticz version: V4.9700
Location: Purmerend, Netherlands
Contact:

Re: lua scripts not fired up

Post by DonLeo » Friday 13 July 2018 22:49

Hi all,,

Solved the problem by myself.... I reinstalled from scratch.

Can close this topic
------------------------
Raspberry Pi II + Image 4834
AeonLabs Z-stick 5
Domoticz Latest version

User avatar
waaren
Posts: 925
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: lua scripts not fired up

Post by waaren » Friday 13 July 2018 22:56

DonLeo wrote:
Friday 13 July 2018 22:49
Hi all,,

Solved the problem by myself.... I reinstalled from scratch.

Can close this topic
@DonLeo,

did you find anything in the database or elsewhere in the domoticz environment that could have caused this ?
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

DonLeo
Posts: 6
Joined: Saturday 12 March 2016 17:00
Target OS: Raspberry Pi
Domoticz version: V4.9700
Location: Purmerend, Netherlands
Contact:

Re: lua scripts not fired up

Post by DonLeo » Tuesday 17 July 2018 22:39

Hi Waaren,

No, I found out, every time I saved the database, the setting of the Event System (LUA/BLOCKY/SCRIPTS) was reset (non active) so thats why there where no events in the log. I couldnt fixe this, so I started from scratch.

DonLeo
------------------------
Raspberry Pi II + Image 4834
AeonLabs Z-stick 5
Domoticz Latest version

cardy
Posts: 3
Joined: Tuesday 15 May 2018 11:47
Target OS: Linux
Domoticz version:
Contact:

Re: lua scripts not fired up

Post by cardy » Wednesday 18 July 2018 0:23

Version: 4.7900
Platform: Linux (Fedora 28)
Plugin/Hardware: Linux VM

I have a similar problem to the above my initial issue was the script I have would not run at all.

Code: Select all

return {
	logging = {
		level = domoticz.LOG_FORCE, -- Select one of LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_FORCE to override system log level
		marker = "TEST"
	},
	active = true,
	on = {
	    devices = {
	        581
	        }
	},
	execute = function(domoticz, mydevice)
	    domoticz.notify('Well it ran!', domoticz.PRIORITY_NORMAL)
		domoticz.log('Device ' .. mydevice.name .. ' was changed', domoticz.LOG_FORCE)
		if (mydevice.state == 'On') then
			domoticz.notify('Hey!', 'I am on!', domoticz.PRIORITY_NORMAL)
		end

		if (mydevice.state == 'Off'
		) then
			domoticz.notify('Hey!', 'I am off!', domoticz.PRIORITY_NORMAL)
		end
    end
}
I have enabled debug to level 5 and there were no errors.

Eventually I did the following after seeing comments about the switch for dzVents not working in other places.
  • Stop domoticz
  • Backup the database then use sqlite3 to access the database
  • Run the following SQL: UPDATE Preferences SET nValue = 0 WHERE Key = 'DisableDzVentsSystem';
This re-enabled dzVents but I now get the following error:

Code: Select all

Error: EventSystem: in /usr/bin/dzVents/runtime/dzVents.lua: cannot open /usr/bin/dzVents/runtime/dzVents.lua: No such file or directory
I don't know why its using /usr/bin

This is my process thats running:

Code: Select all

domoticz  4401     1  0 22:56 ?        00:00:06 /usr/bin/domoticz -www 8080 -sslwww 8443 -sslcert /var/lib/domoticz/domoticz.pem -sslpass -sslmethod -ssloptions -ssldhparam -wwwroot /usr/share/domoticz/www -dbase /var/lib/domoticz/domoticz.db -userdata /usr/share/domoticz/ -verbose 1 -log /var/log/domoticz.log -loglevel 5
I did read somewhere that WorkingDirectory should be set in systemd's service file, but in my case this is set.

Code: Select all

[Unit]
Description=Domoticz Home Automation Server

[Service]
User=domoticz
Group=domoticz
EnvironmentFile=/etc/sysconfig/domoticz
ExecStart=/usr/bin/domoticz -www $WWW_PORT -sslwww $SSL_PORT -sslcert $SSLCERT -sslpass $SSLPASS -sslmethod $SSLMETHOD -ssloptions $SSLOPTIONS -ssldhparam $SSLDHPARAM -wwwroot $WWW_ROOT -dbase $DBASE -userdata $USERDATA -verbose $VERBOSE -log $LOG -loglevel $LOGLEVEL
WorkingDirectory=/usr/share/domoticz
# Give the right to open priviliged ports. This allows you to run on a port <1024 without root permissions (user/group setting above)
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target
The Settings in /etc/sysconfig/domoticz are:

Code: Select all

WWW_PORT=8080
SSL_PORT=8443
SSLCERT="/var/lib/domoticz/domoticz.pem"
SSLPASS=""
SSLMETHOD=""
SSLOPTIONS=""
SSLDHPARAM=""
WWW_ROOT="/usr/share/domoticz/www"
DBASE="/var/lib/domoticz/domoticz.db"
USERDATA="/usr/share/domoticz/"
VERBOSE=1
LOG="/var/log/domoticz.log"
LOGLEVEL="5"

Any ideas why domoticz is using this path would be greatly welcomed I would love to get dzVents working but am a loss as to where this path comes from.

vikasaldana
Posts: 25
Joined: Sunday 26 August 2018 12:22
Target OS: Raspberry Pi
Domoticz version:

Re: lua scripts not fired up

Post by vikasaldana » Tuesday 04 September 2018 19:27

DonLeo wrote:
Tuesday 10 July 2018 22:59
Hi there,

'Suddenly' if I change something in the setup, doesn't matter what, and I save the database my lua scripts are not fired up anymore, the Event system seems to be stopped. I have to load a previous version of domoticz.db to fire up the lua scripts again and are loosing report information.
Can someone tell me how I can check / restart the event system? or maybey my database is corrupt or...

Thxs, DonLeo

Subway Surfers Psiphon Hill Climb Racing


Version: 4.9700
Platform: Pi 2 with Strech Debian
Hardware: Aeon Zwave and self made RF link
same here
After upgrading v. 3.5877 > v. 3.8153, all my Lua scripts stopped being triggered by their corresponding devices (Lua print function at the beginning of any Lua script not shown in logs anymore, so the scripts are not triggered at all, while the corresponding device status are still updated properly in Domoticz UI, no errors in log, only positive log entries from RfxCom / Enocean events).

Had to rollback to previous v. 3.5877 and all is working fine again.

Couldn't find any solution or workaround online for this issue on v. 3.8153, those found didn't help.

Could the Domoticz team explain if there are some new requirements related to Lua (expected version, script naming changes etc...) ? Or push / post a fix ?

My current Lua version : 5.1.5

Post Reply

Who is online

Users browsing this forum: RasPi2 and 4 guests