Today I thought it was about time to make a 1.0 release of dzVents. It has all the features that I wanted for a 1.0 release and some people successfully tested the dev branch so here we go.
For those of you who don't know what it is or if you are just starting to discover Lua scripting for Domoticz, here is an excerpt from the readme:
Please take some time to read the installation instructions. It's not difficult (and has some changes regarding the settings for those of you who already have settings). I have spent quite some time to document everything but of course it is still possible that some things aren't clear. Just let me know and I'll fix or explain it and don't forget to look at the examples.dzVents (|diː ziː vɛnts| short for Domoticz Easy Events) brings Lua scripting in Domoticz to a whole new level. Writing scripts for Domoticz has never been so easy. Not only can you define triggers more easily, and have full control over timer-based scripts with extensive scheduling support, dzVents presents you with an easy to use API to all necessary information in Domoticz. No longer do you have to combine all kinds of information given to you by Domoticzs in many different data tables. You don't have to construct complex commandArrays anymore. dzVents encapsulates all the Domoticz peculiarities regarding controlling and querying your devices. And on top of that, script performance has increased a lot if you have many scripts because Domoticz will fetch all device information only once for all your device scripts and timer scripts.
And... it is software so there's no guarantee there are no bugs but when there are, please report issues in the GitHub tracker. I'll respond quickly and usually fix problems right away.
For those of you who already used a previous version, these are the latest changes (from the history file):
[1.0][1.0-beta2]
- Deprecated setNew(). Use add() instead. You can now add multiple values at once in a script by calling multiple add()s in succession.
- Fixed printing device logs when a value was boolean or nil
- Fixed WActual/total/today for energy devices.
- Added updateSetPoint method on devices for dummy thermostat devices and EvoHome setpoint devices
- Added couple of helper properties on Time object. See README.
- Renamed the file dzVents_settings.lua to dzVents_settings_example.lua so you don't overwrite your settings when you copy over a new version of dzVents to your system.
- Added data persistence for scripts between script runs (see readme for more info)
- Added a time-line based data type for you scripts with historical information and many statistical functions for retreiving information like average, minumum, maximum, delta, data smoothing (averaging values over neighbours) etc. See readme for more information.
- Added SMS method to the domoticz object.
- Added toggleSwitch() method to devices that support it.
- Added more switch states that control device.bState (e.g. on == true, open == true 'all on' == true)
- Added secondsAgo to the lastUpdate attribute
- Added tests (test code coverage is above 96%!)
- Refactored code significantly.
- Made sure differently formulated but equal triggers in one script only execute the script only once (like MySensor and MySensor_Temperature).
- Added trigger info as a third parameter (Lua table) that is passed to the execute method of a script containing information about what exactly triggered the script (type = EVENT_TYPE_TIMER/EVENT_TYPE_DEVICE, trigger=<timer rule>). See readme.
- Added Lua time properties to domoticz.time property with all information about the current time (hours, minutes, seconds, etc.)
- Added option to return false in a forEach iteratee function which will abort the forEach loop.
- All devices not delivered by Domoticz to the event scripts are now added to domoticz.devices using the http data that is fetched every 30 minutes (by default).
- Added scenes and groups collections to the domoticz object
- Added Quick Reference Guide.