This is an old revision of the document!


Home Assistant AC Control

Introduction

The primary objective of this project is to enable the integration of non-smart infrared (IR) devices into a home automation system. This integration focuses on enhancing control methods beyond the traditional remote control. A key motivation for this project is the need to automate air conditioning (AC) units. The goal is to establish automation, such as activating heating or cooling when approaching the home under specific temperature conditions. Additionally, the project aims to facilitate voice control of the AC units using Amazon Alexa.

Hardware

Hardware List

  • ESP32-C3 (Seeed XIAO Studio): Chosen for its compact size, low power consumption, and adequate functionalities (PINs, VCC3, VCC5, USB-C).
  • 2.4GHz Antenna
  • IR Emitter LED
  • IR Receiver (VS838)
  • DHT11 Temperature and Humidity Sensor
  • PN2222A Transistor
  • 470Ω Resistor
  • Raspberry Pi 4B (8GB RAM)

Circuit Design

The circuit and PCB were designed using KiCad. The ESP32-C3's small footprint and low power requirements make it ideal for creating compact sensors. A PN2222A transistor and a 470Ω resistor are used to adapt the 5V requirement of the IR emitter to the 3.3V ESP architecture. The DHT11 sensor is integrated to provide room temperature data, assisting the climate control plugin, mainly since some AC units do not relay their state via IR.

Enclosure Design

To ensure the device blends seamlessly into day-to-day environments without exposing wires or internal components, a custom enclosure was designed using Fusion 360. The design includes:

  • Reusing IR-transparent plastic from an old remote to conceal the LEDs.
  • An upper part designed to allow ventilation for the DHT11 sensor.
  • Three iterations were undertaken to achieve a satisfactory fit and aesthetic.

Final product

Software

Schema

Home Assistant

ESPHome

The IR Controller

esphome:
  name: ir-controller
  friendly_name: IR controller
  libraries:
    # fix for https://github.com/esphome/issues/issues/4208
    - IRremoteESP8266=https://github.com/predam/IRremoteESP8266.git#v2.8.6

esp32:
  board: seeed_xiao_esp32c3
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "***"

ota:
  password: "***"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.1.x
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.1.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ir-Controller Fallback Hotspot"
    password: "***"

external_components:
  - source: github://Jorre05/remote_receiver
    components: [ remote_receiver ]
  - source: github://predam/remote_transmitter
    components: [ remote_transmitter ]

captive_portal:

remote_receiver:
  id: rcvr
  pin:
    number: 4 #D2
    inverted: true
    mode:
      input: true
      pullup: true
  rmt_channel: 2
  tolerance: 55%
  dump: all

remote_transmitter:
  id: trsm
  pin: 3 #D1
  rmt_channel: 1
  # Infrared remotes use a 50% carrier signal
  carrier_duty_percent: 50%

switch:
  - platform: template
    name: "AC On"
    turn_on_action:
      remote_transmitter.transmit_panasonic:
        address: 0x4004
        command: 0x0720008C
  - platform: template
    name: "AC DRY"
    turn_on_action:
      remote_transmitter.transmit_panasonic:
        address: 0x4004
        command: 0x07200004
sensor:
  - platform: dht
    pin: 7 #D6
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s

climate:
  - platform: heatpumpir
    protocol: panasonic_dke
    horizontal_default: auto
    vertical_default: auto
    max_temperature: 30
    min_temperature: 16
    name: "Living Room AC"
    receiver_id: rcvr
    transmitter_id: trsm

Conclusion

Resources

iothings/proiecte/2023/hometempcontrol.1705313084.txt.gz · Last modified: 2024/01/15 12:04 by mihai.preda1808
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0