Variable Logs

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

Moderator: leecollings

Post Reply
User avatar
maximaxi
Posts: 9
Joined: Sunday 17 April 2016 13:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Pavia Italy
Contact:

Variable Logs

Post by maximaxi »

Goodmorning everyone
I'm a bit of a domoticz but I really like it I'm probably missing in a glass of water.
I would like to be able to display the value of some variables in the log window using a dzevent script
can you give me suggestions Thanks

Image

Image
snuiter
Posts: 67
Joined: Saturday 17 June 2017 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Variable Logs

Post by snuiter »

Hi maximaxi,

did you check the forum on DzVents - Variables ?
http://www.domoticz.com/wiki/DzVents:_n ... iables.29

As an example I use this command to set a variable with DzVents.

Code: Select all

domoticz.variables('XiaomiMP3').set(10004)
You could start with an example DzVent script from the editor built in domoticz and start from there and play with using dummy button or time script that start the script and as a result display your variable value.

Good luck
User avatar
maximaxi
Posts: 9
Joined: Sunday 17 April 2016 13:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Pavia Italy
Contact:

Re: Variable Logs

Post by maximaxi »

Thank you for your quick answer
writing to us in the variable is not a problem, but to visualize the state I did several tests without success.
I have to see an example otherwise I will not get there
snuiter
Posts: 67
Joined: Saturday 17 June 2017 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Variable Logs

Post by snuiter »

This is a simple script to print the value of one of my variables

Code: Select all

return {
	on = {
		timer = {'every minute'},
		},
	execute = function(domoticz, triggeredItem)
	    
	            print(domoticz.variables('XiaomiMP3').value)  
	end
}
output in the log : 2018-08-29 17:02:00.095 Status: dzVents: 10002

10002 is the value of my variable.

Try this and change the variable name XiaomiMP3 into your own variable name, it should then report every minute in your log
User avatar
maximaxi
Posts: 9
Joined: Sunday 17 April 2016 13:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Pavia Italy
Contact:

Re: Variable Logs

Post by maximaxi »

;) thank you very much
It is true that sometimes we lose a trivial thing
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest