I was just wondering if anyone else has bought one of these and has got it working with Vera? Assuming the http requests used are pretty straight forward it's my hope that I can create some simply lua code to turn them off and on.

They provide an SDK (http://www.energenie.com/service.aspx?item=6668&key=#item) which appears to have a description of the protocol. It looks a mite messy and lacks information such as whether it uses TCP or UDP and what port it uses. You might be able to reverse engineer the missing parts of the protocol with a packet sniffer.

It appears that there's no way to ask the device to inform you out-of-band when the state of one of its switches changes, so you'd be reduced to polling every few seconds to get the current state.

Well the PMS-LAN multi socket arrived today and it looks a nice (solid) piece of kit..

The web interface is very simple and it looks like it uses java script to turn the 4 managed sockets on or off, simply viewing source of one of the pages I extracted the following to see if I can work out what I would need to call via a Luup script, although I will admit I was hopeing it was going to be easier than this..

It's hard to know yet. Despite their so-called "open" API and SDK, these kinds of devices don't always match their documentation and are usually held together with the programmatic equivalent of duct tape. The spelling mistake is a good indication of the quality of the product's firmware.

If you want to use this thing as an excuse to get your hands dirty, learn how to reverse-engineer protocols and sniff packets, learn JavaScript and sockets... I can think of worse projects to start with. You'll certainly come out of it a better programmer and more knowledgeable about low-level programming. But you're going to get frustrated with it when you inevitably hit one of their stupid design decisions, and you're going to find that you spend more time writing learning-code and test programs than actual plugin. If I were in your position I'd set myself a goal of controlling the switch from a PC without using their SDK. At least that way you'll have a proper IDE with debugging tools. Once you've got that working, then we can talk about porting it to a Vera plugin.

Nothing ventured, nothing gained, although I've moved ove to iOS now so my (very) old PC might not be up to much. I'll move this to the programming section now as I'll be talking about code - and who knows someone might be sitting on an answer already..

Hi parkerc. I just wanted to let you know that I also bought one of these Energenie units. I'm going to try and figure out if it is possible to operate with simple http calls via a web brower, in the hope that this will provide someone with information that could be used to make a simple plugin.If you have already made some progress on this investigation, please do let me know. Thanks.

Unfortunately I've been unstable to do much more I wanted to use wire shark to see if I could capture what was being sent/received by the power strip but the network card on my old PC refuses to work and then before I could do anything to fix iot replace it, the day job got in the way.

I think with the help of others on this forum (see link below) we've explored a lot of http requests possibilities but a fresh pair of eyes will be great.

It's a nice product and would be a good integration for Vera

I've also tried emailing Energenie direct a few times for help but i've so far been ignored

If OK with you it would be best to share your findings via my plugin post, as you can also see what I've already tried..

I got this device too. Using the protocol description I successfully wrote a small perl script that can turn on and off the plugs using the protocol on port 5000 (not the webserver itself). If your'e interested, it looks like this (should not be difficult to implement it in any other language), $pass and $ip must be filled in of course:

The while/eval construct is just there to repeat the TCP connection in case of a problem. You might want to increase/decrase the "alarm 10" value - in this setup, the connection is re-tries after 10 seconds if it does not succeeds (timeout).

I was just working my way through the protocol myself trying to get something going in Python (I'm a novice, but thought that controlling the socket with a Raspberry Pi would make a nice little programming project).

Your code will be very useful.

Just one question - I can see how the first 4 lines of the 'response' function match the protocol, but don't get why the mod 256 / bitwise right shift is needed. Is it mentioned in the protocol?

I would like to thank Klaymen! I was looking for some code to use with the energenie... I'v translated, as a test, with c# and xaml.The code is not cleaned as I did it quickly... but I hope it will help peolpe. At least it's working!

// Create the data writer object backed by the in-memory stream. using (writer = new DataWriter(socket.OutputStream)) { // Set the Unicode character encoding for the output stream writer.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8; // Specify the byte order of a stream. writer.ByteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;

using (reader = new DataReader(socket.InputStream)) { strBuilder = new StringBuilder();

// Set the DataReader to only wait for available data (so that we don't have to know the data size) reader.InputStreamOptions = Windows.Storage.Streams.InputStreamOptions.Partial; //The encoding and byte order need to match the settings of the writer we previously used. reader.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8; reader.ByteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;

// Send the contents of the writer to the backing stream. // Get the size of the buffer that has not been read.