Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: t_camv162c
- platform: ESP32
- board: esp-wrover-kit
- wifi:
- ssid: "xxxxx"
- password: "xxxxx"
- manual_ip:
- static_ip: xxx.xxx.xxx.xxx
- subnet: xxx.xxx.xxx.xxx
- gateway: xxx.xxx.xxx.xxx
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "xxx"
- password: "xxx"
- captive_portal:
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- ota:
- mqtt:
- broker: 192.168.1.130
- topic_prefix: /os/cameras/b8f009c0d984
- birth_message:
- topic: /os/cameras/status
- payload: "b8f009c0d984 online"
- will_message:
- topic: /os/cameras/status
- payload: "b8f009c0d984 lost"
- shutdown_message:
- topic: /os/cameras/status
- payload: "b8f009c0d984 offline"
- log_topic: /os/debug
- client_id: b8f009c0d984
- on_message:
- topic: /os/soundOff
- then:
- - mqtt.publish_json:
- topic: !lambda |-
- return "/os/herald";
- payload: !lambda |-
- root["gadgetType"] = 3;
- root["gadgetId"] = get_mac_address();
- root["online"] = 1;
- binary_sensor:
- - platform: gpio
- pin: GPIO19
- name: PIR
- id: movement
- device_class: motion
- on_state:
- then:
- - mqtt.publish:
- topic: !lambda |-
- return "/os/cameras/" + get_mac_address() +"/motion";
- payload: !lambda |-
- return id(movement).state ? "1" : "0";
- - platform: gpio
- pin:
- number: GPIO15
- mode: INPUT_PULLUP
- inverted: True
- name: Button
- - platform: status
- name: Status
- sensor:
- - platform: wifi_signal
- name: WiFi Signal
- update_interval: 10s
- - platform: uptime
- name: Uptime
- esp32_camera:
- name: Camera
- external_clock:
- pin: GPIO4
- frequency: 20MHz
- i2c_pins:
- sda: GPIO18
- scl: GPIO23
- data_pins: [GPIO34, GPIO13, GPIO14, GPIO35, GPIO39, GPIO38, GPIO37, GPIO36]
- vsync_pin: GPIO5
- href_pin: GPIO27
- pixel_clock_pin: GPIO25
- # power_down_pin: GPIO26
- resolution: 640x480
- jpeg_quality: 10
- vertical_flip: true
- horizontal_mirror: true
- i2c:
- sda: GPIO21
- scl: GPIO22
- font:
- - file: "fonts/times-new-roman.ttf"
- id: tnr1
- size: 20
- - file: "fonts/times-new-roman.ttf"
- id: tnr2
- size: 35
- - file: "fonts/times-new-roman.ttf"
- id: tnr3
- size: 70
- time:
- - platform: homeassistant
- id: homeassistant_time
- display:
- - platform: ssd1306_i2c
- model: "SSD1306 128x64"
- address: 0x3C
- rotation: 180
- lambda: |-
- if(id(movement).state) {
- it.print(64, 54, id(tnr3), TextAlign::BASELINE_CENTER, "Boo!");
- } else {
- it.strftime(64, 0, id(tnr1), TextAlign::TOP_CENTER,"%d-%m-%Y", id(homeassistant_time).now());
- it.strftime(64, 64, id(tnr2), TextAlign::BASELINE_CENTER, "%H:%M", id(homeassistant_time).now());
- }
Add Comment
Please, Sign In to add comment