group projects

This commit is contained in:
Bram Kelchtermans
2024-05-09 21:57:08 +02:00
parent aec6d5dd41
commit dba8f1bc25
6 changed files with 0 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml
+5
View File
@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml
+66
View File
@@ -0,0 +1,66 @@
esphome:
name: bedscale
esp8266:
board: d1_mini
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Bed-Scale Fallback Hotspot"
password: !secret hotspot_password
captive_portal:
globals:
- id: constant_weight
type: float
sensor:
- platform: hx711
id: bed
internal: true
dout_pin: D4
clk_pin: D3
update_interval: 3s
gain: 128
filters:
- calibrate_linear:
- 2827100 -> 0
- 5170670 -> 103.9
on_value:
- if:
condition:
- lambda: |-
static float last = 0.0;
float diff = x - last;
last = x;
return x < 10.0 && diff < 1.0 && diff > - 1.0;
then:
- lambda: 'id(constant_weight) = x;'
- platform: template
name: Bedscale
icon: mdi:weight-kilogram
update_interval: 3s
unit_of_measurement: kg
lambda: 'return id(bed).state;'
filters:
- lambda: 'return x - id(constant_weight);'
- lambda: 'return x >= 10.0 ? x : 0;'
- delta: 0.5
+36
View File
@@ -0,0 +1,36 @@
esphome:
name: bedscale
esp8266:
board: d1_mini
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Bed-Scale Fallback Hotspot"
password: !secret hotspot_password
captive_portal:
sensor:
- platform: hx711
name: "HX711 Value"
dout_pin: D4
clk_pin: D3
gain: 128
update_interval: 3s
+5
View File
@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml
+88
View File
@@ -0,0 +1,88 @@
substitutions:
device_name: "Slaapkamer Lamp"
esphome:
name: shelly1-slaapkamer
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.179.28
gateway: 192.168.178.1
subnet: 255.255.254.0
dns1: 1.1.1.1
dns2: 8.8.8.8
power_save_mode: none
captive_portal:
logger:
api:
ota:
web_server:
port: 80
text_sensor:
- platform: wifi_info
ip_address:
name: ${device_name} IP
- platform: wifi_info
bssid:
name: ${device_name} BSSID
- platform: template
name: "${device_name} WiFi Strength"
update_interval: 60s
lambda: |-
float rssi = id(wifi_signal_sensor).state;
if (rssi <= -80.0) {
return std::string("WEAK");
} else if (rssi <= -70.0) {
return std::string("OK");
} else if (rssi <= -60.0) {
return std::string("GOOD");
} else {
return std::string("PERFECT");
}
sensor:
- platform: uptime
name: ${device_name} Uptime
- platform: wifi_signal
name: ${device_name} WiFi Signal
update_interval: 60s
id: wifi_signal_sensor
switch:
- platform: gpio
name: ${device_name}
pin: GPIO4
id: shelly_relay
restore_mode: ALWAYS_OFF
- platform: "restart"
name: "${device_name} Restart"
binary_sensor:
- platform: gpio
name: ${device_name} Input
pin:
number: GPIO5
filters:
- delayed_on_off: 50ms
id: button
time:
- platform: sntp
id: sntp_time
timezone: Europe/Brussels
servers:
- time.google.com
- 0.be.pool.ntp.org
- 3.be.pool.ntp.org