Aqara sensors & node-RED

It turns out, like usual, I bought things in the past that I was going to use for something, either it didn't happen, it didn't work as I wanted or I just forgot / didn't have time.


This weekend, I noticed that I had a sonoff usb dongle that looked quite funky - I vaguely remember buying it to see if I could "sniff" the new electricity / gas "smart meter" that had been fitted.  

I still have issues about the BS that relates to the companies referring to them as "smart", there is nothing smart there at all, it is just micro-managing the monitoring of the household usage, looking for patterns, identifying your electrical items, determining what you have and how to make the most amount of money out of you - so, yes, in the sense of "smart" it is for the company, not for you the consumer.

Anyway, I was wondering, I need to do something with a vibration sensor with node-RED, so I thought, hey, let's see what is available for sale that isn't going to break the bank.


Now, it turns out that the Aqara sensors are very small devices, about the size of a 2p or 50p coin.  They will do nicely, they are not cheap by any stretch of the imagination! Yes, I could have gone off on the Arduino journey and got some cheap sensors, wired them up, powered them etc..etc.. but for the faff, it wasn't really worth it.

Also, I was thinking I could actually re-use the Aqara devices inside my camper van! Why not? I could also extend the usage of them too.

So, what did I already have?  Turns out that I actually have 2 devices - will need to look around for that 2nd device, that looks exactly what I need!



Why do I need those devices? well, instead of paying £130 for an Aqara hub, that little USB device can "sniff" the ZigBee 3.0 network and well, you can do everything you need without needing a hub, without sending my data over the internet or letting someone else have access to my devices.  I can just set them up, connect my USB device up and "sniff" the data - and what I want to be doing is, "sniff" that data from within a node-RED flow.

After a little hunt around online, this nice chap has already been here, done this:

https://notenoughtech.com/home-automation/all-aqara-sensors-in-nodered/

https://flows.nodered.org/flow/9a68e729aacf7fe4d944e6e57ef1973a


As I've said before with all things node-RED, someone has usually done either the thing you want to do, or has a very close variant you can build from.


After importing the Dashboard v1 from the Manage Palette, (I should look to migrate this to use the new v2.0 nodes), I now have a flow that can be configured to work with these devices - after setting up the usb device:



As with everything, there is the phrase, "so what?"

Well, I actually need to do something smart with a vibration sensor.  I need to place it somewhere and detect if it gets triggered or not.  If it does, I need to detect that within node-RED, I then need to create a "mission" in a drone plan & send off a drone to go and investigate the location - as I will have placed the vibration sensor, I will know the GPS / geo location information already.  Then I will need the drone to capture some imagery to inform me of what set off the sensor.  All done via node-RED.


Now, you'll notice I got 2 other sensors - well, I got these specifically for usage within my camper van.  I am going to fit the door sensor to the back door, to detect if the door is open or not & I want to fit the temperature sensor in the bedroom area of the van.  I can run a Raspberry Pi(?) from the solar powered lithium batteries I have in the van to monitor these sensors, so that if the temperature is too cold, auto-activate turning the heating on & (yet to be worked out), if it is too hot, open the roof hatch (like you would do on a greenhouse window).  

Then I could, potentially extend this to use the camera too, however, I'm not too keen on having cameras on 24/7, no matter how "secure" they are.  If I know, I can hack the camera, I know someone else can too & I'd rather not... but if they do an outdoor version, I might fit one to the roof?

https://www.amazon.co.uk/dp/B09N6KDX5K/



https://www.amazon.co.uk/dp/B0DPX69RWZ

bl00dy hell! that outdoor version is rather expensive!!! I don't have anything worth that much in the van, in fact stealing the camera would be the most lucrative thing!





Well, I won't be able to action on this for a week or so, when I do though, I'll update the progress and the node-RED flows and how I set this all up to work.  


Should be good to finally get around to having some "me time", rather than the previous year of "work/work/work time".  They earnt way too much from me over the last year and having to "lose 22 days of holiday" was, well, just pushing it a bit too far (nope, didn't even offer to pay me the time lost either), so I'm now Mr. 9-5, nothing more.  I'm not getting this time again, so it's time for me to do stuff for me & get playing with this technology - who knows, I might even do something useful with it :-)

As I have "time" in the camper van & I have lovely evenings sitting inside / outside the van, enjoying the elements, I have an incentive to tweak things for the van - who knows, I could even put some of this together to help other van lifers too.





Comments