dzVents noob question

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
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

dzVents noob question

Post by freijn »

Guys,

I am trying to step in the wonderfull world of dzVents and doing my first baby steps..

If I open de script editor the get the following example. Saving and activate for "device" don't do anyting.
I have changed the 'myDevice' into 'spare_grey' which is a test switch I play with. Nothing again.

Can you please help me understand what is the on = function for? ( I do see it with 1 min timer and understand it )
The goal is to have something happening ( a log entry in this case ) on a status change of my spare_grey switch.

next level question. same event but now for a text device.

Any help is welcome ! THanks Frank

Code: Select all

return {
	on = {
		devices = {
			'myDevice'
		}
	},
	execute = function(domoticz, device)
		domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
	end
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzVents noob question

Post by waaren »

freijn wrote: Friday 11 January 2019 16:42 If I open de script editor the get the following example. Saving and activate for "device" don't do anyting.
I have changed the 'myDevice' into 'spare_grey' which is a test switch I play with. Nothing again.
The script looks ok. Try with changing LOG_INFO to LOG_FORCE. If you switch the 'myDevice' switch to On or Off you should see a message in the log like

Code: Select all

2019-01-11 17:38:58.197 Status: dzVents: !Info: Device myDevice was changed
Can you please help me understand what is the on = function for? ( I do see it with 1 min timer and understand it )
The goal is to have something happening ( a log entry in this case ) on a status change of my spare_grey switch.
As described here
  • on = { ... }
    The on section tells dzVents when the execute function has to be executed. It holds all the events/triggers that are monitored by dzVents. If any of the events or triggers match with the current event coming from Domoticz, then the execute part of the script is executed by dzVents.
next level question. same event but now for a text device.
Nope. domoticz does not trigger an event for a text device.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: dzVents noob question

Post by freijn »

Many thanks for the fast response !
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest