backup 20240718

This commit is contained in:
2024-07-18 09:12:31 +02:00
parent a863b212ed
commit 63fb7f8f73
213 changed files with 5916 additions and 40388 deletions

View File

@@ -0,0 +1,12 @@
---
sensor:
- platform: ahtxx
i2c_id: bus_a
type: aht30
address: 0x38
temperature:
name: "Temperature"
id: temp_local
humidity:
name: "Humidity"
update_interval: 20s

View File

@@ -15,6 +15,6 @@ sensor:
name: 'Humidity (BME280)'
# filters: # uncomment after calibration
# - offset: -2.3 # offset in °C for the measured temperature
address: 0x77
address: 0x76
update_interval: ${update_interval}
setup_priority: -300

View File

@@ -0,0 +1,7 @@
---
sensor:
- platform: vl53l0x
name: "Distance"
address: 0x29
update_interval: 5s
long_range: true

View File

@@ -5,7 +5,7 @@ sensor:
name: "light sensor"
id: "tls2591"
address: 0x29
update_interval: 60s
update_interval: 10s
gain: auto
device_factor: 53
glass_attenuation_factor: 14.4

View File

@@ -0,0 +1,41 @@
---
at581x:
id: "Radar"
i2c_id: bus_a
binary_sensor:
- platform: gpio
pin:
number: ${pin_presence}
name: "Presence detect"
disabled_by_default: false
device_class: "occupancy"
filters:
- delayed_off: !lambda return id(radar_delayed_off).state * 1000;
on_press:
then:
- light.turn_on: led
on_release:
then:
- light.turn_off: led
number:
- platform: template
name: "Presence duration"
id: radar_delayed_off
icon: mdi:account-clock
optimistic: true
restore_value: true
initial_value: 60
min_value: 0
step: 5
max_value: 300
unit_of_measurement: s
entity_category: config
mode: box
switch:
# Switch to turn on/off RF emission
- platform: at581x
at581x_id: "Radar"
name: "Enable Radar"

View File

@@ -0,0 +1,73 @@
uart:
id: uart_bus
tx_pin: GPIO13
rx_pin: GPIO14
baud_rate: 115200
debug:
direction: BOTH
dummy_receiver: true
after:
delimiter: "\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
binary_sensor:
- platform: gpio
name: mmWave
id: mmwave
device_class: occupancy
pin:
number: GPIO15
mode: INPUT_PULLDOWN
number:
- platform: template
id: mmwave_distance
name: mmWave distance
icon: mdi:arrow-left-right
entity_category: config
min_value: 0
max_value: 800
initial_value: 315
optimistic: true
step: 15
restore_value: true
unit_of_measurement: cm
mode: slider
set_action:
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: !lambda int cm = (int)ceil(x / 15.0);
std::string cms = "detRangeCfg -1 0 " + to_string(cm);
return std::vector<unsigned char>(cms.begin(), cms.end());
- delay: 1s
- uart.write: "saveCfg 0x45670123 0xCDEF89AB 0x956128C6 0xDF54AC89"
- delay: 1s
- switch.turn_on: mmwave_sensor
switch:
- platform: template
name: UART target output
id: uart_target_output
entity_category: config
internal: ${uart_target_output_disabled}
optimistic: true
assumed_state: false
turn_on_action:
- logger.log: "UART Target Output On"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: "setUartOutput 2 1 1 1"
- delay: 1s
- uart.write: "saveConfig"
- delay: 3s
- switch.turn_on: mmwave_sensor
turn_off_action:
- logger.log: "UART Presence Output Off"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: "setUartOutput 2 0"
- delay: 1s
- uart.write: "saveConfig"
- delay: 3s
- switch.turn_on: mmwave_sensor

View File

