Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: kitchen-controller
- esp32:
- board: esp32dev
- framework:
- type: arduino
- # Enable logging
- logger:
- #level: INFO
- # Enable Home Assistant API
- ota:
- password: !secret ota_password
- api:
- password: !secret api_password
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: !secret ac_ap_ssid
- password: !secret ac_ap_password
- captive_portal:
- web_server:
- port: 80
- script:
- - id: turn_lights_off
- mode: restart # Light will be kept on during 1 minute since the latest time the script is executed
- then:
- - if:
- condition:
- and:
- - light.is_on: led_strip
- then:
- - logger.log: "Запускаем скрипт ожидания"
- - delay: 5min
- - logger.log: "Предупреждаем о скором выключении"
- - light.turn_on:
- id: led_strip
- brightness: 100%
- effect: pulse
- - delay: 30s
- - logger.log: "Выключаем свет"
- - light.turn_off: led_strip
- output:
- - platform: ledc
- pin: GPIO32
- id: gpio_32
- light:
- - platform: monochromatic
- output: gpio_32
- name: "Kitchen Light"
- id: led_strip
- on_turn_on:
- - logger.log: "Удаленное включение"
- - script.execute: turn_lights_off
- effects:
- - pulse:
- - pulse:
- name: "Slow Pulse"
- # transition_length: 0.5s
- update_interval: 2s # не работает
- sensor:
- # WiFi Signal Sensor
- # Датчик отображающий уровень сигнала Wifi
- - platform: wifi_signal
- name: "Kitchen WiFi Signal"
- update_interval: 60s
- # Uptime Sensor
- # Датчик отображающий время работы
- - platform: uptime
- name: "Kitchen WiFi Uptame"
- binary_sensor:
- - platform: gpio
- pin: GPIO22
- name: "Obstacle sensor"
- id: obstacle_sensor # Датчик препятствий
- on_press:
- - then:
- - logger.log: "Переключаем свет"
- - light.toggle:
- id: led_strip
- - script.execute: turn_lights_off
- filters:
- - delayed_on_off: 50ms
- - platform: gpio
- pin: GPIO23
- name: "PIR Sensor"
- device_class: motion
- on_release:
- - then:
- - logger.log: "Обнаружено движение."
- - script.execute: turn_lights_off
- - if:
- condition:
- and:
- - light.is_on: led_strip
- then:
- - light.turn_on:
- id: led_strip
- brightness: 100%
- effect: none
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement