AlertMe Devices and the XBee

Extending the system, interesting uses and API twiddling.
Post Reply
User avatar
roobarb!
Site Admin
Posts: 219
Joined: Mon Nov 21, 2011 4:56 pm
Location: Manchester, UK
Contact:

AlertMe Devices and the XBee

Post by roobarb! » Thu Oct 19, 2017 9:19 am

With the imminent demise of the AlertMe servers I’ve started experimenting with the PyAlertMe library written by James Saunders. I’ve had some success - there are some oddities that have cropped up, but on the whole I can now control a SmartPlug pretty reliably. I actually started with the simpler hive-smartplug-xbee code to better get to grips with how it all should work.

I’ll post some more detail when I get chance, but I’m using an XBee S2C with the little whip antenna, a USB adapter and the Python code. That’s all you need to get started, so long as you have some programming experience. I’m very rusty these days, but most of the complicated radio fettling has already been done.

Now I need to get to grips with controlling multiple devices and having them register reliably - something which I remember being a bit funny in the early days of the AlertMe system. I hit one issue where there are huge delays turning a newly discovered SmartPlug on and off, but this seemed to resolve itself over time or by re-running the script. All very odd.
Alerty - control your AlertMe system with my third-party app for iPhone and iPod Touch. Available on iTunes!

User avatar
roobarb!
Site Admin
Posts: 219
Joined: Mon Nov 21, 2011 4:56 pm
Location: Manchester, UK
Contact:

Re: AlertMe Devices and the XBee

Post by roobarb! » Sat Oct 21, 2017 1:54 am

First working attempt to automate a SmartPug. :)

Alerty - control your AlertMe system with my third-party app for iPhone and iPod Touch. Available on iTunes!

User avatar
roobarb!
Site Admin
Posts: 219
Joined: Mon Nov 21, 2011 4:56 pm
Location: Manchester, UK
Contact:

Re: AlertMe Devices and the XBee

Post by roobarb! » Sat Oct 21, 2017 2:07 am

This time the Python script builds an array of available devices and loops through them, turning them on and off. They're not all known immediately, which is why the start is a little stuttery.



The next step is to try integrating the actions of the plugs with services like IFTTT, but the basics of controlling a SmartPlug are remarkably straightforward now that I've wrapped my brain around it a bit.

Need to work on the code which does the association a bit though; it's a little finicky and the hive-smartplug-xbee script actually seems to make a better job of it than the code I've managed to cobble together from the PyAlertMe library. Very happy to have got this far, though!
Alerty - control your AlertMe system with my third-party app for iPhone and iPod Touch. Available on iTunes!

mw631774
Posts: 11
Joined: Tue Oct 03, 2017 1:00 pm

Re: AlertMe Devices and the XBee

Post by mw631774 » Wed Oct 25, 2017 6:33 pm

Can you tell me what XBee module you bought? I wouldn't mind playing around with one but want to be sure I buy the right one ...

User avatar
roobarb!
Site Admin
Posts: 219
Joined: Mon Nov 21, 2011 4:56 pm
Location: Manchester, UK
Contact:

Re: AlertMe Devices and the XBee

Post by roobarb! » Thu Oct 26, 2017 10:34 am

mw631774 wrote:
Wed Oct 25, 2017 6:33 pm
Can you tell me what XBee module you bought? I wouldn't mind playing around with one but want to be sure I buy the right one ...
Sure, it was an XB24CAWIT-001 which comes with a little whip antenna attached. You'll also need an XBee USB Adapter. If you're doing any testing on a Mac you'll need to install the FTDI Virtual COM Port driver because the one built-in with macOS High Sierra seemed a little twitchy for me. Actually, you're probably best installing the latest official Windows driver too.
Alerty - control your AlertMe system with my third-party app for iPhone and iPod Touch. Available on iTunes!

mw631774
Posts: 11
Joined: Tue Oct 03, 2017 1:00 pm

Re: AlertMe Devices and the XBee

Post by mw631774 » Tue Oct 31, 2017 7:54 pm

Thanks roobarb! - I've checked out at Farnell's and Digi's websites; I found the XB24CAWIT-001 you chose and noticed that this is an 802.15.4 variant; I know 802.15.4 is the basis of ZigBee but would it not be better to chose a ZigBee variant as this is what AlertMe is using?

For example, there are:

User avatar
roobarb!
Site Admin
Posts: 219
Joined: Mon Nov 21, 2011 4:56 pm
Location: Manchester, UK
Contact:

Re: AlertMe Devices and the XBee

Post by roobarb! » Tue Oct 31, 2017 9:44 pm

The honest answer is "I don't know". I just bought the XB24CAWIT-001 and re-flashed it with the ZigBee firmware using their XCTU software. Maybe there's something different about the models you linked to; or perhaps they just come pre-flashed with the ZigBee firmware.

If in doubt, grab the one that says ZigBee on the box. It's only £1 difference on OneCall.
Alerty - control your AlertMe system with my third-party app for iPhone and iPod Touch. Available on iTunes!

mw631774
Posts: 11
Joined: Tue Oct 03, 2017 1:00 pm

Re: AlertMe Devices and the XBee

Post by mw631774 » Thu Nov 02, 2017 8:04 pm

Fair enough :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest