Openzwave for toon, towards zone control

Everything about software tools, new software development and toolchains. For developers, mostly.

Moderators: marcelr, TheHogNL, TerrorSource, Toonz

Openzwave for toon, towards zone control

Postby marcelr » Mon Dec 18, 2017 8:05 pm

One of the missing features of toon is zone control. While it should be easy to implement, if you follow the discussions at the toon forum a little, Quby are apparently not interested. From the same forum, it is clear that some Eneco customers are very interested in zone control.

So am I.

After ploughing through the zwave code of toon (hdrv_zwave) I couldn't find the slightest inkling towards zwave controlled TRV's, so (at least for now) I decided to follow a parallel path: openzwave, and a separate zwave controller. Some time ago already, I bought an Aeontec Z-Stick gen 5, which is a USB z-wave+ controller. Last weekend I compiled the latest stable release of the openzwave library (1.4.164) for Toon, and a kernel with (among others) the cdc_acm module. Just an hour ago, I installed the library and its dependencies on a toon, together with the kernel module, plugged in the z-stick, ran the example program MinOZW that comes with openzwave, and hey presto, it works!

Now I need to buff up my C++ capabilities and build the code to talk with my TRV's (a bunch of Danfoss LC13's). Will keep you posted.
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby Toonz » Mon Dec 18, 2017 9:48 pm

while you're at it, also consider rebuilding qt-gui with your C++ magic so we can use it in our QML apps :-)
member of the Toon Software Collective
User avatar
Toonz
Forum Moderator
Forum Moderator
 
Posts: 1088
Joined: December 2016

Re: Openzwave for toon, towards zone control

Postby Rudolf » Tue Dec 19, 2017 5:07 pm

What's the advantage of having this integrated on Toon?

I'd love to be able to use Toon's internal Z-wave controller for this; but adding a dongle to the thermostat in the living room would not be my preferred approach.
Please elaborate on why you are going this route.

Kudos on the attempt though, this is some pretty bad-ass Toon-hacking. :D
Rudolf
Member
Member
 
Posts: 116
Joined: December 2017

Re: Openzwave for toon, towards zone control

Postby marcelr » Tue Dec 19, 2017 9:01 pm

Rudolf wrote:What's the advantage of having this integrated on Toon?


The internal zwave controller is controlled by Quby's code. You can't have two processes handling its I/O interface simultaneously at any given time. The kernel won't let you.
The code handling the internal zwave interface (which BTW is just a serial port) is closed source, with support just for the stuff that Quby allows us to use. The zwave library is linked statically into this hdrv_zwave binary, which is stripped, so it's not very accessible.
Passing you own zwave instructions through the interface is in theory possible, if we can manage to inject our own commands into the interface. It can be done, have tested some of it already, but it's not easy, and requires an extra executable plus all data handling separate from toons own code. Then again, I'm not yet sure how the zwave protocol/controller handles extra inclusions into its network, that are not supported by the software on top.
Mind you, the static zwave library supports all interfaces, so the code for handling them is there, it's just not used in toon's own code.

And then, I'm not an expert on zwave. By using the openzwave library, and my own interface, that I have full control of, at least I can learn how this stuff works, what goes in and what results a specific input generates.

Rudolf wrote:I'd love to be able to use Toon's internal Z-wave controller for this; but adding a dongle to the thermostat in the living room would not be my preferred approach.
Please elaborate on why you are going this route.


See above. I envisage a two-step process: first get the zoning to work with a separate zwave controller to get complete understanding of the processes involved, when that's all done, see how the functionality can be integrated into the existing zwave controller. Since a non-working setup is far less fun to work on than a functional one, I go for the extra dongle first :-).

And, I can do the development and testing on my laptop, without having to pass everthing at every attempt to toon. Saves a LOT of time.

Rudolf wrote:Kudos on the attempt though, this is some pretty bad-ass Toon-hacking. :D


It's no big deal, really, just a rebuild of the kernel and a bunch of modules, and a custom build of the openzwave library. Nothing fancy (yet) :mrgreen:
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby marcelr » Wed Dec 20, 2017 7:32 pm

On another note: it should also be possible to reroute toon's zwave interface to the USB dongle, and run the openzwave stuff through the native zwave interface. Just to test interchangeability of interfaces and commands. This might make the inner workings of the interfaces a bit clearer.
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby Rudolf » Tue Jan 09, 2018 10:29 am

Wouldn't it be possible to compile socat for Toon and share the zwave-serial device over TCP.
This would break Toon's Zwave, but will allow control by i.e. domoticz or home assistant.

I have used socat before to share my rfxcom over the network.
And it has been used for zwave as well: https://github.com/bodiroga/zwave-socat-gateway

I don't own a zwave-controller yet, socat would save me a few quid and with Toon it would also be placed in a central location in the house. Hidden in plain sight.

Does this sound like a feasible option? If so I might be able to compile it myself, are there any updated instructions for the build-env around?

P.s.: If you need help with the C++ I might be able to help out.
Rudolf
Member
Member
 
