Page 1 of 2

dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Sunday 16 July 2017 20:12
by dannybloe
Hi folks,

Today Gizmocus merged an important pull request into Domoticz that should fix the high cpu load when dzVents is enabled on some (mostly slower) systems. Thanks to the hard and clever work of jvandenbroek and scottdj2! You guys are awesome and so helpful!! Thanks to them dzVents is now blazing fast and peeps who don't use it should not notice any speed differences even when it is enabled (not by default anymore!, don't forget to enable it in the settings!!).

On top of that I merged a couple of fixes and additions to the dzVents parts, enough to bump it to version 2.1.0 (using semver versioning). Even though dzVents is now an integral part of Domoticz I still like to give dzVents its own version numbering as I think this makes it easier to talk about it.

I also would like to thank people for all the positive feedback they gave me. All that makes it fun for me to work on it and keep working on it. I really hope that people enjoy writing scripts using dzVents and that even (at least some) Blockly users dare to cross the bridge to real coding (coz I truly believe that writing code is a lot easier than pushing along pieces of a hardly-readable puzzle.. but who am I? ;) ).

So, please keep posting feedback, questions, suggestions and even fixes and enhancements (coz it ain't ready yet and I'm sure there are plenty of hidden features (eh... bugs) in there). Also, dzVents relies heavily on device adapters that makes sure that interacting with your devices is indeed easy. However, as I don't have all the hardware myself, we rely on all of you with specific hardware to make sure all the necessary adapters are created. So, if you have a device and you don't see your specific attributes and methods in the docs, please let me know or write an adapter yourself (see the wiki on how to do that).

So, without further ado, here is the list of 2.1.0 changes:
  • dzVents is no longer enabled by default. So enable it in "settings > other" to use it.
  • Added support for switching RGB(W) devices (including Philips/Hue) to have toggleSwitch(), switchOn() and switchOff() and a proper level attribute.
  • Added support for Ampère 1 and 3-phase devices
  • Added support for leaf wetness devices
  • Added support for scale weight devices
  • Added support for soil moisture devices
  • Added support for sound level devices
  • Added support for visibility devices
  • Added support for waterflow devices
  • Added missing color attribute to alert sensor devices
  • Added updateEnergy() to electric usage devices
  • Fixed casing for WhTotal, WhActual methods on kWh devices (Watt's in a name?)
  • Added toCelsius() helper method to domoticz object as the various update temperature methods all need celsius.
  • Added lastLevel for dimmers so you can see the level of the dimmer just before it was switched off (and while is it still on).
  • Added integration tests for full round-trip Domoticz => dzVents => Domoticz => dzVents tests (100 tests). Total tests (unit+integration) now counts 395!
  • Fixed a bug setting 'uservariables'. Under the hood it still uses json api calls to update the uservariable in Domoticz otherwise you won't get uservariable event scripts triggered in dzVents.
  • Added dzVents version information in the Domoticz settings page for easy checking what dzVents version is being used in your Domoticz build. Even though it is integrated with Domoticz, it is handy for dzVents to have it's own heartbeat.
  • avg(), avgSince(), sum() and sumSince() now return 0 instead of nil for empty history sets. Makes more sense.
  • Fixed boiler example to fallback to the current temperature when there is no history data yet when it calculates the average temperature.
  • Use different api command for setting setPoints in the Thermostat setpoint device adapter.
Enjoy!

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Sunday 16 July 2017 20:25
by heggink
Open source at its best. I'll give it a go shortly! Thx guys!

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Sunday 16 July 2017 21:46
by Phantom
Thanks, great work :)

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Sunday 16 July 2017 22:09
by heggink
Muuuch better performance! Still a little jumpy here and there but expected and very workable. Now gradually replace my motherofallluascripts with individual scripts again. Yay!

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 17 July 2017 6:45
by EddyG
Thanks, excellent work. :D
I hope its gets integrated in production version of Domoticz soon. 8-)

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 17 July 2017 7:48
by dannybloe
EddyG wrote:Thanks, excellent work. :D
I hope its gets integrated in production version of Domoticz soon. 8-)
First we have to be sure this is stable enough.
And remember to always have backups enabled when you are using these beta builds ;)

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 17 July 2017 16:53
by randytsuch
Thanks for all the work Danny.
I was away last week, but am back now (vacation over :( ), so will update and try soon.

Randy

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 17 July 2017 22:15
by dlefol
Hello,

Thanks for this new version. It seems to work fine here so far.
The only small problems I've notices so far is a device type which does not seem to be handled:
dzVents: Error: Method switchOn is not available for device "Light_A" (deviceType=Lighting 1, deviceSubType=ARC). If you believe this is not correct, please report.
The same device was working fine with dzVent V1.0 so I guess it got lost in the migration (or I did a mistake when migrating my scripts but it seems fine except for that error log).

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 17 July 2017 22:37
by dannybloe
Could be yeah. There is now a more modular mechanism of dealing with different device types. Could you switch on debug mode logging for a little and post the piece in the file /path/to/domoticz/scripts/dzVents/domoticzData.lua that deals with this device?

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 18 July 2017 9:56
by dlefol
Hello,

Not sure I understoog properly what you wanted, but here is what I have in the domoticzDala.lua file concerning this device:

Code: Select all

   [87] = {
                ["timedOut"] = false;
                ["baseType"] = "device";
                ["deviceType"] = "Lighting 1";
                ["batteryLevel"] = 255;
                ["rawData"] = {
                };
                ["lastLevel"] = 0;
                ["name"] = "Light_A";
                ["data"] = {
                        ["maxDimLevel"] = 0;
                        ["_state"] = "Off";
                        ["_nValue"] = 0;
                        ["icon"] = "lightbulb";
                        ["hardwareID"] = 2;
                        ["hardwareType"] = "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver";
                        ["hardwareName"] = "RFXCOM";
                        ["hardwareTypeValue"] = 1;
                };
                ["switchType"] = "On/Off";
                ["subType"] = "ARC";
                ["description"] = "";
                ["deviceID"] = "70";
                ["id"] = 360;
                ["lastUpdate"] = "2017-07-18 09:39:50";
                ["changed"] = false;
                ["switchTypeValue"] = 0;
                ["signalLevel"] = 12;
        };
Let me know if you need anything else :)

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 18 July 2017 10:38
by dannybloe
Ah, yeah, that was what I meant.
I have been digging a bit in the Domoticz code and I have now a better idea on how I can enhance the device adapters for dzVents to make it support more hardware.

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 24 July 2017 11:52
by DewGew
I got this when I try to change my dummy switch "Hemma":
2017-07-24 11:42:20.345 Error: dzVents: Error: Method switchOn is not available for device "Hemma" (deviceType=Lighting 1, deviceSubType=X10). If you believe this is not correct, please report.
Is it a bug or do I need to change anything?

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Monday 24 July 2017 12:02
by dannybloe
In the upcoming update this will be fixed. In the mean time you could re-create your switch using dummy hardware. Then it will be recognized as a switch.

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 11:12
by DarkAllMan
Sorry, wrong forum!

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 11:14
by dannybloe
DarkAllMan wrote:I have a problem that

