Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- device_name: socket_aquarium_light
- friendly_name: Socket Aquarium Light
- esphome:
- name: socket_aquarium_light
- platform: ESP8266
- board: esp01_1m
- wifi:
- networks:
- - ssid: !secret wifi_iot_ssid
- password: !secret wifi_iot_password
- hidden: true
- manual_ip:
- static_ip: [ip]
- gateway: !secret wifi_iot_gateway
- subnet: !secret wifi_iot_subnet
- ap:
- ssid: ${device_name} AP
- password: !secret wifi_ap_password
- captive_portal:
- ota:
- password: !secret ota_password
- safe_mode: true
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- switch:
- - platform: gpio
- name: ${friendly_name}
- pin: GPIO12
- id: relay
- restore_mode: RESTORE_DEFAULT_OFF
- dallas:
- pin: GPIO14
- update_interval: 60s
- sensor:
- # - platform: dallas
- # address: 0x420316A279E6DB28
- # name: Aquarium Temperature
- # id: aquarium_temperature
- # resolution: 12
- - platform: wifi_signal
- name: ${friendly_name} Wifi Strength
- update_interval: 30s
- binary_sensor:
- - platform: gpio
- pin:
- number: GPIO0
- mode: INPUT_PULLUP
- inverted: True
- name: ${friendly_name} Button
- on_press:
- - switch.toggle: relay
- - platform: status
- name: ${friendly_name} Status
- # - platform: template
- # name: is_aquarium_temperature_ok
- # lambda: |-
- # if (isnan(id(aquarium_temperature).state)) {
- # return {};
- # } else if (id(aquarium_temperature).state > 25.0) {
- # return true;
- # } else {
- # return false;
- # }
- status_led:
- pin:
- number: GPIO13
- inverted: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement