logo elektroda
logo elektroda
X
logo elektroda

How do I power the ESP8266 devices in a Domoticz system on a Raspberry Pi B3+?

ociep14 2565 21
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17608349
    ociep14
    Level 10  
    Hello,
    I am looking for a solution to a problem. I have Domoticz set up on a raspberry pi b3+, the other devices, often needing rework, would communicate wirelessly with the Raspberry. What I would like to connect:
    - lighting control
    - window contacts
    - temperature and humidity sensors
    - camera
    I would like to make this as compact as possible, without having to run separate cables. Everything based on ESP8266 and relays. I am wondering how you have solved the issue of powering such devices. In the case of temperature and humidity sensors, I only need to take readings every e.g. 5 minutes. In this situation, will a battery power supply be satisfactory, i.e. will it maintain power for at least a month? How do I then program the ESP module Window/door contacts can also be powered in this way? Obviously for the light switches, I would like to fit the whole installation behind the switch. I have found an inverter How do I power the ESP8266 devices in a Domoticz system on a Raspberry Pi B3+? .
    Will it do the job of controlling the lighting. Please give me a hint on how to do such an installation correctly. I will be grateful to you for all practical comments.

    Best regards
  • ADVERTISEMENT
  • #2 17608512
    kaczakat
    Level 34  
    If you are looking for a very compact power supply I found something else like this:
    How do I power the ESP8266 devices in a Domoticz system on a Raspberry Pi B3+? .
    Admittedly, I've got some blue ones, there are 3.3, 5 and 12V versions, and there's a trafo inside too. How to connect - so it can't electrocute anyone or start a fire - these are Chinese toys. I've connected one ESP to such a power supply but I only test it when I'm in the area and away from flammable things.
    Helpful post? Buy me a coffee.
  • #3 17608615
    ociep14
    Level 10  
    Could you describe in simple terms the wiring diagram?
  • #4 17608637
    Anonymous
    Level 1  
  • #5 17608641
    ociep14
    Level 10  
    I am referring to a solution with a battery, for example.
  • ADVERTISEMENT
  • Helpful post
    #6 17608646
    xury
    Automation specialist
    You can power it with batteries, e.g. with cheap cases for two or one 18650 cell, so-called power bank cases from aliexpress. For esp8266 you win Easyesp and set deep sleep for 5 minutes. An ESP configured in this way can run on good cells for up to two months.
  • #7 17608769
    Anonymous
    Level 1  
  • #8 17608941
    ociep14
    Level 10  
    For lighting control, to be connected behind a switch, the best solution, were these modules?
    How do I power the ESP8266 devices in a Domoticz system on a Raspberry Pi B3+? .
  • ADVERTISEMENT
  • #9 17609042
    TvWidget
    Level 38  
    The RPi3 also has a BT4.0 interface and there are a variety of sensors e.g. temperature, humidity etc. battery powered sending data via BLE.
  • ADVERTISEMENT
  • #10 17609056
    Anonymous
    Level 1  
  • #11 17609125
    TvWidget
    Level 38  
    Erbit wrote:
    somehow I find it hard to imagine BT with a range of 10m (in open space) for domotics applications.

    Taj as you wrote it all depends on the power of the transmitter in the sensor. The maximum power allowed by law is +20dBm. For such a sensor the range in open space is a few hundred metres and a building 2-3 floors. For a power of +8dBm it is about 50m in open space.
    Smart bands or other such devices that do not require a long range have a power of -2dBm or less. Here the range can indeed be only 10m.
  • #12 17609688
    krzbor
    Level 27  
    I am struggling with the same problem as the author. I have several actuator modules on the ESP, and these are mains powered - no problem. Switching to batteries on the ESP is already a major problem. I wanted small devices with a decent design and a lifetime of 1 year. With data every 5 minutes this is unrealistic on an ESP. I opted for BT and Pi 3 for the temperature sensors, the first two sensors being the Xiaomi Mijia Bluetooth Temperature Humidity Sensor. There are scripts that read the temperature directly from these sensors. Unfortunately, there is a problem with the range - they hardly work through the ceiling, and only within a short distance on a given floor (through walls max. about 7m). I decided to test an iNode-based solution. I purchased one module and found that the range was the same. However, I later found out that by default the iNode works at -2dBm, but can be configured for 8dBm. At 8dBm, the iNode is already working for me through the ceiling and was losing at most every other frame. I wait 2 minutes for a readout, so I changed the standard 1s to 5s to reduce power consumption. For a correct reading I therefore need to catch 1 frame out of 24 sent. Reading via bash script in passive mode. I will most likely buy more of these "lozenges".
  • #13 17620069
    ociep14
    Level 10  
    I found an interesting tutorial on the web: Tutorial .
    Such a sensor can be configured with Domoticz? What do you think of this solution?
  • #14 17620218
    Slawek K.
    Level 35  
    What do you mean by sensor? The whole system or just the reed switch itself? In fact it is both, the whole system with NRF24L01 can be connected to Domoticz via MySensors software, or the reed switch using ESP with ESPEasy software as well, there are many possibilities.
    Using ESPEasy is simpler, you don't need a hardware gateway at the Raspberry as communication is via WiFi.

    Best regards
  • #15 17624988
    ociep14
    Level 10  
    Please provide a wiring diagram for the module in the lighting box.
    How do I power the ESP8266 devices in a Domoticz system on a Raspberry Pi B3+? .
    There is a two-wire cable in the box. How to solve the power supply issue.
  • #16 17625039
    Slawek K.
    Level 35  
    You have to have a third wire, if you have a properly done installation, you have to pull up the N wire to the box, because the L should already be in the box.

    Greetings
  • #17 17631363
    ociep14
    Level 10  
    Can I ask for an explanation of how to connect a bulb (room light) + wall switch to specific inputs on this module?
  • #18 17631695
    Slawek K.
    Level 35  
    To the 2-pin connector is a 5V power supply, the 3-pin connector is a relay connector, where one is COM (common) and the other two are respectively NO (normally open) and NC (normally closed), The goldpin connector is serial. There is no input on the gpio so push button control is not possible, only via WiFi.

    Greetings
  • #19 17631774
    ociep14
    Level 10  
    Do you know of any solution for wifi and manual control?
  • #20 17633010
    xury
    Automation specialist
    ociep14 wrote:
    Do you know any solution for control via wifi and manually?
    .
    Yes connection just like you connect a staircase switch.
    On one side the staircase switch and on the other the relay contacts. The control can be alternated. The only inconvenience is the lack of real status information.
  • #21 17633859
    Anonymous
    Level 1  
  • #22 17643702
    ociep14
    Level 10  
    I wanted to use the completed equipment (Wemos d1, relay, 230V-5V inverter) somehow. A wifi controlled socket came up as an idea. I'm a beginner, I made myself a supporting drawing to ask you guys if such a configuration has the right to work? I know you can buy off-the-shelf modules, but I'm treating this more as a learning to make my own designs. I don't connect anything to such voltage until I understand the mechanism of operation :) Thank you in advance for your valuable answers :) .
    How do I power the ESP8266 devices in a Domoticz system on a Raspberry Pi B3+?

