whaleygeek / pyenergenie

A python interface to the Energenie line of products
MIT License
82 stars 51 forks source link

Added eTRV product type #17

Closed cafebabe closed 7 years ago

cafebabe commented 8 years ago

Also made JOIN and SWITCH code work with eTRV.

pvanderlinden commented 7 years ago

@cafebabe Did you manage to get more working from the MIHO013? I just bought 2 of them only to discover I can't seem to control them from Raspberry PI, I can "pair" and read the Temperature which is broadcasted every 5 minutes, but all other messages seems to be ignored. The response from Energenie is very unhelpful so far, stating the device is "too complicated" for the raspberry pi. Also sending the switch command or battery level didn't do anything

whaleygeek commented 7 years ago

Hi @pvanderlinden - I haven't done much testing myself with the eTRV as they won't fit on my home installation without getting a plumber in to help. I wrote a dummy class wrapper for it here: https://github.com/whaleygeek/pyenergenie although I haven't had the time to finish writing the message decoder for it, so it won't work in it's current form. It needs a handle_message() function that cracks open each message type, and routes it to the appropriate handler, in order to be finished.

I don't think that's a lot of work, judging on how quickly I managed to write and test the other device classes in this file. But I probably won't personally get round to this for a few weeks yet due to other workload. Although now I know you are interested in it, I will look at how I can make some time to finish this work off.

I'm not really sure the device is too complex for the Pi. There are a number of message types that need to be implemented (both monitoring messages and sending messages), and there may be some challenges with message scheduling (as I think the device might only have a limited receive window to accept new setpoint commands). So it's likely that a full set of commands will take a bit of time to test thoroughly.

If you sketch out the minimum viable product from your perspective, this might focus my attention a bit more on the things that are useful for starters!

whaleygeek commented 7 years ago

Sorry, that last link was a bit short, try again:

https://github.com/whaleygeek/pyenergenie/blob/master/src/energenie/Devices.py#L892

devanubis commented 7 years ago

Hi, I've also recently acquired a pair of these to look into controlling them with a Pi.

The demo C code from Energenie doesn't appear to include the 'eTRV_Menu' directory which is mentioned in their blog post (http://blog.energenie4u.co.uk/tech-gadgets/something-weekend-two-way-raspberry-pi-transceiver-board-etrv-guide/) but I've spied someone on github who has what looks to be a copy:

https://github.com/sjhx/etrv

I've not tried compiling or using it yet, but it might be useful as a reference.

From that, the controls available seem to be:

As far as minimum-viable-product goes, what I'm wanting to develop is a monitoring system to log temperatures (probably dumping into RRD), and a control panel to adjust the TRVs targets so each room feels comfortable, but also to shut off rooms not in use on any given day. I've already got the central heating boiler controls setup with an ENER002 to turn it on and off, instead of a manual timer.

The end goal would be full automation of the boiler, so instead of a simple timer it turns on at a given time, and then off once each room passes its temperature target, then flips on again if enough rooms start to drop below a lower boundary.

Must:

Should:

Could:

Thanks by the way for making such a useful library!

whaleygeek commented 7 years ago

Hi @devanubis

Thanks for this info. There's a number of us on here interested in getting reliable eTRV working, so collating all the relevant facts and figures into one place is really useful.

Unfortunately I don't have the bandwidth at the moment to dig into the intricacies of the eTRV and code up a solution (not for a few weeks, anyway, might be better in November). So I'm sort of hoping that we can all generally push as much information and experimental data into this issue log. One of us will find the time to make it happen, I am sure. @cafebabe has basic support for eTRV running on his branch, and there are some references to eTRV_menu and also a C/MQTT based adaptor that works with the eTRV.

I think it needs someone with a bit of time to get all this stuff out on the table and work through it, and document what does and doesn't work. I think the code updates to this particular python library are relatively easy, although I suspect the key will be to schedule the messages to the eTRV in the right time period.

Thanks for your feedback on the library - I put a lot of thought (too much, probably!) into it's design, and I worked really hard to make the code work out of the box, without any install or configuration.

There is a web_console branch you might like to look at, I have an almost finished bottle web server there that allows you do to discovery, monitoring, and control from a http web interface. It's very simple and intentionally unbranded, but it does work.

Thanks to everyone who is contributing to this thread. I'm sure if we all push a little bit more, we should be able to get to the point of having all the facts and figures in front of us, and one of us will find the time to make it work.

whaleygeek commented 7 years ago

For issues related to eTRV support, can we all start conversing on issue #12 from now on, as there are a few people interested in this work.

Note that this pull request is quite out of date as a lot of work was done on higher layer software since Ed took his fork, so I am closing this pull request down for that reason. Please move over to issue #12 to discuss further, thanks!