rpi
                Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| rpi [2025/07/07 09:56] – created karcio | rpi [2025/07/07 11:31] (current) – karcio | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | == Home Assistant, ESPHome,  | + | == Home Assistant, ESPHome,  | 
| Line 14: | Line 14: | ||
| Raspberry Pi 3 | Raspberry Pi 3 | ||
| - | {{ : | + | {{ :0: | 
| ESP32 controller | ESP32 controller | ||
| - | {{ : | + | {{ :0: | 
| BMP280 sensor | BMP280 sensor | ||
| - | {{ :image1.j | + | {{ :0:image1.jpeg? | 
| + | |||
| + | ESP32 custom case | ||
| + | {{ : | ||
| + | |||
| + | == Prepare image HAOS: == | ||
| + |   * download HAOS for your rpi from https:// | ||
| + | < | ||
| + | https:// | ||
| + | </ | ||
| + | * unpack image | ||
| + | < | ||
| + | unxz haos_rpi2-13.0.img.xz | ||
| + | </ | ||
| + |   * insert sd card to your device and check how your machine recognize it - in mine case it is / | ||
| + | < | ||
| + | sudo fdisk -l | ||
| + | </ | ||
| + | * flash your sdcard | ||
| + | < | ||
| + | sudo dd if=Downloads/ | ||
| + | </ | ||
| + | |||
| + | == First run HA == | ||
| + | * insert sd card to RPI | ||
| + | * connect Ethernet cable | ||
| + | * insert WIFI dongle to usb port | ||
| + | * connect power to RPI and wait while for HA to run | ||
| + | * on your router check your rpi Ip address | ||
| + |   * in web browser insert rpi Ip address with port 8123,  http:// | ||
| + | * first create account | ||
| + | |||
| + | == Setup wifi connection on first run:== | ||
| + | * go to Settings > System > select Network and then wifi tab | ||
| + | * in ip4 select automatic | ||
| + | * in WI-FI scan network to find your network and insert SSID and password. Save after that | ||
| + | * reboot rpi to set up wifi | ||
| + | |||
| + | == Install Add-ons: | ||
| + | * go to : Settings > Add-ons | ||
| + | * click in add and install esphome and File editor | ||
| + | * esphome allows you to use esp32 | ||
| + | * file editor allows you to edit config files and check syntax | ||
| + | |||
| + | == HA config structure == | ||
| + | * configuration.yml | ||
| + | * automation.yml | ||
| + | * secrets.yml | ||
| + | |||
| + | == Connect BMP280 to ESP32 == | ||
| + | * BMP280 sensor has 6 pins but we use just 4: VCC, GRN, SCL, SDA | ||
| + |   * connet  | ||
| + | * BMP280 VCC -> ESP32 3V | ||
| + | * BMP280 GRN -> ESP32 GRN | ||
| + | * BMP280 SCL -> ESP32 D22 | ||
| + | * BMP280 SDA -> ESP32 D21 | ||
| + | |||
| + | ESP32 and BMP280 final photos. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | == Connect esp32 to rpi for first initial flash == | ||
| + | * connect esp32 using usb cable to rpi do RPI | ||
| + | * open ESPHome tab | ||
| + | * click on add new device | ||
| + | |||
| + | this is sample of config file: | ||
| + | |||
| + | < | ||
| + | esphome: | ||
| + | name: esp32-01 | ||
| + |   friendly_name: | ||
| + | |||
| + | esp32: | ||
| + | board: esp32dev | ||
| + |   framework: | ||
| + | type: arduino | ||
| + | |||
| + | # Enable logging | ||
| + | logger: | ||
| + | |||
| + | # Enable Home Assistant API | ||
| + | api: | ||
| + |   encryption: | ||
| + |     key: " | ||
| + | |||
| + | ota: | ||
| + | - platform: esphome | ||
| + |     password: " | ||
| + | |||
| + | wifi: | ||
| + | ssid: !secret wifi_ssid | ||
| + | password: !secret wifi_password | ||
| + | |||
| + | # Enable fallback hotspot (captive portal) in case wifi connection fails | ||
| + | ap: | ||
| + |     ssid: " | ||
| + |     password: " | ||
| + | |||
| + | captive_portal: | ||
| + | |||
| + | i2c: | ||
| + | sda: 21 | ||
| + | scl: 22 | ||
| + | scan: True | ||
| + | |||
| + | sensor: | ||
| + | - platform: bmp280_i2c | ||
| + |     temperature: | ||
| + |       name: " | ||
| + |       oversampling: | ||
| + | pressure: | ||
| + |       name: " | ||
| + | address: 0x76 | ||
| + |     update_interval: | ||
| + | </ | ||
| + | |||
| + | This is how looks sample of automation config | ||
| + | |||
| + | < | ||
| + | alias: " | ||
| + | description: | ||
| + | trigger: | ||
| + | - platform: state | ||
| + |     entity_id: | ||
| + | - sensor.temperature | ||
| + | to: null | ||
| + | for: | ||
| + | hours: 0 | ||
| + | minutes: 30 | ||
| + | seconds: 0 | ||
| + | condition: | ||
| + | - condition: or | ||
| + |     conditions: | ||
| + | - condition: numeric_state | ||
| + | entity_id: sensor.temperature | ||
| + | above: 25 | ||
| + | - condition: numeric_state | ||
| + | entity_id: sensor.temperature | ||
| + | below: 5 | ||
| + | - condition: numeric_state | ||
| + | entity_id: sensor.temperature | ||
| + | below: 0 | ||
| + | action: | ||
| + | - data: | ||
| + |       message: " | ||
| + |       title: " | ||
| + | action: notify.email_notification | ||
| + | mode: single | ||
| + | </ | ||
| + | |||
| + | Whole documentation is here: https:// | ||
rpi.1751882162.txt.gz · Last modified:  by karcio
                
                