dzVents 2.4.0 merged into Beta v3.8837+

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

Moderator: leecollings

dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

dzVents 2.4.0 merged into Beta v3.8837+

Post by dannybloe »

Hi fellow dzVreaks!

As of version v3.8837 dzVents 2.4.0 is available. After many months of programming and testing we are proud to announce this major new release with loads of new cool features that will make your live as an event-scripter even more powerful and most importantly: a lot easier.

Before you read any further I want to emphasize that there is one easy-to-fix breaking change: the second parameter passed to the execute function is no longer nil when the script was triggered by a timer or a security event. Please check your scripts! The second parameter now has checks to determine the type. E.g. execute = function(domoticz, item) .. end. You can inspect item using: item.isDevice, item.isTimer, item.isVariable, item.isScene, item.isGroup, item.isSecurity, item.isHTTPResponse. Please read the documentation about the execute function.

So, without further ado let's go through some of the cool new features:

Asynchronous http requests
Yes, you just read it correctly! With dzVents 2.4.0 you can make an http request AND process the response data in a non-blocking way. So no longer you have to do os.execute('curl...') and do wizardry to process the response and have the results flow back into Domoticz (like virtual devices).

Let's look at this example. Here there's a script that issues an http request every 5 minutes and handles the response. The response is application/json and holds a temperature. The temperature will be passed to a virtual temperature device:

Code: Select all

return {
	on = {
		timer = {'every 5 seconds'},
		httpResponses = { 'sometrigger' }
	},
	execute = function(domoticz, item)
		if (item.isTimer) then
			domoticz.openURL({
				method = 'POST',
				postData = {
					location = 'outside' -- some param
				},
				url = 'http://some.domain/temperature',
				callback = 'sometrigger'
			})
		end
		if (item.isHTTPResponse) then
			-- we got back some data
			if (item.ok) then
				-- response is ok, we know it is json:
				local temp = item.json.outside.temperature
				domoticz.devices('Outside').updateTemperature(temp)
			end
		end
	end
}
What happens here is that the script tells Domoticz to do an http request (POST with parameters) with a callback trigger ('sometrigger'). After the script is finished, Domoticz will open the url and when the data is retrieved it will hand it over to dzVents together with the callback trigger. dzVents will then execute all the scripts that listen to this httpResponse trigger ('sometrigger'). In this case it is the same script that issued the openURL command. dzVents automatically detects the mime-type 'application/json' and turns it into a Lua table (item.json). In the example here the json response has an entry 'outside.temperature'. The temperature is used to update a virtual temperature device.

dzVents allows you to do POST and GET request with custom headers and parameters. Check out the documentation.

More timer trigger rules
You can now create timer triggers based on dates, date ranges, week numbers, week-number ranges etc:

Code: Select all

    on = {
	    timer = {
		'in week 12,44'              -- in week 12 or 44
		'in week 20-25,33-47'        -- between week 20 and 25 or week 33 and 47
		'in week -12, 33-'           -- week <= 12 or week >= 33
		'every odd week',
		'every even week',           -- odd or even numbered weeks
		'on 23/11',                  -- on 23rd of november (dd/mm)
		'on 23/11-25/12',            -- between 23/11 and 25/12
		'on 2/3-18/3',11/8,10/10-14/10',
		'on */2,15/*',               -- every day in February or
		                             -- every 15th day of the month
		'on -3/4,4/7-',              -- before 3/4 or after 4/7
	   },
   }
Cancel queued commands
Many have requested for a way to cancel commands that have been placed in the Domoticz command queue. For instance, if at some point you did mySwitch.switchOn().forSec(2).repeatAfterMin(20, 10) and later on you want to cancel the future switch commands (as this example will go on for more than 200 minutes) you can do mySwitch.cancelQueuedCommands().

Access to all devices in a group or scene
In dzVents 2.4.0 you get a devices collection in a scene or in a group:

Code: Select all

