Hi all, as mentioned in some other threads, I've returned to some code for the Drayton Wiser smart home heating system. This uses a Wi-Fi connected controller and Zigbee connected TRV's and other assorted devices.
I have an older plain node.js module that I've been using for quite some time but a recent outage prompted me to get on and create a proper node that is easier to use, more consistent, lacking the old bugs and generally more robust.
Please understand that this is a first code push, suitable for some early tests only. However, it works! It connects to your controller and grabs a full set of data from the (rather simplistic) API every 60s. It does a bit of work to make the data a bit more consistent and to add a few extras for convenience. It then also does a "diff" against the previous API call and spits out a load of events - one for each property that changed.
There are two nodes. The main wiser
node defines and sets up the connection and starts the monitor. It also accepts a bunch of commands given as input messages, in return it spits out various information messages. With that, you can do things like list out any devices that are offline, any devices with low or no battery, rooms with temperatures above or below a given temperature (or all rooms that report their temperature) and a bunch of other stuff.
The 2nd node listens for one or more of the events that the main node spits out. You define one of the events and it outputs a message every time that event is fired. There is a list of available events in the README. You can also use wildcards in the event names. This lets you do specific things like monitor whether the controller is online or offline or general things like get the full data object every minute or just the change messages. Obviously you can also listen for errors and much more.
No controls yet I'm afraid, so you can't change room temperatures yet but that is coming.
A little longer in coming will be schedule handling.
By all means, take it for a ride and poke around the innards. Let me know what is wrong and if you want to see anything specific. There is a bit of a todo list in the changelog.
You may also be interested to node that this uses my "new" style of coding for Node-RED that uses a much clearer separation of functions along with a supporting singleton class library. It also makes extensive use of Gulp so that I can keep, particularly the html file, in logical pieces, using Gulp watch to constantly rebuild the main html file. A little overkill on this node which is relatively simple (except for the supporting class module) but a much nicer way of working than having everything munged together (in my OCD opinion anyway!)
As always, have fun! Catch you soon, Julian.