Posts: 116
Joined: December 2017

Re: Openzwave for toon, towards zone control

Postby marcelr » Tue Jan 09, 2018 11:50 am

Thanks. It's fairly easy to inject zwave instructions into the connection between the driver and the zwave module inside Toon. The C++ is more or less a learning experience for me, so for now, I'll see how far I can get. The route I plan to take is to generate the zwave instructions by libopenzwave, and inject them into the serial connection. I still have to figure out how zwave inclusion and storage of the information is handled, but I don't see that as a large hurdle. For development, I'll stick to the aeontec stick for a while, although it has stability issues (or my resets are inadequate).
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby marcelr » Fri Jan 19, 2018 9:06 pm

Made a small step again.

Besides libopenzwave, I now have built ozwcp (open zwave control panel). It's not functional yet, but at least the code can be passed through the oe-toolchain without hiccups. Will need to do some more tweaking to make it fully functional. The bad News is that my z-stick has kicked the bucket, so now I'm forced to develop everything directly on toon. The good News is that ozwcp (when it's working) provides a barebones webinterface, so connection to toon's qt-gui should be straightforward.
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby marcelr » Tue Jan 23, 2018 7:52 pm

Quite a large step this time:

I have openzwave and ozwcp (open zwave control panel) working on Toon, and tested zwave functionality. It works as is to be expected, with Toon's own zwave controller.
Now I need to find a way to split the data from Toon's native zwave driver from the openzwave part, so as to not interfere with the power and gas readings. This will take some time, but as I said earlier, it can be done. The actual injection is easy, finding out timing and signal routing is another story.

I also added the first Danfoss LC13 to Toon's zwave network, and I can control it from the control panel. So communication etc. works.
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby Rudolf » Wed Jan 24, 2018 1:19 pm

Neat. Thanks for reporting progress.
Rudolf
Member
Member
 
Posts: 116
Joined: December 2017

Re: Openzwave for toon, towards zone control

Postby BOverdevest » Mon Apr 02, 2018 9:09 pm

Very interesting thread/project as I would like to implement a zone control as well.

What is your intended end game?

- most smart TRV's (like the LC-13) do not feed back the actual temperature.
Do you intend to stop at controlling set-points from Toon?
Or include (if available) alternative temperatures measurements in the zone and ensure closing of any off sets between .

- When there is a 'heat demand' from a TRV, while the reference room is at set point, the zone will not get any heat.
Is it possible to send an Opentherm command to start the boiler/pump? Or will you temporarily increase the Toon set point?
If the reference room has a smart TRV as well and is at set point(!), would it make sense to temporary reduce the set point to ensure the valves closes to prevent an over shoot?

Looking forward to an update on your endeavour...
B Overdevest
Rooted Toon, Raspberry 3B+, Domoticz
BOverdevest
Starting Member
Starting Member
 
Posts: 16
Joined: February 2018
Location: Delft

Re: Openzwave for toon, towards zone control

Postby marcelr » Tue Apr 03, 2018 11:51 am

Hi BOverdevest,

These are all good questions.

The level of progress is not that far yet. Currently, I'm at the point where I have two concurrent processes talking to the zwave controller. Seems to be working OK-ish, although stability is still an issue.

The next step is implementation of a gui interface so as to be able to set things and have control of the zwave controller through toon only. Toonz and I are looking into this, but progress is slow, due to an awful lot of other things that need attending. Interfacing with the openzwave lib is facilitated by ozwcp, a demo program with a web interface for external control. This web interface has a hard time talking to toons qt gui. Before anything else, this needs to be resolved first.

Control of the TRV's should be straightforward, because indeed, I will have TRVs on all my radiators, including the ones in the room where toon resides (the local TRVs). Because TRVs don't report temperature in general, the trick will be to look at the boiler temperature difference to assess whether any room is still extracting heat from the heating system, before switching the local TRVs to their final setpoint (equalling the toon room temp setpoint). This will require quite some experimenting, though. And even then, it will be a very local solution (as in "Works for me"), because the heating conditions vary per house, per user, so finding a general rule on how to control such TRVs will be a tough challenge. No wonder Quby haven't implemented it yet.
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv

Re: Openzwave for toon, towards zone control

Postby WickedMaster » Mon Nov 19, 2018 1:44 am

Looks like a nice project. Currently I'm gathering some information about my Comet Z-Wave TRV, I'm trying to connect it to the Toon. Did you manage to add your TRV through the OCWCP by using the /dev/ttymxc2 interface?
User avatar
WickedMaster
Member
Member
 
Posts: 67
Joined: November 2018

Re: Openzwave for toon, towards zone control

Postby marcelr » Mon Nov 19, 2018 8:00 pm

Yes, that works for me. I have Danfoss LC-13 TRVs. Control through toon software is still something to be developed.
marcelr
Global Moderator
Global Moderator
 
Posts: 1052
Joined: May 2012
Location: Ehv


Return to Toon software development

Who is online

Users browsing this forum: No registered users and 1 guest