ESPHome-Devices/master_bed.yaml

53 lines
1.4 KiB
YAML
Raw Normal View History

substitutions:
device_id: master_bed
device_name: Master Bed
platform: ESP8266
board: nodemcuv2
2019-12-31 01:44:42 +00:00
ip_address: !secret master_bed_ip
ota_pwd: !secret master_bed_ota_pwd
api_pwd: !secret master_bed_api_pwd
ap_wifi_pwd: !secret master_bed_ap_wifi_pwd
esphome:
<<: !include common/esphome.yaml
includes:
- bed_sensor.h
<<: !include common/common.yaml
2020-02-14 02:59:08 +00:00
<<: !include common/logger/logger_none.yaml
binary_sensor:
2019-12-31 01:44:42 +00:00
- !include common/binary_sensor/status.yaml
- platform: custom
lambda: |-
auto bedSensor = new BedSensor();
App.register_component(bedSensor);
return {bedSensor->melissaInBed, bedSensor->chrisInBed, bedSensor->someoneInBed};
binary_sensors:
- name: "Melissa is in Bed"
id: melissa_in_bed
device_class: occupancy
- name: "Chris is in Bed"
id: chris_in_bed
device_class: occupancy
- name: "Someone is in Bed"
id: someone_in_bed
device_class: occupancy
sensor:
2019-12-31 01:44:42 +00:00
- !include common/sensor/uptime.yaml
- !include common/sensor/wifi.yaml
- platform: template
name: "Master Bed Count"
id: master_bed_count
accuracy_decimals: 0
icon: "mdi:hotel"
lambda: |-
return id(melissa_in_bed).state + id(chris_in_bed).state + id(someone_in_bed).state;
switch:
2019-12-31 01:44:42 +00:00
- !include common/switch/restart.yaml
text_sensor:
2019-12-31 01:44:42 +00:00
- !include common/text_sensor/version.yaml
- !include common/text_sensor/wifi.yaml