domoticz.scenes('myScene').devices().forEach(function(s)
	print(s.name .. ': ' .. s.state)
end)
-- or
domoticz.scenes('myScene').devices('windowLight).switchOn()
Now you can create and manage your groups in Domoticz' GUI and do all kinds of things with the group and its members in a script. No need to define arrays in your scripts anymore.

Timing options for update commands
You can now use commands like afterSec() or withinSec() for update commands. It is no longer limited to switches but now you can update a temperature device after a couple of seconds.

Better support for RGB(W) devices
You can now do commands like setKelvin(), setRGB(124,33,55), .setWhiteMode().

Easier filtering of devices
Many of you create a Lua table with device names that is used elsewhere in the script to filter devices. Now you can use the existing devices().filter() function to make that even easier:

Code: Select all

local livingLights = { 'window', 'couch', 33, 'table' }

-- loop over these devices:
domoticz
	.devices() -- all devices
	.filter(livingLights) -- filtered
	.forEach(function(light) -- loop over filtered devices
		light.switchOn()
	end)
	
-- note that this is one chained command splitted over multiple lines for
-- better readability!

Speed optimizations
We made many optimizations to make execution of scripts with dzVents even faster by grouping events that occure more or less at the same time and hand them over to dzVents at once. That way dzVents only has to initialize once. This significantly speeds up stuff on slower machines.

Updated documentation
In the wiki the documentation has been updated of course. All new features will have a 2.4.0 marker.

So, a lot of cool new stuff but there's more. Here's the full change log for this release:

Change log
  • **BREAKING CHANGE**: The second parameter passed to the execute function is no longer `nil` when the script was triggered by a timer or a security event. Please check your scripts. The second parameter has checks to determine the type. E.g. `execute = function(domoticz, item) .. end`. You can inspect `item` using: `item.isDevice`, `item.isTimer`, `item.isVariable`, `item.isScene`, `item.isGroup`, `item.isSecurity`, `item.isHTTPResponse`. Please read the documentation about the execute function.
  • Added ``.cancelQueuedCommands()`` to devices, groups, scenes and variables. Calling this method will cancel any scheduled future commands issued using for instance `.afterMin(10)` or `.repeatAfterMin(1, 4)`
  • Added `.devices()` collection to scenes and groups to iterate (`forEach`, `filter`, `reduce`, `find`) over the associated devices.
  • Added http response event triggers to be used in combination with `openURL`. You can now do `GET` and `POST` request and handle the response in your dzVents scripts **ASYNCHRONICALLY**. See the documentation. No more json parsing needed or complex `curl` shizzle.
  • Added a more consistent second parameter sent to the execute function. When a timer is triggered then the second parameter is a Timer object instead of nil. This way you can check the baseType of the second parameter and makes third parameter (triggerInfo) kind of obsolete. Every object bound to the second parameter now has a baseType.
  • Added locked/unlocked support for door-locks (locked == active).
  • Moved utility functions from the domoticz object to `domoticz.utils` object. You will see a deprecation warning when using the old function like `round()`, `toCelsius()` etc.
  • Added `lodash` as a method to `domoticz.utils`: `domoticz.utils._`
  • Added `toJSON` and `fromJSON` methods to domoticz.utils.
  • Added `afterXXX()` and `withinXXX()` support for device-update commands. E.g.: `myTextDevice.updateText('Zork').afterMin(2)`.
  • Added support for Logitech Media Server devices (thanks to Eoreh).
  • Added new timer rules: date rules: `on 13/07`, `on */03`, `on 12/*`, `on 12/04-22/09`, `on -24/03`, `on 19/11-`, week rules: `in week 12,15,19-23,-48,53-`, `every even week`, `every odd week`. See documentation.
  • Added historical data helper `delta2(fromIndex, toIndex, smoothRangeFrom, smoothRangeTo, default)` to have a bit more control over smoothing. You can specify if want to smooth either the start value (reference) and/or the to value (compared value).
  • Added historical data helper `deltaSinceOrOldest(timeAgo, smoothRangeFrom, smoothRangeTo, default)`. This will use the oldest data value when the data set is shorter than timeAgo.
  • Added support for Lighting Limitless/Applamp RGBW devices. You can now set Kelvin and RGB values, NightMode, WhiteMode and increase and decrease the brightness and discoMode. See the documentation.
  • Added device adapter for Onkyo receiver hardware.
  • Added `scriptName` to the triggerInfo object passed as the third parameter to the execute function. This holds the name of the script being executed.
  • Fixed bug in Domoticz where using forXXX() with selector switches didn't always work.
  • Fixed bug in Domoticz where improper states were passed to the event scripts. This may happen on slower machines where several devices may have been updated before the event-system had a change to operate on them. In that case the event scripts received the current final state instead of the state at the moment of the actual event.
  • Added support for webroot. dzVents will now use the proper API url when domoticz is started with the -webroot switch.
  • Added support for event-bursts. If (on slower machines) events get queued up in Domoticz, they will be sent to dzVents in one-package. This makes event processing significantly faster.
  • Added `domoticz.data.initialize(varName)`. This will re-initialize non-historical variables to the initial value as defined in the data section.
  • You now no longer have to provide an initial value for a persistent variable when you declare it. So you can do `data = { 'a', 'b', 'c'}` instead of `data = {a={initial = nil}, b={initial=nil}, c={initial=nil} }`. You have to quote the names though.
  • A filter can now accept a table with names/id's instead of only functions. You can now do `domoticz.devices().filter({ 'mySwitch', 'myPIR', 34, 35, 'livingLights'})` which will give you a collection of devices with these names and ids.
  • Added and documented `domoticz.settings.url`, `domoticz.settings.webRoot` and `domoticz.settings.serverPort`.
  • Removed fixed limit on historical variables if there is a limit specified.
Last edited by dannybloe on Friday 06 April 2018 8:54, edited 2 times in total.
Reason: Un-stick
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
blauwebuis
Posts: 331
Joined: Wednesday 21 December 2016 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: current
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by blauwebuis »

Cool. I'm curious: is this the engine under domoticz? Or is it something bolted on top?
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by poudenes »

Cool to see !!! Keep up the Good work !
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by anasazi »

Hi,

Did an upgrade of Domoticz to the newest beta and now the log is filled with this error:

Code: Select all

2018-01-24 20:49:52.839 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:52.948 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.011 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.058 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.089 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.152 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.277 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.417 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:53.495 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:56.980 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:57.495 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:57.542 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:58.933 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:49:59.308 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:50:00.170 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')
2018-01-24 20:50:00.686 Error: EventSystem: in C:\Program Files (x86)\Domoticz\dzVents\runtime\dzVents.lua: ...\Domoticz\scripts\dzVents\../../dzVents/runtime/Time.lua:185: bad argument #1 to 'date' (invalid conversion specifier '%V')

Do you know whats causing this?
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by anasazi »

Hi again,

In the Time.lua file I changed this section:

Code: Select all

	self.week = tonumber(os.date('%V', dDate))
to this:

Code: Select all

	self.week = tonumber(os.date('%W', dDate))
Now I don't get any errors but is it OK to use it or will it break something else?
elmortero
Posts: 247
Joined: Sunday 29 November 2015 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Spain
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by elmortero »

Hi dannybloe,

Great job, you have been making me curious for a while now about 2.4
I will be exploring the new features in-depth this weekend.

The Asynchronous HTTP requests in particular look promising as I have several of them fetching all kinds of data from Json!!
For now I have been using BakSeeDaa's solution for not clogging the system, as a matter of fact I have a second domoticz dealing with just this :lol:

Would be great to get a more detailed example as I will try to apply it to (amongst others) the one I shared in this post
If you would find a moment - between all the questions you will surely get now - to have a look at it to give some pointer, that would be apprecieated.

Thanks a lot for all your great work.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by emme »

I love dzVents, I love this work!!! this is something really amazing!!!!!

uh.. why I'm running 3.8834 and still get 2.3?

how can I get 3.5856+ ?
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
elmortero
Posts: 247
Joined: Sunday 29 November 2015 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Spain
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by elmortero »

emme wrote: Wednesday 24 January 2018 22:01 I love dzVents, I love this work!!! this is something really amazing!!!!!

uh.. why I'm running 3.8834 and still get 2.3?

how can I get 3.5856+ ?
Just update to the latest beta (3.8841) and you'll have it! :)
Eoreh
Posts: 65
Joined: Tuesday 13 October 2015 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by Eoreh »

I could not wait. Cool . Thank you very much, Your fantastic work. Keep it up !!!
Of course, the name of the topic for light processing. :D

RPI 3
Version: 3.8841
Build Hash: b86cc8ab
Compile Date: 2018-01-24 15:06:19
dzVents Version: 2.4.0

PS. A tiny mistake right now if I noticed well in the documentation 'on 23/11', - (2.4.0) on 23rd of november (dd / mm)

and it does not work for me 'on 25/01' but it works like 'on 25/1'
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by dannybloe »

anasazi wrote: Wednesday 24 January 2018 21:14 Hi again,

In the Time.lua file I changed this section:

Code: Select all

	self.week = tonumber(os.date('%V', dDate))
to this:

Code: Select all

	self.week = tonumber(os.date('%W', dDate))
Now I don't get any errors but is it OK to use it or will it break something else?
Mm, interesting.. turns out that %V to get the weeknumber doesn't work on all systems. It seems to be dependent on the compiler used to build the stuff.
%W doesn't solve this issue as it always starts with week 0 on jan 1st (sometimes it should be 53).
I'll update a fix asap.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by dannybloe »

Just merged 2.4.1 with Windows week-number fix and dd/mm fix for week rules. Thanks for reporting peeps.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by EddyG »

Nice this update. :D
Found only one problem so far.

Code: Select all

execute = function(domoticz, detector)
The detector.switchType for a Motion sensor is now sometime (not always) "On/Off"
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by emme »

...this is my personal opinion ater testing 2.4.1....

Image
The most dangerous phrase in any language is:
"We always done this way"
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by dannybloe »

:lol:
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by dannybloe »

EddyG wrote: Thursday 25 January 2018 14:57 Nice this update. :D
Found only one problem so far.

Code: Select all

execute = function(domoticz, detector)
The detector.switchType for a Motion sensor is now sometime (not always) "On/Off"
That's interesting.. Can you debug that and try to figure out when that happens and what's in domoticzData.lua (debug mode in scripts/dzVents)?

And post this as a bug report separately please (with the script perhaps).
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
anasazi
Posts: 43
Joined: Saturday 06 August 2016 9:53
Target OS: Windows
Domoticz version:
Location: Sweden
Contact:

Re: dzVents 2.4.0 merged into Beta v3.5876+

Post by anasazi »

dannybloe wrote: Thursday 25 January 2018 8:21
anasazi wrote: Wednesday 24 January 2018 21:14 Hi again,

In the Time.lua file I changed this section:

Code: Select all

	self.week = tonumber(os.date('%V', dDate))
to this:

Code: Select all

	self.week = tonumber(os.date('%W', dDate))
Now I don't get any errors but is it OK to use it or will it break something else?
Mm, interesting.. turns out that %V to get the weeknumber doesn't work on all systems. It seems to be dependent on the compiler used to build the stuff.
%W doesn't solve this issue as it always starts with week 0 on jan 1st (sometimes it should be 53).
I'll update a fix asap.
Hi,
I have installed the the update and it's working as expected.
Great job!
Thanks!
bdormael
Posts: 82
Joined: Saturday 13 December 2014 21:20
Target OS: Linux
Domoticz version:
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by bdormael »

Not sure if it's related to the update of DzVents 2.4, but since version 3.8837 my updateSetPoint commands are not working instant anymore but waiting to be applied when my thermostats awake.
With previous builds my thermostats where woken up instantly by doing updateSetPoint
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by dannybloe »

bdormael wrote: Thursday 25 January 2018 16:41 Not sure if it's related to the update of DzVents 2.4, but since version 3.8837 my updateSetPoint commands are not working instant anymore but waiting to be applied when my thermostats awake.
With previous builds my thermostats where woken up instantly by doing updateSetPoint
I doubt this is dzVents related but could you post a bug report so we can discuss it there? Together with the device specifics and if updating through the GUI does wake them up etc.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by EddyG »

dannybloe wrote: Thursday 25 January 2018 15:37
EddyG wrote: Thursday 25 January 2018 14:57 Nice this update. :D
Found only one problem so far.

Code: Select all

execute = function(domoticz, detector)
The detector.switchType for a Motion sensor is now sometime (not always) "On/Off"
That's interesting.. Can you debug that and try to figure out when that happens and what's in domoticzData.lua (debug mode in scripts/dzVents)?

And post this as a bug report separately please (with the script perhaps).
1 step further, did not (yet) setup debug.
But it seems that the Lux device has the detector.switchType of "On/Off"
the 3rd line is just a simple: print( '<b style="color:Red">>> ' .. detector.switchType )

Code: Select all

2018-01-25 16:47:59.048 (RaZberry) Lux (PIR Achterkamer Lux)
2018-01-25 16:47:59.251 dzVents: Info: ------ Start external script: intruder alert.lua: Device: "PIR Achterkamer Lux (RaZberry)", Index: 417
2018-01-25 16:47:59.251 dzVents: >> On/Off
2018-01-25 16:47:59.251 dzVents: Info: ------ Finished intruder alert.lua
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents 2.4.0 merged into Beta v3.8837+

Post by dannybloe »

EddyG wrote: Thursday 25 January 2018 16:50
dannybloe wrote: Thursday 25 January 2018 15:37
EddyG wrote: Thursday 25 January 2018 14:57 Nice this update. :D
Found only one problem so far.

Code: Select all

execute = function(domoticz, detector)
The detector.switchType for a Motion sensor is now sometime (not always) "On/Off"
That's interesting.. Can you debug that and try to figure out when that happens and what's in domoticzData.lua (debug mode in scripts/dzVents)?

And post this as a bug report separately please (with the script perhaps).
1 step further, did not (yet) setup debug.
But it seems that the Lux device has the detector.switchType of "On/Off"
the 3rd line is just a simple: print( '<b style="color:Red">>> ' .. detector.switchType )

Code: Select all

2018-01-25 16:47:59.048 (RaZberry) Lux (PIR Achterkamer Lux)
2018-01-25 16:47:59.251 dzVents: Info: ------ Start external script: intruder alert.lua: Device: "PIR Achterkamer Lux (RaZberry)", Index: 417
2018-01-25 16:47:59.251 dzVents: >> On/Off
2018-01-25 16:47:59.251 dzVents: Info: ------ Finished intruder alert.lua
Can you check if this is also the case if you query Domoticz using the api: ".../json.htm?type=devices&displayhidden=1&displaydisabled=1&filter=all&used=all"
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest