Converting a wifi outlet to an nRF24 MySensors device
-
So recently I purchased some wifi controlled outlet adapters from Walmart. These are based off of ESP 8266 modules which I was able to reprogram. I had them working for a bit, but was having trouble getting some parts to work right with my Vera controller. Here is what the devices looked like:
And here is what the guts of the device looked like. This is with dupont cables connected to the module from when I reprogrammed it.
Most of my setup for MySensors uses an nRF24 network, and based on the fact that I was having some trouble getting some of the devices to work, I thought I'd give a shot at converting these to nRF24L01+ nodes. I cut some proto board the same size as the inner module and drilled identical holes to make it fit the same as the old 8266 controller. Space was a real concern as I needed to get a pro mini and an nRf24 radio inside the case. I used a 3.3v pro mini with the radio connected to a harness so I could tuck that around the plug socket for space. Here is a picture of the first new test assembly next to the old original controller. I was able to incorporate a micro-switch and an LED to show the on/off status of the relay. The switch works with the front power button on the cover. The radio is hanging underneath the white board with the colored wire harness.
Since the board connected to the main power board with 3 wires, it made it easy enough to connect. The 3 wires were GND, +5V and relay signal.I have since made 2 more of these, but haven't taken pictures of one of those yet. I will post a few more pictures this weekend.
The old ESP8266 boards that I removed I can re-purpose down the line when I have more time to figure out the plugin for my Vera.
-
Did you try to running MySensors on the ESP controlling the relay?
-
@hek I did not. Correct me if I'm wrong though, but my understanding of the ESP version of MySensors code is that a device on the ESP network cannot communicate node to node with a device on the nRF24 network. I have never done node to node communication, so one of the things that I want to try in the next week (partly to learn how) is to set up my wall switch that I built to talk directly to these 3 nodes. The idea is to eliminate the need for Vera to be in the mix for these devices. The way I have them set up now, I have scenes set up that basically say, when this switch is turned on or off, turn this light on or off. If the Vera were to go down I would loose control of these lights for the period that it is down.
-
Yes, you are correct. You would have to handle the logic on vera if you want to route/trigger messages between gateway instances.
-
Not sure if it helps, but shouldn't it be possible to use the esp instead of the pro mini? Not as gateway, just as regular mcu with nrf node (with wifi turned off).
-
@mfalkvidd I would be open for that if there is an example of how to set it up. Currently I have the 3 that I recently bought converted with pro minis, but I had thought of purchasing a few more of these to use in places around the house. If all I had to add was an nRF24 radio, it would make setup easier and cheaper.
-
@dbemowsk I think you would just upload the same sketch you use for the pro minis today (compiled for the esp board of course).
-
@mfalkvidd I kind of figured that, but I was more talking about the connections to the ESP module. How do I wire in the nRF24 and to what GPIO pins. Depending on what pins are needed to connect the nRF24, I would need to check whether those pins are broken out on the ESP module used in this thing. I looked at this module and compared it to a number of commercially available ones and could not find one that matched. Luckily someone on Hack-A-Day had done all of the leg work to diagram this module.
-
I have the same plugs (Eco Plug I think)
I use domoticz on a raspberry pi for my mysensors and other stuff.
I didn't hack mine, I just forked a homebridge plugin (it was either python or node based, I can't remember) and got it working on my domoticz
-
It may have been this project I forked, I can't remember https://github.com/Danimal4326/homebridge-ecoplug
-
If I get any more of these I won't hack them like I did the other ones. I just recently got some Sonoffs that I put the ESPEasy firmware on and am using a modified wifi switch plugin on my VeraPlus that seems to be working good now I did try the ESPEasy firmware on the Eco Plugs, but had some issues with it in the beginning which is why I switched. I still have the ESP8266 controllers that I pulled out of those Eco Plugs, All I have to do to use them on a different relay board is connect 3 wires, Ground, +5 volts and the control signal for the relay, so the boards won't go to waste.
I am just finishing up one of my newly printed 4 button wall switch controllers (https://forum.mysensors.org/topic/4317/us-decora-style-wall-switch/34), and I will be doing a 2 button controller immediately after that one. Both of these will be used like scene controllers for my Vera Plus and I will use them to control the Sonoffs connected to my ceiling fans and lights. I may get a couple more of the Eco Plugs to use with the 4 button switch controller.