I've just completed testing of my first node-red module. You can use the nodes of this module to control and monitor the Energenie MiHome radio based smart devices such as adapters, sockets, lights and relays on a Raspberry Pi with an ENER314-RT board installed using node-red. This is instead of operating the devices using a MiHome Gateway.
There are 4 nodes in total:
- 'Blue' for switching 'Control Only' (OOK) based devices
- 'Pink' for monitoring MiHome 'Monitor' devices
- 'Purple' for monitoring and controlling 'Control & Monitor' devices
- 'Green' for sending any OOK or FSK raw byte array (Advanced node)
It was quite tricky to get this going as it uses a C library to communicate with the radio adaptor, I've used a combination of sync and async calls at the moment with a mutex on the radio calls. If anyone has recommendations about which is best (sync or async) please let me know!
I would be interested in anyone to perform testing of these nodes, it currently should work with all switches and monitor only devices; but only the Adaptor Plus in the 'control & monitor' range.
UPDATE: I have now tagged this release with 'node-red', so you can install using 'Manage palette' option directly in node-red.
Hi, there are an awful lot of warning messages during installation regarding "NAN-DEPRECATED". Should I be concerned?
What version of node are you running? You can see this from the node-red startup log, or run the command
You should be running node 8.x or 10.x, if it is earlier that may cause the problem.
If that is the problem and you don't know how to update then tell us what hardware and operating system you are using.
Hi, thanks for replying!
Weirdly, it is v11.15 !
I installed it from the Diet-Pi distribution.
Can you post a log file please? Are they in a dependent library? If so which one?
Hi, thanks for helping! I just have an installation of Diet Pi and I first did an npm install as per your instructions, saw all the error messages, realised my default directory was wrong, assumed that was the problem, then saw your advice about using manage palette. The attached is a copy and paste of the entire installation from there.
temp.txt (81.9 KB)
Incidentally, you may not want to take too much time over this for me, since having read more detail, I'm guessing it won't give me control over my TRV devices (MIHO013). I'm currently accessing these as MQTT devices via the Github package here
It works wonderfully, but has so many dependencies, and is not a system service, so I was hoping to move towards something more integrated.
I do have TRVs on my github to-do list, but as I don't own any it's a little tricky to test!
The deprecation errors are in the 'ref', 'ffi' and 'v8' libraries that I'm using to make the C calls. I'll raise a bug on tootallnate's github. If I don't get any luck, I might have to change the way I do the calls to C.
Anyone else on here have any recommendations on better ways to call C routines?
many thanks for the trouble! I will look back from time to time to see how you are getting on. Would any further announcements come via this thread? If so, I will get notified. I do appreciate your philanthropic efforts!
Hi, I'm new here, just getting started with node-red. My house is filled with energinie light switches and would love to control them locally rather than the gateway.
I stumbled upon this node-red addon while I was trying to find a way to achieve this with Home Assistant.
Unfortunately, when I attempt to install this, it seems to fail every time.
I have latest version of raspian v10 buster (freshly installed), node-red v1.0.3 and node js version v12.13.1
As I a new user I am unable to attach the log. I have pasted the log file on just paste (link below)
Any help would be appreciated. Thanks!
You are right, it won't install. Possibly it is incompatible with the later version of nodejs. Probably the best thing is to submit an issue on the node's github page.
Thank you for responding. I have posted this as an issue on the github page. hope it gets resolved soon.
This is a problem in the 'ref' library which is deprecated. The new v3 version (see develop branch) completely changes the dependencies to use node native API instead. I'll take this as a prompt to get it released
New version 0.3.0 now available. This release is a major change.
- Switched to use node.js Native API (N-API) for calling C functions, and split off new node module
- All external dependencies have been removed, apart from the sister module
- Added a new node to support MiHome Radiator Valve
- Added a separate thread for monitoring that implements caching (for eTRV) and dynamic polling
- This module requires node.js v10+, and should work with most versions of node-red that work with this version of node.js.