Update: dzVents 2.0 has been integrated again. This time it builds and runs on all platforms. Check out build v3.8023+.
=========================================
Hi all,
Happy to tell you all that as of today dzVents is integrated in Domoticz (beta v3.8023). Of course it is beta so I invite everyone to start trying and testing this version. Scott Linn and me worked hard in the past few weeks to come up with a great new release. dzVents is almost completely refactored and has loads of new features. On top of that you can now create and edit dzVents scripts using the built-in web-editor in Domoticz so you don't need file access at all to write event scripts.
So, this version of dzVents (internally versioned 2.0.0) does have a couple of breaking changes with prior versions. These changes require you to make a couple of minor changes to your scripts. They are listed in the change log which can be found in the all-new wiki page for dzVents.
Please take some time to read through the docs!
So... happy testing and using!! Hope you enjoy it.
Oh, on more thing: this also means that I plan to no longer update the separate GitHub version of dzVents.
From the 'Change log':
[2.0.0] Domoticz integration
- Almost a complete rewrite.
- BREAKING CHANGE: Accessing a device, scene, group, variable, changedDevice, or changedVariable has been changed: instead of doing domoticz.devices['myDevice'] you now have to call a function: domoticz.devices('myDevice'). This applies also for the other collections: domoticz.scenes(), domoticz.groups(), domoticz.changedDevices(), domoticz.changedVariables(). If you want to use the iterators like forEach, filter and reduce you do this: domoticz.devices().forEach(function() .. end). This change makes dzVents a whole lot faster in processing your event scripts. So please change your existing dzVents scripts!
- BREAKING CHANGE: after_sec, for_min, after_min, within_min methods have been renamed to the camel-cased variants afterSec, forMin, afterMin, withinMin. Please rename the calls in your script.
- BREAKING CHANGE: There is no longer an option to check if an attribute was changed as this was quite useless. The device has a changed flag. You can use that. Please change your existing scripts.
- BREAKING CHANGE: Many device attributes are now in the appropriate type (Number instead of Strings) so you can easily make calculations with them. Units are stripped from the values as much as possible. Check your scripts as this may break stuff.
- BREAKING CHANGE: on-section now requires subsections for devices, timer, variables, and security. The old way no longer works! Please convert your existing scripts!
- BREAKING CHANGE: Make sure that in Domoticz settings under Local Networks (no username/password) you add 127.0.0.1 so dzVents can use Domoticz api when needed.
- dzVents now works on Windows machines!
- dzVents is no longer a separate library that you have to get from GitHub. All integrated into Domoticz.
- Added option to create shared utility/helper functions and have them available in all your scripts. Simply add a helpers = { myFunction = function() ... end } to the global_data.lua file in your scripts folder and you can access the function everywhere: domoticz.helpers.myFunction().
- Created a pluggable system for device adapters so people can easily contribute by creating specific adapters for specific devices. An adapter makes sure that you get the proper methods and attributes for that device. See /path/to/domoticz/scripts/dzVents/runtime/device-adapters.
- Added a reduce() iterator to the collections in the domoticz object so you can now easily collect data about all your devices. See documentation about iterators.
- Variables (uservariables) have more attributes. The value is now the same type as it is defined in Domoticz. So no more need for a converted nValue attribute. You can inspect the type using myVar.type. If it is a time variable or date variable you an extra date or time attribute with the same methods as with all other date/time related attributes like lastUpdate. .E.g. myVar.date.minutesAgo.
- Settings are now moved to the Domoticz GUI (Setup > Settings > Other) and no longer in a settings file.
- You can now override the log settings per script. So you can turn-off logging globally (see log level in the settings) and still have debug-level logging for that one script you are working on. You can even add a prefix string to the log messages for easy filtering in the Domoticz log. See the documentation about the logging = { .. } section.
- No more need to do http-calls to get extended data from Domoticz. All relevant internal Domoticz state-data is now available inside your dzVents scripts. Thanks Scotty!!
- Support for many many more device types and their specific methods. See the documentation for the list of attributes and events that are available. Note that device-type specific attributes are only available for those type of devices. You will receive an error in the log if you try to access an attribute that doesn't exist for that particular device. Hopefully you don't have to use the rawData table anymore. If you still do please file a report or create a device adapter yourself.
- You can now write dzVents scripts using the internal editor in Domoticz. These scripts will be automatically exported to the filesystem (one-way only) so dzVents can execute them (generated_scripts folder). Thanks again Scotty!
- Support for variable change events (on = { variables = { 'varA', 'varB'} })
- Support for security change events (on = { security = { domoticz.SECURITY_ARMEDAWAY } })
- The triggerInfo passed to the execute function now includes information about which security state triggered the script if it was a security event.
- Extended the timer-rule with time range e.g. 'at 16:45-21:00' and 'at nighttime' and 'at daytime' and you can provide a custom function. See documentation for examples. The timer rules can be combined as well.
- Timer rules for 'every xx minutes' or 'every xx hours' are now limited to intervals that will reach *:00 minutes or hours. So for minutes you can only do these intervals: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20 and 30. Likewise for hours.
- The Time object (e.g. domoticz.time) now has a method matchesRule(rule). rule is a string same as you use for timer options: if (domoticz.time.matchesRule('at 16:32-21:33 on mon,tue,wed')) then ... end. The rule matches if the current system time matches with the rule.
- A device trigger can have a time-rule constraint: on = { devices = { ['myDevice'] = 'at nighttime' } }. This only triggers the script when myDevice was changed and the time is after sunset and before sunrise.
- Add support for subsystem selection for domoticz.notify function.
- Fixed a bug where a new persistent variable wasn't picked up when that variable was added to an already existing data section.