blog:personal_diy_pi_powercontrol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
blog:personal_diy_pi_powercontrol [2019/10/23 09:48] – [Power Sockets] johnblog:personal_diy_pi_powercontrol [2019/10/23 10:09] (current) john
Line 23: Line 23:
 Energenie also offer a specific add-on hat, for use with a Raspberry Pi, but a lot of people have found that the generic Hope RFM69 radio module (which is an SPI bus-interfaced radio module) works just as well. Energenie also offer a specific add-on hat, for use with a Raspberry Pi, but a lot of people have found that the generic Hope RFM69 radio module (which is an SPI bus-interfaced radio module) works just as well.
  
-=== Duplication remote control functionality ===+=== Duplication of remote control functionality ===
  
-One of+One of the problems with the Energenie RF system, is that out of the box, the handsets are pre-programmed with device codes which you pair with the sockets. It's not possible to read what those codes are (which would be necessary, in order for the power sockets to respond to another radio device), and there's nothing on the handset or PCB to say what those codes are. 
 + 
 +There **is** a [[https://github.com/whaleygeek/pyenergenie/issues/81|method]] to analyse the radio signals from the remote, with a software defined radio, but as I [[https://github.com/whaleygeek/pyenergenie/issues/106|learned]], there is something going on between the handset and power sockets that means you are not guaranteed to replicate the device codes perfectly using a different radio module. 
 + 
 +As it turned out, needing to do that wasn't strictly necessary; putting the power sockets in their "pair with handset" mode, and sending the power on signal from the Pi radio module was enough to get the power socket to pair with the //slightly different// signal that the Pi was sending. Et voila! Power sockets now able to be controlled by the Pi.... of course, I had to replicate this pairing for each of the power strips I owned (14, at last count), since each one was responding to a different device ID, but once that was done, each strip and socket could be addressed individually.
  
 ---- ----
  
 ==== Touchscreen User Interface ==== ==== Touchscreen User Interface ====
 +
 +So I technically had a way of controlling the sockets, but I needed a way of interacting with that functionality.... keeping track of a dozen or more remote controls was **not** what I wanted to do.
  
 I had done a little bit of [[https://www.libsdl.org/|libSDL]] programming for my [[blog:car_stuff_pycosworth|Cosworth ECU]] interface project, and had since done a little more at [[https://www.ncl.ac.uk/|work]], so I thought I could knock together an interface using a simple touchscreen board for the Pi. I had done a little bit of [[https://www.libsdl.org/|libSDL]] programming for my [[blog:car_stuff_pycosworth|Cosworth ECU]] interface project, and had since done a little more at [[https://www.ncl.ac.uk/|work]], so I thought I could knock together an interface using a simple touchscreen board for the Pi.
Line 43: Line 49:
 {{:blog:miho004_website.jpg?200|}} {{:blog:miho004_website.jpg?200|}}
  
-...which also pulled data from using the RF module, displaying it on the touchscreen at the press of a button:+...these are strictly broadcast-only devices which send a burst of power metrics over the same RF signal as the power sockets, approximately every 60 seconds. The PyEnergenie project also had support for these, so I was able to pull this data in using the same RF module used for controlling the sockets, displaying it on the touchscreen at the press of a button:
  
 {{:blog:pi_monitor.jpg?600|}} {{:blog:pi_monitor.jpg?600|}}
 +
 +This screen let me monitor the power use of all of the sockets in the room in (almost) real time. There is a lag for the power monitor sockets to re-broadcast their data (it's every 60 seconds or thereabouts), but it's good enough to see the loading on the 4 wall sockets in the room, along with the various power strips that run from them.
  
 ---- ----
  • blog/personal_diy_pi_powercontrol.1571820527.txt.gz
  • Last modified: 2019/10/23 09:48
  • by john