@@ -0,0 +1,168 @@
button:
- platform: template
name: Restart mmWave sensor
id: restart_mmwave
entity_category: config
internal: true
on_press:
- uart.write: "resetSystem"
- platform: template
name: Restart
icon: mdi:restart
entity_category: config
disabled_by_default: True
on_press:
- button.press: restart_mmwave
- button.press: restart_internal
- platform: template
name: Factory reset mmWave
icon: mdi:cog-counterclockwise
id: factory_reset_mmwave
internal: ${factory_reset_disabled}
entity_category: config
on_press:
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: "resetCfg"
- delay: 3s
- switch.turn_on: mmwave_sensor
light:
- platform: binary
name: mmWave LED
output: mmwave_led_output
entity_category: config
disabled_by_default: False
output:
- platform: template
id: mmwave_led_output
type: binary
write_action:
- switch.turn_off: mmwave_sensor
- delay: 1s
- if:
condition:
lambda: !lambda return state;
then:
- uart.write: "setLedMode 1 0"
else:
- uart.write: "setLedMode 1 1"
- delay: 1s
- uart.write: "saveConfig"
- delay: 3s
- switch.turn_on: mmwave_sensor
number:
- platform: template
name: mmWave off latency
icon: mdi:clock-end
entity_category: config
id: mmwave_off_latency
min_value: 1
max_value: 600
initial_value: 15
optimistic: true
step: 5
restore_value: true
unit_of_measurement: seconds
mode: slider
set_action:
- logger.log: "Off latency set"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: !lambda |-
std::string mss = "setLatency " + to_string(id(mmwave_on_latency).state) + " " + to_string(id(mmwave_off_latency).state);
return std::vector<unsigned char>(mss.begin(), mss.end());
- delay: 1s
- uart.write: "saveCfg 0x45670123 0xCDEF89AB 0x956128C6 0xDF54AC89"
- delay: 1s
- switch.turn_on: mmwave_sensor
- platform: template
name: mmWave on latency
icon: mdi:clock-start
id: mmwave_on_latency
entity_category: config
min_value: 0
max_value: 2
initial_value: 0
optimistic: true
step: 0.25
restore_value: true
unit_of_measurement: seconds
mode: slider
set_action:
- logger.log: "On latency set"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: !lambda |-
std::string mss = "setLatency " + to_string(id(mmwave_on_latency).state) + " " + to_string(id(mmwave_off_latency).state);
return std::vector<unsigned char>(mss.begin(), mss.end());
- delay: 1s
- uart.write: "saveCfg 0x45670123 0xCDEF89AB 0x956128C6 0xDF54AC89"
- delay: 1s
- switch.turn_on: mmwave_sensor
- platform: template
name: mmWave sensitivity
icon: mdi:target-variant
id: mmwave_sensitivity
entity_category: config
min_value: 0
max_value: 9
initial_value: 7
optimistic: true
step: 1
restore_value: true
set_action:
- logger.log: "Sensitivity set"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write:
!lambda std::string mss = "setSensitivity " + to_string((int)x);
return std::vector<unsigned char>(mss.begin(), mss.end());
- delay: 1s
- uart.write: "saveConfig"
- delay: 1s
- switch.turn_on: mmwave_sensor
switch:
- platform: template
name: mmWave sensor
id: mmwave_sensor
disabled_by_default: True
entity_category: config
optimistic: true
restore_mode: DISABLED
turn_on_action:
- uart.write: "sensorStart"
- delay: 1s
turn_off_action:
- uart.write: "sensorStop"
- delay: 1s
- platform: template
name: UART presence output
id: uart_presence_output
entity_category: config
internal: ${uart_presence_output_disabled}
optimistic: true
turn_on_action:
- logger.log: "UART Presence Output On"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: "setUartOutput 1 1"
- delay: 1s
- uart.write: "saveConfig"
- delay: 3s
- switch.turn_on: mmwave_sensor
turn_off_action:
- logger.log: "UART Presence Output Off"
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: "setUartOutput 1 0"
- delay: 1s
- uart.write: "saveConfig"
- delay: 3s
- switch.turn_on: mmwave_sensor

View File

@@ -0,0 +1,14 @@
---
touchscreen:
platform: gt911
i2c_id: ${touch_bus}
id: gt911_touchscreen
interrupt_pin: ${touch_irq}
on_touch:
- then:
- logger.log:
format: Touch at (%d, %d)
args: [touch.x, touch.y]
- light.turn_on: led
- delay: 5s
- light.turn_off: led