2022-10-01 15:30:11
This commit is contained in:
@@ -0,0 +1,60 @@
|
|||||||
|
esphome:
|
||||||
|
name: distance
|
||||||
|
platform: ESP8266
|
||||||
|
board: d1_mini
|
||||||
|
|
||||||
|
# Enable logging
|
||||||
|
logger:
|
||||||
|
# baud_rate: 0
|
||||||
|
|
||||||
|
# Enable Home Assistant API
|
||||||
|
api:
|
||||||
|
reboot_timeout: 0s
|
||||||
|
|
||||||
|
ota:
|
||||||
|
password: !secret otaPassword
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
networks:
|
||||||
|
- ssid: !secret wifi_ssid
|
||||||
|
password: !secret wifi_password
|
||||||
|
- ssid: !secret wifi_ssid2
|
||||||
|
password: !secret wifi_password2
|
||||||
|
domain: .lan
|
||||||
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||||
|
ap:
|
||||||
|
ssid: "D1 Fallback Hotspot"
|
||||||
|
password: !secret apPassword
|
||||||
|
|
||||||
|
web_server:
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
captive_portal:
|
||||||
|
|
||||||
|
time:
|
||||||
|
- platform: sntp
|
||||||
|
id: time1
|
||||||
|
timezone: Europe/Amsterdam
|
||||||
|
|
||||||
|
|
||||||
|
status_led:
|
||||||
|
pin:
|
||||||
|
number: GPIO2
|
||||||
|
inverted: True
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
broker: mqtt.lan
|
||||||
|
discovery: true
|
||||||
|
|
||||||
|
# Distance sensor
|
||||||
|
sensor:
|
||||||
|
- platform: wifi_signal
|
||||||
|
name: "WiFi Signal Sensor"
|
||||||
|
update_interval: 60s #to display WiFi signal strength
|
||||||
|
|
||||||
|
- platform: ultrasonic
|
||||||
|
trigger_pin: D5
|
||||||
|
echo_pin: D6
|
||||||
|
name: "distance1"
|
||||||
|
update_interval: 5s
|
||||||
|
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
esphome:
|
||||||
|
name: t-camera
|
||||||
|
platform: ESP32
|
||||||
|
board: ttgo-t1
|
||||||
|
|
||||||
|
# Enable logging
|
||||||
|
logger:
|
||||||
|
|
||||||
|
# Enable Home Assistant API
|
||||||
|
api:
|
||||||
|
|
||||||
|
ota:
|
||||||
|
password: !secret ota
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
networks:
|
||||||
|
- ssid: !secret wifi_ssid
|
||||||
|
password: !secret wifi_password
|
||||||
|
- ssid: !secret wifi_ssid2
|
||||||
|
password: !secret wifi_password2
|
||||||
|
domain: .lan
|
||||||
|
|
||||||
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||||
|
ap:
|
||||||
|
ssid: !secret ap_ssid
|
||||||
|
password: !secret ap_password
|
||||||
|
|
||||||
|
web_server:
|
||||||
|
port: 80
|
||||||
|
# Sync time with Home Assistant.
|
||||||
|
time:
|
||||||
|
- platform: sntp
|
||||||
|
id: homeassistant_time
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
broker: mqtt.lan
|
||||||
|
discovery: true
|
||||||
|
|
||||||
|
i2c:
|
||||||
|
sda: GPIO21
|
||||||
|
scl: GPIO22
|
||||||
|
frequency: 500 kHz
|
||||||
|
scan: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
captive_portal:
|
||||||
|
|
||||||
|
# Example configuration entry
|
||||||
|
esp32_camera:
|
||||||
|
external_clock:
|
||||||
|
pin: GPIO32
|
||||||
|
frequency: 20MHz
|
||||||
|
i2c_pins:
|
||||||
|
sda: GPIO13
|
||||||
|
scl: GPIO12
|
||||||
|
data_pins: [GPIO5, GPIO14, GPIO4, GPIO15, GPIO18, GPIO23, GPIO36, GPIO39]
|
||||||
|
vsync_pin: GPIO27
|
||||||
|
href_pin: GPIO25
|
||||||
|
pixel_clock_pin: GPIO19
|
||||||
|
# power_down_pin: GPIO26
|
||||||
|
vertical_flip: true
|
||||||
|
horizontal_mirror: true
|
||||||
|
# Image settings
|
||||||
|
name: t-Cam
|
||||||
|
resolution: 800x600
|
||||||
|
|
||||||
|
esp32_camera_web_server:
|
||||||
|
- port: 8080
|
||||||
|
mode: stream
|
||||||
|
- port: 8081
|
||||||
|
mode: snapshot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin: 33
|
||||||
|
name: "TC1"
|
||||||
|
device_class: motion
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: homeassistant
|
||||||
|
id: pwr2
|
||||||
|
entity_id: sensor.power_usage
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- platform: mqtt_subscribe
|
||||||
|
name: "mqttp03"
|
||||||
|
id: mp1
|
||||||
|
topic: p1/sensor/power/state
|
||||||
|
|
||||||
|
|
||||||
|
font:
|
||||||
|
- file: 'slkscr.ttf'
|
||||||
|
id: font1
|
||||||
|
size: 8
|
||||||
|
|
||||||
|
- file: 'BebasNeue-Regular.ttf'
|
||||||
|
id: font2
|
||||||
|
size: 42
|
||||||
|
|
||||||
|
- file: 'arial.ttf'
|
||||||
|
id: f3
|
||||||
|
size: 32
|
||||||
|
|
||||||
|
- file: 'ubuntu-r.ttf'
|
||||||
|
id: tiny
|
||||||
|
size: 10
|
||||||
|
|
||||||
|
- file: 'Comic_Sans_MS.ttf'
|
||||||
|
id: sans
|
||||||
|
size: 25
|
||||||
|
|
||||||
|
- file: "digital-7.ttf"
|
||||||
|
id: sseg
|
||||||
|
size: 30
|
||||||
|
|
||||||
|
|
||||||
|
display:
|
||||||
|
- platform: ssd1306_i2c
|
||||||
|
model: "SSD1306 128x64"
|
||||||
|
address: 0x3C
|
||||||
|
rotation: 180
|
||||||
|
#reset_pin: D0
|
||||||
|
id: my_display
|
||||||
|
pages:
|
||||||
|
- id: page1
|
||||||
|
lambda: |-
|
||||||
|
if (id(mp1).has_state()) {
|
||||||
|
it.printf(0, 0, id(f3), TextAlign::TOP_LEFT , "%s k", id(mp1).state.c_str());
|
||||||
|
}
|
||||||
|
if (id(pwr2).has_state()) {
|
||||||
|
it.printf(0, 64, id(f3), TextAlign::BASELINE_LEFT , "%.0f W", id(pwr2).state);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user