Home Automation India Documentation
website·Indexed 30 days ago
https://home-automation-india.netlify.appA resource for home automation enthusiasts and DIYers featuring guides on energy monitoring with PZEM-004T, ESPHome powered solar WiFi weather stations, inverter battery monitoring, and WLED ambient lighting. Includes instructions for flashing custom firmware like Tasmota or ESPHome onto Tuya-based devices using Tuya CloudCutter.
What's inside Home Automation India
- Tuya CloudCutter is an over-the-air (OTA) exploit used to flash custom firmware onto Tuya-based Wi-Fi smart devices that use Beken chipsets. This method allows developers to bypass the need for hardware modifications (like chip swapping or soldering) to achieve local control. Through the LibreTiny project, these devices can be integrated with ESPHome and Home Assistant, providing a seamless experience for those familiar with the ESPHome ecosystem.
Find educational YouTube channels for home automation
The following YouTube channels are recommended for DIY enthusiasts and developers looking for insights, practical tips, and guidance on smart home experiences and home automation projects:
- EverythingSmartHome: https://www.youtube.com/@EverythingSmartHome
- SmartHomeSolver: https://www.youtube.com/@SmartHomeSolver
- SmartHomeJunkie: https://www.youtube.com/@SmartHomeJunkie
- HomeAutomationGuy: https://www.youtube.com/@HomeAutomationGuy
- TheHookUp: https://www.youtube.com/@TheHookUp
- paulhibbert: https://www.youtube.com/@paulhibbert
- makeitworktech: https://www.youtube.com/@makeitworktech
- ChrisMaherDIY: https://www.youtube.com/@ChrisMaherDIY
- AndreasSpiess: https://www.youtube.com/@AndreasSpiess
- the_vccground: https://www.youtube.com/@the%5Fvccground
- MarkWattTech: https://www.youtube.com/@MarkWattTech
- digiblurDIY: https://www.youtube.com/@digiblurDIY
- DIYMachines: https://www.youtube.com/@DIYMachines
- HomeSight: https://www.youtube.com/@HomeSight
Install and configure WLED firmware
Install the WLED firmware on the ESP8266 (Wemos D1 Mini) by following the official binary installation guide. During setup, configure the number of LEDs, maximum current, and WiFi credentials.
Stability Tip: In the WLED UI WiFi settings, ensure the appropriate stability checkboxes are checked to prevent frequent ESP8266 freezes or restarts.
# Installation guide: https://kno.wled.ge/basics/install-binary/Find educational YouTube channels for home lab setups
The following YouTube channels provide specialized knowledge and tutorials for building and managing home lab environments:
- TechnoTim: https://www.youtube.com/@TechnoTim
- JeffGeerling: https://www.youtube.com/@JeffGeerling
- christianlempa: https://www.youtube.com/@christianlempa
- Jims-Garage: https://www.youtube.com/@Jims-Garage
Integrate WLED with Home Assistant
WLED can be automatically configured in Home Assistant using the integration flow. Use the direct configuration link to start the setup process.https://my.home-assistant.io/redirect/config%5Fflow%5Fstart?domain=wledHardware setup for Inverter Battery Monitor
To monitor inverter battery voltage, current, and temperature using a NodeMCU/D1 Mini, follow these hardware requirements:
- Power Supply: Use an LM2596 step-down converter. You must tune the LM2596 using a multimeter before connecting it to the NodeMCU/D1 Mini, as the default output may be 12VDC or higher. Adjust the screw on top to decrease the voltage to a level safe for the microcontroller.
- Voltage Divider: Since the NodeMCU/D1 Mini has a limited input voltage on the A0 pin, use a voltage divider circuit. Calculate the required resistors (R1 and R2) based on your battery voltage (typically 12.5V to 14V) to ensure the output voltage at the A0 pin is approximately 3.5V.
- Power Monitoring: Integrate a POW or similar power monitoring device to calculate remaining battery life during power failures. Power failure can be detected when battery voltage drops below normal levels or via a smart switch connected to the inverter input.
Wire WLED strip to Wemos D1 Mini
Follow these wiring instructions to connect the hardware:
- Connect the 5V DC output from the SMPS to both the LED strip (+ and -) and the Wemos D1 Mini (+5V and -).
- Solder a 1000uF capacitor to the 3.3V and GND pins of the Wemos D1 Mini.
- Connect the LED strip Data pin to pin D5 on the Wemos D1 Mini.
Connect PZEM-004T sensor to ESP8266
The PZEM-004T is designed for 5V, but ESP chips (like the D1 Mini) use 3.3V GPIOs. To prevent damage to the ESP, a 1K resistor must be added to reduce the voltage for the RX line. If the sensor fails to work when powered by 5V after adding the resistor, try powering the PZEM sensor from the ESP 3.3V pin.ESP 5V <--> PZEM 5V ESP GND <--> PZEM GND ESP RX <--> PZEM TX ESP TX <--> PZEM RXHardware requirements for WLED ambient light
To build the ambient light project, you will need the following hardware components:
- WLED strip (WS2812), 30 or 60 LEDs per meter (optional aluminum channel)
- WeMo D1 Mini
- 1000uF capacitor
- 230V to 5V 2A SMPS (Power Supply)
- Power cord
- Enclosure
- Tools: Glue gun, soldering iron, and short wires.
Calculate Battery Backup and Status in Home Assistant
Create template sensors in Home Assistant to derive the UPS mode, battery status, load percentage, and estimated backup time based on the battery voltage and inverter power consumption.- platform: template sensors: battery_backup_time: friendly_name: Battery Backup Time unit_of_measurement: 'Hours' icon_template: 'mdi:car-battery' value_template: > {% if is_state('sensor.ups_mode', 'Battery') %} {{ ( 150 * (states('sensor.battery_voltage')|float) * 1 * 0.8 / states('sensor.inverter_energy_power')| float )| round(2) }} {% else %} ~ {% endif %} ups_mode: friendly_name: UPS Mode icon_template: 'mdi:flash-off' value_template: > {% if states('sensor.battery_voltage')| float > 13.50 %} Mains {% else %} Battery {% endif %} ups_load: friendly_name: UPS Load unit_of_measurement: '%' icon_template: 'mdi:download' value_template: > {% if is_state('sensor.ups_mode', 'Battery') %} {{ ( states('sensor.inverter_energy_power')| float * 100 / (1050 * 0.8) )| round(2) }} {% else %} 0 {% endif %} battery_status: friendly_name: Battery Status icon_template: 'mdi:information' value_template: > {% if states('sensor.battery_voltage')| float > 13.50 %} Fully Charged {% elif states('sensor.battery_voltage')| float < 10.50 %} About to Die {% else %} Charge/Discharge {% endif %}Configure PZEM-004T in ESPHome
Use thepzemacplatform in ESPHome to monitor AC current, voltage, energy, power, frequency, and power factor. Note that on the D1 Mini, logging should be disabled if the PZEM is connected to the hardware UART pins, as the board only has one UART interface.uart: rx_pin: 12 tx_pin: 14 baud_rate: 9600 sensor: - platform: pzemac current: name: "PZEM-016 Current" id: aac internal: true voltage: name: "PZEM-016 Voltage" id: vac internal: true energy: name: "PZEM-016 Energy" id: eac internal: true power: name: "PZEM-016 Power" id: w internal: true frequency: name: "PZEM-016 Frequency" id: f internal: true power_factor: name: "PZEM-016 Power Factor" id: pf internal: true update_interval: 2s - platform: total_daily_energy name: "Energy kwh" power_id: w filters: - multiply: 0.001 # Multiplication factor from W to kW unit_of_measurement: kWh accuracy_decimals: 1Configure ESPHome for Battery and Temperature Monitoring
Use the following ESPHome configuration for an ESP8266 (NodeMCUv2) to monitor battery voltage via the A0 pin and temperature/humidity via a DHT sensor on pin D0. Note that thecalibrate_linearfilter values for the battery voltage must be calibrated using a multimeter for accuracy.esphome: name: battery_monitor platform: ESP8266 board: nodemcuv2 wifi: ssid: XXYYZZ password: XXYYZZ fast_connect: true reboot_timeout: 0s manual_ip: static_ip: 192.168.1.116 # Required to flash again via OTA gateway: 192.168.1.1 subnet: 255.255.255.0 logger: level: DEBUG api: password: XXYYZZ ota: password: XXYYZZ sensor: - platform: adc pin: A0 name: Battery Voltage update_interval: 10s filters: - calibrate_linear: # min 2 values required - 0.95 -> 13.51 # need to caliberate using Multimeter - 0.96 -> 13.52 - platform: dht pin: D0 temperature: name: "Battery Temperature" humidity: name: "Battery Humidity" update_interval: 60s