Topic summary

The discussion addresses powering ESP8266-based devices integrated with Domoticz on a Raspberry Pi 3 B+. For compact installations without separate cabling, battery power is considered viable for low-frequency sensors like temperature and humidity, especially when using deep sleep modes (e.g., EasyESP) to extend battery life up to two months on quality 18650 cells. However, achieving a one-year battery life with ESP8266 is challenging due to power consumption. Alternatives such as Bluetooth Low Energy (BLE) sensors (e.g., Xiaomi Mijia) connected via Raspberry Pi's BT4.2 interface are discussed, noting range limitations through walls and floors. For lighting control modules installed behind switches, powering requires proper wiring, ideally with a neutral (N) wire present in the switch box; two-wire setups complicate power supply. Relay modules with 5V power inputs and relay contacts (COM, NO, NC) are used for switching, controllable via WiFi but often lacking manual input buttons. Solutions combining WiFi control and manual switching are limited, with some setups mimicking staircase switch wiring. Ready-made power supplies and inverters (230V to 5V/3.3V) are mentioned but caution is advised due to safety concerns. Integration with Domoticz can be achieved using ESPEasy firmware for WiFi communication or MySensors with NRF24L01 for RF communication. Overall, the trade-offs between battery life, wireless range, power supply safety, and installation complexity are key considerations in designing ESP8266-based home automation devices with Domoticz on Raspberry Pi.
Summary generated by the language model.
ADVERTISEMENT