2019-12-30 21:16:54 +00:00
|
|
|
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
|
2019-12-30 21:16:54 +00:00
|
|
|
|
|
|
|
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
|
2019-12-30 21:16:54 +00:00
|
|
|
|
|
|
|
binary_sensor:
|
2019-12-31 01:44:42 +00:00
|
|
|
- !include common/binary_sensor/status.yaml
|
2019-12-30 21:16:54 +00:00
|
|
|
- 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
|
2019-12-30 21:16:54 +00:00
|
|
|
- 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
|
2019-12-30 21:16:54 +00:00
|
|
|
|
|
|
|
text_sensor:
|
2019-12-31 01:44:42 +00:00
|
|
|
- !include common/text_sensor/version.yaml
|
|
|
|
- !include common/text_sensor/wifi.yaml
|