Code: Select all

ping_success=os.execute('ping -c1 -w1 ' .. ip)
is no longer working when I run Domoticz as a service.
Running manually (./domoticz) it does execute the ping.
The service is configured like this:

Code: Select all

[Unit]
       Description=domoticz_service
       After=network.target
[Service]
       User=username
       Group=username
       ExecStart=/home/username/domoticz/domoticz -www 8080
       WorkingDirectory=/home/username/domoticz
       CapabilityBoundingSet=CAP_NET_BIND_SERVICE
       Restart=on-failure
       RestartSec=1m
       KillMode=process
       #StandardOutput=null
[Install]
       WantedBy=multi-user.target
Is that in any way related to dzVents? If not then please start another thread (perhaps in Bugs). Otherwise please explain what the relation is.

Cheers,
Danny.

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 16:25
by marton
Hi,

Thanks for the new version and the integration. It's been great and already started to migrate all my other lua scripts to dzVents as well.
However I noticed when I update a variable, domoticz.variables('Test').set('1') it doesn't keep the type of the variable, but rather changes it to integer. If I set up a variable as string with the content '0' and then update it with dzVents it changes it to integer and updates the value. Am I doing something wrong?

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 16:33
by dannybloe
No I don't think so. This should have been fixed in 2.1.0. Can you see what version of dzVents is active in your domoticz build? (settings > other > dzVents, should show 2.1.0).

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 16:51
by marton
dannybloe wrote:No I don't think so. This should have been fixed in 2.1.0. Can you see what version of dzVents is active in your domoticz build? (settings > other > dzVents, should show 2.1.0).
My bad, I was running v3.8087m which didn't have 2.1.0 dzVents. Just updated to the latest beta and now everything works! Thanks again for dzVents, it is amazing!

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 17:28
by dannybloe
Thanks :)

Re: dzVents 2.1.0 released in beta v3.8088 (and onwards)

Posted: Tuesday 25 July 2017 18:47
by ednl
I'm trying to switchOn a Hue-group with dzVents 2.1.0.. :

2017-07-25 18:21:00.455 Error: dzVents: Error: Method switchOn is not available for device "Group Eetkamer" (deviceType=Lighting Limitless/Applamp, deviceSubType=RGBW). If you believe this is not correct, please report.
I'm on Domoticz Version: 3.8134

Thanks..