No logging of variable updates

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
jberinga
Posts: 67
Joined: Tuesday 11 August 2015 14:20
Target OS: NAS (Synology & others)
Domoticz version: 2024.7
Location: The Netherlands
Contact:

No logging of variable updates

Post by jberinga »

I have a Dzvents script that will update a user variable every minute and makes a note of the variable update in the log:
2026-02-11 13:51:00.735 Status: Set UserVariable nomotionCounter = 380

Is it possible not to update the log with (this) User variable updates? As this is information that I don't really need in the log.
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: No logging of variable updates

Post by waltervl »

What version of Domoticz are you on?
Do you have a log statement in your script?
What is the log settings in your script?
What are the log settings of dzvents in menu setup settings - other?

To play with logging check the logging dzvents template in the eventeditor

Code: Select all

-- This example shows you how to work with various log levels
--
-- The script is triggered by a dummy switch called 'test'
--
-- when no log level is specified, the level is taken from the default application settings (dzVents)
--
-- when you specify LOG_STATUS as minimum log level, no logs will be displayed when using LOG_INFO or LOG_DEBUG
--
-- Order is: LOG_DEBUG, LOG_INFO, LOG_STATUS, LOG_ERROR
--
-- LOG_DEBUG will also cause Execution Info to be displayed (start/finished)
--
return {
	on = {
		devices = {
			'test'
		}
	},
	logging = {
		marker = 'log_script',
		level = domoticz.LOG_DEBUG
	},
	execute = function(domoticz, device)
		domoticz.log('INFO log line!', domoticz.LOG_INFO)
		domoticz.log('STATUS log line!', domoticz.LOG_STATUS)
		domoticz.log('ERROR log line!', domoticz.LOG_ERROR)
		domoticz.log('DEBUG log line!', domoticz.LOG_DEBUG)
	end
}
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: No logging of variable updates

Post by waltervl »

I by the way just check in dzvents on myPIRdevice.lastUpdate.minutesAgo attribute. If that is longer then x minutes there is no movement for x minutes. No need to put it in a user variable.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jberinga
Posts: 67
Joined: Tuesday 11 August 2015 14:20
Target OS: NAS (Synology & others)
Domoticz version: 2024.7
Location: The Netherlands
Contact:

Re: No logging of variable updates

Post by jberinga »

My Domotizc version: v2025.2 (build 17076) and no log statements in this script.
In the settings the log settings of dzvents is enabled.

I was hoping that you could disable the log level of variables, like you can for devices on the hardware page.

This is the script:
Spoiler: show
return {
on = {
timer = { 'every minute' },
devices = { 'SensorMotionKeuken', 'Voordeur', 'NaarBed', 'EntertainmentUit' },
},

execute = function(domoticz)

if
domoticz.devices('SensorMotionKeuken').state == 'Off' and
domoticz.devices('EntertainmentUit').state == 'On'
then
domoticz.variables('nomotionCounter').set(domoticz.variables('nomotionCounter').value + 1)
end

if
domoticz.devices('IemandThuis').state == 'On' and
domoticz.variables('nomotionCounter').value == 10
then
domoticz.devices('IemandThuis').switchOff()
end

if
domoticz.devices('IemandThuis').state == 'On' and
domoticz.devices('NaarBed').state == 'On'
then
domoticz.devices('IemandThuis').switchOff()
end

if
domoticz.devices('IemandThuis').state == 'Off' and
(domoticz.devices('SensorMotionKeuken').state == 'On' or
domoticz.devices('Voordeur').state == 'Open')
then
domoticz.devices('IemandThuis').switchOn()
domoticz.variables('nomotionCounter').set(0)
end

if
(domoticz.devices('SensorMotionKeuken').state == 'On' or
domoticz.devices('Voordeur').state == 'Open' or
domoticz.devices('EntertainmentUit').state == 'Off') and
domoticz.variables('nomotionCounter').value ~= 0
then
domoticz.variables('nomotionCounter').set(0)
end

if
domoticz.devices('Thuis').state == 'On' and
domoticz.variables('nomotionCounter').value == 720
then
domoticz.devices('Thuis').switchOff()
end

if
domoticz.devices('Thuis').state == 'Off' and
(domoticz.devices('SensorMotionKeuken').state == 'On' or
domoticz.devices('Voordeur').state == 'Open')
then
domoticz.devices('Thuis').switchOn()
end

if
domoticz.devices('Opstaan').state == 'On' and
domoticz.devices('SensorMotionKeuken').state == 'On'
then
domoticz.devices('Opstaan').switchOff()
end

if
domoticz.devices('NaarBed').state == 'On' and
domoticz.devices('SensorMotionKeuken').state == 'On' and
domoticz.time.matchesRule('between 4:00 and 22:00')
then
domoticz.devices('NaarBed').switchOff()
end

end
}
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: No logging of variable updates

Post by waltervl »

Indeed that seems to be a system log and not a scripting log. As far as I know there is no possibility to switch off logging for user variables as it is not a hardware gateway.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
jberinga
Posts: 67
Joined: Tuesday 11 August 2015 14:20
Target OS: NAS (Synology & others)
Domoticz version: 2024.7
Location: The Netherlands
Contact:

Re: No logging of variable updates

Post by jberinga »

Okay, thanks for replying!
Maybe I will look for another way and your suggestion for myPIRdevice.lastUpdate.minutesAgo might work for me as well
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest