Compare commits

..

10 Commits

14 changed files with 331 additions and 435 deletions

4
.gitignore vendored
View File

@@ -2,5 +2,7 @@
# 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
/secrets/*
secrets.yaml
./secrets.yaml
/venv/*

View File

@@ -1,4 +0,0 @@
python3 -m venv /home/lade/python_venv.
source venv/bin/activate

View File

@@ -1,131 +0,0 @@
esphome:
name: espfan
platform: ESP8266
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "feelhome123"
ota:
password: "feelhome123"
wifi:
ssid: "lauIOT"
password: "superiot1"
domain: .home.cabestan.be
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "EspFan Fallback Hotspot"
password: "jTlMOFiFOzog"
captive_portal:
web_server:
port: 80
time:
- platform: sntp
id: esptime
timezone: "Europe/Brussels"
on_time:
# Every 5 minutes
- seconds: /10
then:
- lambda: |-
ESP_LOGD("custom", "Test sensor is : %.1f [min: %.1f | max: %.1f] state: \n", id(tsensor).state, id(tmin).state, id(tmax).state );
if( id(tsensor).state < id(tmin).state ) {
auto call = id(my_fan).turn_off();
call.perform();
ESP_LOGD("custom", "Temp is low, so turn off");
return;
}
auto call = id(my_fan).turn_on();
call.perform();
id(my_fan).speed = ( id(tsensor).state - id(tmin).state ) / ( id(tmax).state - id(tmin).state ) *100 ;
ESP_LOGD("custom", "Threshold = %.1f % \n", ( id(tsensor).state - id(tmin).state ) / ( id(tmax).state - id(tmin).state ) *100 );
fan:
- platform: speed
output: output_fan
name: "Fan"
restore_mode: ALWAYS_ON
id: my_fan
dallas:
- pin: GPIO4
update_interval: 5s
number:
- platform: template
name: "Sensibilité"
optimistic: true
min_value: 0
max_value: 100
initial_value: 80
step: 1
id: sensivity
- platform: template
name: "T Max"
optimistic: true
min_value: 20
max_value: 60
initial_value: 35
step: 1
id: tmax
- platform: template
name: "T Min"
optimistic: true
min_value: 0
max_value: 20
initial_value: 20
step: 1
id: tmin
sensor:
- platform: dallas
address: 0x5f0000041a8f8628
name: "Battery Charger Temp"
id: tsensor
# sensor:
# - platform: pulse_counter
# pin:
# number: D2
# name: Fan Speed
# id: fan_rpm
# unit_of_measurement: 'RPM'
# filters:
# - multiply: 1
# update_interval: 3s
# count_mode:
# rising_edge: INCREMENT
# falling_edge: DISABLE
# Example output entry
output:
- platform: esp8266_pwm
id: output_fan
pin: D1
max_power: 100%
frequency: 25000 Hz

View File

@@ -1,110 +0,0 @@
esphome:
name: espgaz
platform: ESP32
board: esp-wrover-kit
on_boot:
priority: 200
then:
- light.turn_on:
id: cam_light
brightness: 65%
# - mqtt.publish:
# topic: espgaz/last_update
# payload: "Something happened!"
# deep_sleep:
# run_duration: 50sec
# sleep_duration: 550sec
logger:
api:
encryption:
key: !secret api_encryption_key
ota:
password: !secret ota_key
wifi:
ssid: "lauIOT"
password: "superiot1"
domain: .home.cabestan.be
ap:
ssid: "Espgaz Fallback Hotspot"
password: !secret ap_secret
captive_portal:
web_server:
port: 80
time:
- platform: sntp
id: esptime
timezone: "Europe/Brussels"
on_time:
- seconds: /30
then:
- light.turn_on:
id: cam_light
brightness: 65%
- delay: 1s
- mqtt.publish:
topic: espgaz/last_update
payload: !lambda |-
char out[32];
sprintf(out,"%f",id(my_uptime).state);
return out;
- delay: 5s
- light.turn_off:
id: cam_light
mqtt:
broker: 192.168.30.10
username: espgaz
password: "65eg64e8r7g98"
id: esp_mqtt
sensor:
- platform: uptime
name: Uptime Sensor
id: my_uptime
esp32_camera:
name: cam_gas_counter
ae_level: 1
external_clock:
pin: GPIO0
frequency: 20MHz
i2c_pins:
sda: GPIO26
scl: GPIO27
data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
vsync_pin: GPIO25
href_pin: GPIO23
pixel_clock_pin: GPIO22
power_down_pin: GPIO32
jpeg_quality: 10
special_effect: grayscale
max_framerate: 2fps
resolution: 1600x1200
idle_framerate: 0.1fps
esp32_camera_web_server:
- port: 8080
mode: snapshot
output:
- platform: ledc
pin: GPIO4
id: gpio_4
channel: 2
## GPIO_4 is the flash light pin
light:
- platform: monochromatic
output: gpio_4
name: PWM light
id: cam_light

75
espgaz2.yaml Normal file
View File

@@ -0,0 +1,75 @@
esphome:
name: espgaz32
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32-s3-devkitc-1
logger:
api:
password: !secret api_secret
ota:
platform: esphome
password: !secret ota_key
wifi:
ssid: !secret wireless_ssid
password: !secret wireless_key
domain: !secret wireless_domain
ap:
ssid: "ESPgaz_Fallback"
password: !secret ap_secret
captive_portal:
web_server:
port: 80
time:
- platform: sntp
id: sntp_time
servers:
- 193.190.198.10
# timezone: "Europe/Brussels"
on_time_sync:
then:
- logger.log: "NTP : Synchronized sntp clock"
mqtt:
broker: domotic.home.cabestan.be
username: espsalon
password: !secret mqtt_espsalon
globals:
- id: drops_absolute
type: unsigned long int
restore_value: yes
initial_value: '0'
binary_sensor:
- platform: gpio
pin:
number: GPIO6
mode:
input: true
pulldown: true
name: "gaz volume add"
id: gaz_volume_add
sensor:
- platform: template
name: gaz volume
id: gazvolume
unit_of_measurement: "m"
icon: "mdi:gauge"
lambda: return (3.02);
accuracy_decimals: 0

View File

@@ -1,6 +1,7 @@
esphome:
name: espsalon
platform: ESP8266
esp8266:
board: d1_mini
# Enable logging

View File

@@ -1,8 +1,10 @@
esphome:
name: espsensor32
platform: ESP32
esp32:
board: esp-wrover-kit
logger:
api:
@@ -37,7 +39,7 @@ time:
- logger.log: "NTP : Synchronized sntp clock"
mqtt:
broker: domotic.home.cabestan.be
broker: !secret mqtt_broker
username: espsalon
password: !secret mqtt_espsalon

View File

@@ -40,7 +40,7 @@ time:
- logger.log: "NTP : Synchronized sntp clock"
mqtt:
broker: domotic.home.cabestan.be
broker: !secret mqtt_broker
username: espsalon
password: !secret mqtt_espsalon
@@ -51,6 +51,16 @@ i2c:
frequency: 300kHz
id: bus_a
globals:
- id: gaz_impulse
type: int
restore_value: no
initial_value: '0'
- id: gaz_volume
type: float
restore_value: no
initial_value: '0'
ads1115:
- address: 0x48
@@ -60,15 +70,19 @@ sensor:
gain: 6.144
name: "ADS1115 Channel A0"
id: ads0
update_interval: 5s
update_interval: 3s
on_value:
then:
- component.update: waterlevel
- component.update: waterpercent
- component.update: watervolume
filters:
# - median:
# window_size: 20
# send_every: 5
# send_first_at: 3
- sliding_window_moving_average:
window_size: 30
window_size: 60
send_every: 10
# 0.74 volts à vide.
# 2.8 volts plein.
@@ -98,5 +112,43 @@ sensor:
lambda: return ( id(ads0).state - 0.74 ) * 0.9 / 2.0 * 5000.0;
accuracy_decimals: 0
- platform: template
name: gaz impulse
id: gaz_impulse_sensor
lambda: return id(gaz_impulse);
- platform: template
name: gaz volume
id: gaz_volume_sensor
lambda: return id(gaz_volume);
binary_sensor:
- platform: gpio
pin:
number: GPIO5
inverted: true
mode:
input: true
pullup: true
name: "gaz volume add"
id: gaz_volume_add
on_press:
- then:
- lambda: 'id(gaz_impulse) += 1; id(gaz_volume) += 0.01; '
- sensor.template.publish:
id: gaz_impulse_sensor
state: !lambda 'return id(gaz_impulse);'
button:
- platform: template
name: Reset counters
id: button_reset_counters
# Optional variables:
icon: "mdi:emoticon-outline"
on_press:
- logger.log: "Button pressed reset counters"
- lambda: 'id(gaz_impulse) = 0; id(gaz_volume) = 0.00; '
- sensor.template.publish:
id: gaz_impulse_sensor
state: !lambda 'return id(gaz_impulse);'

186
esptest2.yaml Normal file
View File

@@ -0,0 +1,186 @@
esphome:
name: esptest2
platform: ESP32
board: esp-wrover-kit
logger:
api:
password: !secret api_secret
ota:
platform: esphome
password: !secret ota_key
wifi:
ssid: !secret wireless_ssid
password: !secret wireless_key
domain: !secret wireless_domain
ap:
ssid: "ESPtest2_Fallback"
password: !secret ap_secret
captive_portal:
web_server:
port: 80
time:
- platform: sntp
id: sntp_time
servers:
- 193.190.198.10
# timezone: "Europe/Brussels"
on_time_sync:
then:
- logger.log: "NTP : Synchronized sntp clock"
mqtt:
broker: domotic.home.cabestan.be
username: espsalon
password: !secret mqtt_espsalon
i2c:
sda: 21
scl: 22
scan: true
frequency: 300kHz
id: bus_a
font:
- file: "fonts/Roboto/Roboto-Black.ttf"
id: my_font_16
size: 16
- file: "fonts/Roboto/Roboto-Black.ttf"
id: my_font_14
size: 14
- file: "fonts/materialdesignicons-webfont.ttf"
id: icons_14
size: 14
glyphs:
- "\U000F050F" # mdi-home-thermometer
- "\U000F058E" # mdi-water-percent
- "\U000F015F" # mdi-cloud
- "\U000F1252" # mdi-home-lightbulb-outline
- "\U000F0A60" # mdi-ip-network
globals:
- id: global_32
type: int
restore_value: no
initial_value: '0'
- id: global_33
type: int
restore_value: no
initial_value: '0'
- id: global_25
type: int
restore_value: no
initial_value: '0'
- id: global_26
type: int
restore_value: no
initial_value: '0'
- id: global_27
type: int
restore_value: no
initial_value: '0'
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
address: 0x3C
external_vcc: False
id: saloon_display
rotation: 90
# lambda: |-
# it.print(0, 0, id(my_font_16), "Hello World!");
pages:
- id: page1
lambda: |-
it.strftime( 32, 0, id(my_font_16), TextAlign::TOP_CENTER , "%H:%M:%S" , id(sntp_time).now() );
it.printf( 0, 25, id(my_font_14), TextAlign::TOP_LEFT , "v1:");
it.printf( 32, 25, id(my_font_14), TextAlign::TOP_LEFT , "%d" , id(binary_32).state );
it.printf( 0, 45, id(my_font_14), TextAlign::TOP_LEFT , "v2:");
it.printf( 32, 45, id(my_font_14), TextAlign::TOP_LEFT , "%d" , id(binary_33).state );
it.printf( 0, 65, id(my_font_14), TextAlign::TOP_LEFT , "v3:");
it.printf( 32, 65, id(my_font_14), TextAlign::TOP_LEFT , "%d" , id(binary_25).state );
it.printf( 0, 85, id(my_font_14), TextAlign::TOP_LEFT , "v4:");
it.printf( 32, 85, id(my_font_14), TextAlign::TOP_LEFT , "%d" , id(binary_26).state );
it.printf( 0, 105, id(my_font_14), TextAlign::TOP_LEFT , "a5");
it.printf( 32, 105, id(my_font_14), TextAlign::TOP_LEFT , "%f" , id(analog_36).state );
# it.printf( 18, 105, id(my_font_14), TextAlign::TOP_LEFT , "%s" , id(nw_connected).state );
sensor:
- platform: esp32_hall
name: "ESP32 Hall Sensor"
update_interval: 3s
- platform: adc
pin:
number: GPIO36
mode:
input: true
# pulldown: true
name: analog hall sensor
update_interval: 3s
id: analog_36
- platform: vl53l0x
name: "VL53L0x Distance"
address: 0x29
update_interval: 10s
long_range: true
binary_sensor:
- platform: gpio
pin:
number: 32
inverted: true
mode:
input: true
pullup: true
name: "binary_32"
id: binary_32
- platform: gpio
pin:
number: 33
inverted: true
mode:
input: true
pullup: true
name: "binary_33"
id: binary_33
- platform: gpio
pin:
number: 25
inverted: true
mode:
input: true
pullup: true
name: "binary_25"
id: binary_25
- platform: gpio
pin:
number: 26
inverted: true
mode:
input: true
pullup: true
name: "binary_26"
id: binary_26
- platform: gpio
pin:
number: 27
inverted: true
mode:
input: true
pullup: true
name: "binary_27"
id: binary_27

View File

@@ -1,8 +1,10 @@
esphome:
name: espwater
platform: ESP32
board: nodemcu-32s
esp32:
board: nodemcu-32s
framework:
type: arduino
logger:
@@ -30,7 +32,7 @@ web_server:
mqtt:
# broker: hass20.home.cabestan.be
broker: domotic.home.cabestan.be
broker: !secret mqtt_broker
# username: espsalon
username: espwater
# password: sala45224

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -1,143 +0,0 @@
esphome:
name: espsalon32
platform: ESP32
board: esp-wrover-kit
logger:
api:
password: !secret api_secret
ota:
platform: esphome
password: !secret ota_key
wifi:
ssid: !secret wireless_ssid
password: !secret wireless_key
domain: !secret wireless_domain
ap:
ssid: "ESPsalon_Fallback"
password: !secret ap_secret
captive_portal:
web_server:
port: 80
time:
- platform: sntp
id: sntp_time
servers:
- 193.190.198.10
# timezone: "Europe/Brussels"
on_time_sync:
then:
- logger.log: "NTP : Synchronized sntp clock"
mqtt:
broker: domotic.home.cabestan.be
username: espsalon
password: !secret mqtt_espsalon
i2c:
sda: 21
scl: 22
scan: true
frequency: 300kHz
id: bus_a
font:
- file: "fonts/Roboto/Roboto-Black.ttf"
id: my_font_16
size: 16
- file: "fonts/Roboto/Roboto-Black.ttf"
id: my_font_14
size: 14
- file: "fonts/materialdesignicons-webfont.ttf"
id: icons_14
size: 14
glyphs:
- "\U000F050F" # mdi-home-thermometer
- "\U000F058E" # mdi-water-percent
- "\U000F015F" # mdi-cloud
- "\U000F1252" # mdi-home-lightbulb-outline
- "\U000F0A60" # mdi-ip-network
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
address: 0x3C
external_vcc: False
id: saloon_display
rotation: 90
# lambda: |-
# it.print(0, 0, id(my_font_16), "Hello World!");
pages:
- id: page1
lambda: |-
it.strftime( 32, 0, id(my_font_16), TextAlign::TOP_CENTER , "%H:%M:%S" , id(sntp_time).now() );
it.printf( 0, 25, id(icons_14), TextAlign::TOP_LEFT , "\U000F050F");
it.printf( 18, 25, id(my_font_14), TextAlign::TOP_LEFT , "%.1f°" , id(temperature).state );
it.printf( 0, 45, id(icons_14), TextAlign::TOP_LEFT , "\U000F058E");
it.printf( 18, 45, id(my_font_14), TextAlign::TOP_LEFT , "%.1f%%", id(humidity).state );
it.printf( 0, 65, id(icons_14), TextAlign::TOP_LEFT , "\U000F015F");
it.printf( 18, 65, id(my_font_14), TextAlign::TOP_LEFT , "%.0f" , id(pressure).state );
it.printf( 0, 85, id(icons_14), TextAlign::TOP_LEFT , "\U000F1252");
it.printf( 18, 85, id(my_font_14), TextAlign::TOP_LEFT , "%.0f" , id(ambiantlight).state );
it.printf( 0, 105, id(icons_14), TextAlign::TOP_LEFT , "\U000F0A60");
# it.printf( 18, 105, id(my_font_14), TextAlign::TOP_LEFT , "%s" , id(nw_connected).state );
switch:
- platform: gpio
name: "Esp Salon Led"
pin: 2
binary_sensor:
- platform: gpio
pin: 14
name: "PIR Sensor"
device_class: motion
sensor:
- platform: dht
pin: 19
temperature:
id: temperature
name: "Living Room Temperature"
humidity:
id: humidity
name: "Living Room Humidity"
update_interval: 10s
- platform: bmp280_i2c
temperature:
name: "Living Room Temperature S2"
oversampling: 16x
pressure:
id: pressure
name: "Pressure"
address: 0x76
update_interval: 60s
- platform: adc
id: ambiantlight
pin: 36
name: "Living Room Brightness"
device_class: "illuminance"
unit_of_measurement: "lx"
update_interval: 5s
accuracy_decimals: 1
filters:
- multiply: 500.0
# - sliding_window_moving_average:
# window_size: 5
# send_every: 5

View File

@@ -1,36 +0,0 @@
esphome:
name: test1
platform: ESP32
board: esp-wrover-kit
logger:
api:
password: !secret api_secret
ota:
password: !secret ota_key
wifi:
ssid: !secret wireless_ssid
password: !secret wireless_key
domain: !secret wireless_domain
ap:
ssid: "ESPsalon_Fallback"
password: !secret ap_secret
captive_portal:
web_server:
port: 80
time:
- platform: sntp
id: sntp_time
servers:
- 193.190.198.10
# timezone: "Europe/Brussels"
on_time_sync:
then:
- logger.log: "NTP : Synchronized sntp clock"