mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-10 02:50:12 -04:00
rearranging esphome
This commit is contained in:
@@ -0,0 +1,798 @@
|
||||
substitutions:
|
||||
devicename: circuit-sensor
|
||||
entity_name: circuit_sensor
|
||||
friendly_name: Circuit Sensor
|
||||
board: esp32-s3-devkitc-1
|
||||
framework: esp-idf
|
||||
comment: Clever ${friendly_name}
|
||||
name_prefix: 'PM:'
|
||||
static_ip: !secret circuit-sensor-ip
|
||||
update_time: 500ms
|
||||
kwh_report_interval: 60s
|
||||
watt_heartbeat: 60s
|
||||
throttle_time: 60s
|
||||
watt_delta: "50.0"
|
||||
grid_watt_delta: "200.0"
|
||||
|
||||
# Current Transformer Names
|
||||
ct01Name: 'Grid Phase A'
|
||||
ct04Name: 'Grid Phase B'
|
||||
|
||||
ct22Name: 'Well' # 1, 3 # sct010 - O
|
||||
ct12Name: 'Kitchen 1' # 5 # sct006 - L
|
||||
ct16Name: 'Kitchen 2' # 7 # sct006 - S
|
||||
ct18Name: 'Laundry Plug' # 9 # sct006 - N
|
||||
ct08Name: 'Microwave Plug' # 11 # sct006 - H
|
||||
ct17Name: 'Bathroom Plug' # 13 # sct006 - R
|
||||
ct11Name: 'Heat Pump' # 15, 17 - M
|
||||
ct24Name: 'Basement Bedroom and Furnace Room Lights' # 19 # sct006 - K
|
||||
ct05Name: 'Basement Plugs' # 21a # sct006 - E
|
||||
ct23Name: 'Basement and Laundry Lights and Plugs' # 21b # sct006 - W
|
||||
ct07Name: 'Sump Pump Plug' # 23 # sct006 - C
|
||||
|
||||
ct06Name: 'Nursery, Dining, Kitchen Lights' # 2 # sct006 - F
|
||||
ct20Name: 'Master Suite' # 4 # sct006 - T
|
||||
ct03Name: 'Furnace' # 6 # sct006 - D
|
||||
ct15Name: 'Basement Stairs and Lights' # 8 # sct006 - P
|
||||
ct21Name: 'Dishwasher' # 10 # sct006 - V
|
||||
ct13Name: 'Garage Outside and Front Garage Lights' # 12 # sct006 - U
|
||||
ct10Name: 'Front Room Plugs' # 14 # sct006 - J
|
||||
ct14Name: 'Garage and Outside Plugs' # 16 # sct006 - Q
|
||||
ct09Name: 'Stove' # 18, 20 # sct016 - I
|
||||
ct02Name: 'Dryer' # 22, 24 # sct010 - G
|
||||
|
||||
ct19Name: 'Unused'
|
||||
|
||||
# Current Transformers:
|
||||
sct006: '11143'
|
||||
sct010: '41660'
|
||||
sct013: '27518'
|
||||
sct016: '41787'
|
||||
voltage_cal: '7305'
|
||||
|
||||
# Sensor Pins
|
||||
spi_clk: 7
|
||||
spi_miso: 5
|
||||
spi_mosi: 6
|
||||
ic1_main: 8
|
||||
ic1_addon1: 0
|
||||
ic1_addon2: 7
|
||||
ic1_addon3: 2
|
||||
ic2_main: 4
|
||||
ic2_addon1: 16
|
||||
ic2_addon2: 17
|
||||
ic2_addon3: 21
|
||||
|
||||
packages:
|
||||
network: !include common/waveshare_esp32_s3_eth.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
web_server: !include common/web_server.yaml
|
||||
|
||||
esp32:
|
||||
board: ${board}
|
||||
framework:
|
||||
type: ${framework}
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
id: sntp_time
|
||||
timezone: America/Detroit
|
||||
|
||||
|
||||
# TODO: If I want to use this board, I'd need to translate PINs
|
||||
# https://www.waveshare.com/esp32-s3-eth.htm
|
||||
# Use a 40 pin ribbon cable so that the esp can be outside the breaker box?
|
||||
|
||||
# https://github.com/CircuitSetup/Expandable-6-Channel-ESP32-Energy-Meter/blob/master/Software/ESPHome/README.md
|
||||
|
||||
# QUESTION: Is there a way to separate the power so this can use POE
|
||||
# Either way, the power from the adapter would need to make it to the main board somehow.
|
||||
|
||||
spi:
|
||||
clk_pin: ${spi_clk}
|
||||
miso_pin: ${spi_miso}
|
||||
mosi_pin: ${spi_mosi}
|
||||
interface: any
|
||||
|
||||
sensor:
|
||||
#IC1 Main
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic1_main}
|
||||
phase_a:
|
||||
voltage:
|
||||
name: ${name_prefix} [V]
|
||||
id: ic1Volts
|
||||
filters:
|
||||
- throttle_average: 60s
|
||||
accuracy_decimals: 1
|
||||
current:
|
||||
name: ${name_prefix} ${ct01Name} [A]
|
||||
id: ct1Amps
|
||||
filters:
|
||||
- or:
|
||||
- delta: 2
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
power:
|
||||
name: ${name_prefix} ${ct01Name} [W]
|
||||
id: ct1Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${grid_watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct016}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct02Name} [W]
|
||||
id: ct2Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct010}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct03Name} [W]
|
||||
id: ct3Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
frequency:
|
||||
name: ${name_prefix} Freq A
|
||||
filters:
|
||||
- or:
|
||||
- delta: 0.05
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
#IC2 Main
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_main}
|
||||
phase_a:
|
||||
current:
|
||||
name: ${name_prefix} ${ct04Name} [A]
|
||||
id: ct4Amps
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${grid_watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
power:
|
||||
name: ${name_prefix} ${ct04Name} [W]
|
||||
id: ct4Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct016}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct05Name} [W]
|
||||
id: ct5Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct06Name} [W]
|
||||
id: ct6Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
frequency:
|
||||
name: ${name_prefix} Freq B
|
||||
filters:
|
||||
- or:
|
||||
- delta: 0.05
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
|
||||
#IC1 AddOn 1
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic1_addon1}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${name_prefix} ${ct07Name} [W]
|
||||
id: ct7Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct08Name} [W]
|
||||
id: ct8Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct09Name} [W]
|
||||
id: ct9Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct013}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC2 AddOn 1
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_addon1}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${name_prefix} ${ct10Name} [W]
|
||||
id: ct10Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct11Name} [W]
|
||||
id: ct11Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct010}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct12Name} [W]
|
||||
id: ct12Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
#IC1 AddOn 2
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic1_addon2}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${name_prefix} ${ct13Name} [W]
|
||||
id: ct13Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct14Name} [W]
|
||||
id: ct14Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct15Name} [W]
|
||||
id: ct15Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC2 AddOn 2
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_addon2}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${name_prefix} ${ct16Name} [W]
|
||||
id: ct16Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct17Name} [W]
|
||||
id: ct17Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct18Name} [W]
|
||||
id: ct18Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC1 AddOn 3
|
||||
- platform: atm90e32
|
||||
#do not use GPIO2 if ESP32 has an on-board LED assigned to it
|
||||
cs_pin: ${ic1_addon3}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${name_prefix} ${ct19Name} [W]
|
||||
id: ct19Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct20Name} [W]
|
||||
id: ct20Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct21Name} [W]
|
||||
id: ct21Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC2 AddOn 3
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_addon3}
|
||||
phase_a:
|
||||
power:
|
||||
#name: ${name_prefix} ${ct22Name} [W]
|
||||
internal: true
|
||||
id: ct22Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct010}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${name_prefix} ${ct23Name} [W]
|
||||
id: ct23Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${name_prefix} ${ct24Name} [W]
|
||||
id: ct24Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
#Total Amps From Grid
|
||||
- platform: template
|
||||
name: ${name_prefix} Grid Total [A]
|
||||
id: totalAmpsFromGrid
|
||||
lambda: return id(ct1Amps).state + id(ct4Amps).state ;
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: A
|
||||
device_class: current
|
||||
state_class: measurement
|
||||
update_interval: ${update_time}
|
||||
filters:
|
||||
- or:
|
||||
- delta: 2.0
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
|
||||
#Total Watts From Grid
|
||||
- platform: template
|
||||
name: ${name_prefix} Grid Total [W]
|
||||
id: totalWattsFromGrid
|
||||
lambda: return id(ct1Watts).state + id(ct4Watts).state ;
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: W
|
||||
device_class: power
|
||||
state_class: measurement
|
||||
update_interval: ${update_time}
|
||||
filters:
|
||||
- or:
|
||||
- delta: 5.0
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
|
||||
#kWh From Grid
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} Grid [kWh]
|
||||
power_id: totalWattsFromGrid
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
# - heartbeat: ${kwh_report_interval}
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
# The CT for the Well needs to be calibrated.
|
||||
# In the interim, I'm using this lambda
|
||||
- platform: template
|
||||
name: ${name_prefix} ${ct22Name} [W]
|
||||
id: ct22WattsPositive
|
||||
state_class: measurement
|
||||
lambda: |-
|
||||
if (id(ct22Watts).state < 0){
|
||||
return 0;
|
||||
} else {
|
||||
return id(ct22Watts).state ;
|
||||
}
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: W
|
||||
icon: mdi:lightning-bolt-circle
|
||||
update_interval: ${update_time}
|
||||
filters:
|
||||
- delta: 5.0
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
|
||||
# kWh from CT1
|
||||
# This is included in the grid calculation
|
||||
|
||||
# kWh from CT2 (the dryer)
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct02Name} [kWh]
|
||||
power_id: ct2Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 3
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct03Name} [kWh]
|
||||
power_id: ct3Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
# kWh From CT 4
|
||||
# This is included in the Grid calculation area
|
||||
|
||||
#kWh From CT 5
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct05Name} [kWh]
|
||||
power_id: ct5Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 6
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct06Name} [kWh]
|
||||
power_id: ct6Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 7
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct07Name} [kWh]
|
||||
power_id: ct7Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 8
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct08Name} [kWh]
|
||||
power_id: ct8Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 9
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct09Name} [kWh]
|
||||
power_id: ct9Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 10
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct10Name} [kWh]
|
||||
power_id: ct10Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 11 (Heat Pump)
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct11Name} [kWh]
|
||||
power_id: ct11Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 12
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct12Name} [kWh]
|
||||
power_id: ct12Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 13
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct13Name} [kWh]
|
||||
power_id: ct13Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 14
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct14Name} [kWh]
|
||||
power_id: ct14Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 15
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct15Name} [kWh]
|
||||
power_id: ct15Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 16
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct16Name} [kWh]
|
||||
power_id: ct16Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 17
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct17Name} [kWh]
|
||||
power_id: ct17Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 18
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct18Name} [kWh]
|
||||
power_id: ct18Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 19
|
||||
# this is not used
|
||||
# - platform: total_daily_energy
|
||||
# name: ${name_prefix} ${ct19Name} [kWh]
|
||||
# power_id: ct19Watts
|
||||
# filters:
|
||||
# - multiply: 0.001
|
||||
# - throttle_average: ${kwh_report_interval}
|
||||
# unit_of_measurement: kWh
|
||||
# device_class: energy
|
||||
# state_class: total_increasing
|
||||
# # min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 20
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct20Name} [kWh]
|
||||
power_id: ct20Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 21
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct21Name} [kWh]
|
||||
power_id: ct21Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 22
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct22Name} [kWh]
|
||||
power_id: ct22WattsPositive
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 23
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct23Name} [kWh]
|
||||
power_id: ct23Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 24
|
||||
- platform: total_daily_energy
|
||||
name: ${name_prefix} ${ct24Name} [kWh]
|
||||
power_id: ct24Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
@@ -0,0 +1,84 @@
|
||||
substitutions:
|
||||
devicename: front-yard-plant-monitor
|
||||
entity_name: front_yard_plant_monitor
|
||||
friendly_name: Front Yard Plant Monitor
|
||||
platform: ESP32
|
||||
board: esp32-poe-iso
|
||||
static_ip: !secret front-yard-plant-monitor-ip
|
||||
|
||||
packages:
|
||||
#wifi: !include common/wifi_no_power_save.yaml
|
||||
ethernet: !include common/olimex-poe.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
ble_proxy: !include common/ble_proxy.yaml
|
||||
|
||||
esp32:
|
||||
board: esp32-poe-iso
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
logs:
|
||||
ultrasonic.sensor: WARN
|
||||
#hx711: INFO
|
||||
|
||||
|
||||
#esp32_ble_tracker:
|
||||
|
||||
# xiaomi_ble:
|
||||
|
||||
|
||||
# id: eth
|
||||
# type: LAN8720
|
||||
# mdc_pin: GPIO23
|
||||
# mdio_pin: GPIO18
|
||||
# clk_mode: GPIO17_OUT
|
||||
# phy_addr: 0
|
||||
# power_pin: GPIO5
|
||||
|
||||
#C4:7C:8D:6D:3E:AE
|
||||
|
||||
sensor:
|
||||
- platform: ultrasonic
|
||||
trigger_pin: GPIO13
|
||||
echo_pin: GPIO14
|
||||
name: "Car Sensor East Side"
|
||||
timeout: 4.0m
|
||||
update_interval: 0.5s
|
||||
filters:
|
||||
- or:
|
||||
- throttle_average: 30s
|
||||
- delta: 0.5
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
- delta: 0.0254
|
||||
|
||||
- platform: ultrasonic
|
||||
trigger_pin: GPIO15
|
||||
echo_pin: GPIO16
|
||||
name: "Car Sensor West Side"
|
||||
timeout: 4.0m
|
||||
update_interval: 0.5s
|
||||
filters:
|
||||
- or:
|
||||
- throttle_average: 30s
|
||||
- delta: 0.5
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
- delta: 0.0254
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: Outer Garage Door
|
||||
device_class: door
|
||||
pin:
|
||||
mode: INPUT_PULLUP
|
||||
number: GPIO5
|
||||
|
||||
- platform: gpio
|
||||
name: Inner Garage Door
|
||||
device_class: door
|
||||
pin:
|
||||
mode: INPUT_PULLUP
|
||||
number: GPIO4
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,198 @@
|
||||
substitutions:
|
||||
devicename: furnace-room-multisensor
|
||||
entity_name: furnace_room_multisensor
|
||||
friendly_name: Furnace Room MultiSensor
|
||||
comment: Clever MultiSensor
|
||||
board: nodemcuv2
|
||||
static_ip: !secret furnace-room-multisensor-ip
|
||||
|
||||
|
||||
# For the reed switches
|
||||
door: 35
|
||||
moisture: 36
|
||||
|
||||
# For the ultrasonic sensor
|
||||
trigger: 14
|
||||
echo: 15
|
||||
|
||||
# Infrared Sensor
|
||||
ir_tx: 12
|
||||
ir_rx: 39
|
||||
|
||||
# I2C Pins
|
||||
i2c_sda: 13
|
||||
i2c_scl: 16
|
||||
|
||||
# For the ethernet adapter
|
||||
ethernet_mdc_pin: 23
|
||||
ethernet_mdio_pin: 18
|
||||
ethernet_clk_pin: 0
|
||||
|
||||
# For the relays
|
||||
relay1: 32
|
||||
relay2: 33
|
||||
|
||||
# Built-in button
|
||||
button1: 34
|
||||
|
||||
# For the HVAC temperature sensors
|
||||
one_wire: 17
|
||||
|
||||
one_wire:
|
||||
- platform: gpio
|
||||
pin: ${one_wire}
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
friendly_name: ${friendly_name}
|
||||
name_add_mac_suffix: false
|
||||
|
||||
packages:
|
||||
network: !include common/olimex_evb.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
|
||||
|
||||
# Included in common/olimex-evb.yaml
|
||||
# esp32:
|
||||
# board: esp32dev
|
||||
# framework:
|
||||
# type: esp-idf
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
version: 3
|
||||
include_internal: True
|
||||
|
||||
# # Enable Home Assistant API
|
||||
# api:
|
||||
# encryption:
|
||||
# key: "mupTLNBggWPdKHxBeY1yV47qXgyhVJUgIVVAvfGrZ40="
|
||||
|
||||
# ota:
|
||||
# - platform: esphome
|
||||
# password: "b43bd5c6f724d64a9bd4e92504830d8f"
|
||||
|
||||
remote_receiver:
|
||||
pin: ${ir_rx}
|
||||
dump: all
|
||||
|
||||
remote_transmitter:
|
||||
pin: ${ir_tx}
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
i2c:
|
||||
sda: ${i2c_sda}
|
||||
scl: ${i2c_scl}
|
||||
scan: true
|
||||
id: bus_a
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: "ESP32-EVB button"
|
||||
pin: ${button1}
|
||||
|
||||
- platform: gpio
|
||||
name: "Door"
|
||||
device_class: door
|
||||
filters:
|
||||
- invert:
|
||||
pin:
|
||||
number: ${door}
|
||||
# mode: INPUT_PULLUP
|
||||
|
||||
- platform: gpio
|
||||
name: "Moisture"
|
||||
device_class: moisture
|
||||
pin:
|
||||
number: ${moisture}
|
||||
# mode: INPUT_PULLUP
|
||||
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
pin: ${relay1}
|
||||
name: "Relay1"
|
||||
|
||||
- platform: gpio
|
||||
pin: ${relay2}
|
||||
name: "Relay2"
|
||||
|
||||
sensor:
|
||||
- platform: ultrasonic
|
||||
trigger_pin: ${trigger}
|
||||
echo_pin: ${echo}
|
||||
id: ultrasonic_source
|
||||
update_interval: 1s
|
||||
internal: True
|
||||
filters:
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
send_first_at: 1
|
||||
- lambda: 'return round( x * 10.0) / 10.0;'
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: distance_from_bottom
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- sensor.template.publish:
|
||||
id: distance_from_top
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_bottom
|
||||
name: "Salt Level in CM"
|
||||
icon: mdi:arrow-collapse-up
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (0.94 - x) * 100;'
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: level_in_bags
|
||||
state: !lambda 'return id(distance_from_bottom).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_top
|
||||
name: "Salt Level From Top in CM"
|
||||
icon: mdi:arrow-collapse-down
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return x * 100;'
|
||||
- round: 1
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "bags"
|
||||
state_class: measurement
|
||||
id: level_in_bags
|
||||
name: "Salt Level in Bags"
|
||||
icon: mdi:counter
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return x / 17.5;'
|
||||
- round: 1
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 10.0
|
||||
@@ -0,0 +1,236 @@
|
||||
# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v
|
||||
substitutions:
|
||||
devicename: hvac-multisensor
|
||||
entity_name: hvac_multisensor
|
||||
friendly_name: HVAC MultiSensor
|
||||
comment: Clever MultiSensor
|
||||
platform: ESP32
|
||||
board: wemos_d1_mini32
|
||||
static_ip: !secret hvac-multisensor-ip
|
||||
|
||||
# For i2c devices
|
||||
# In this case it's just the display
|
||||
sda_pin: GPIO21
|
||||
scl_pin: GPIO22
|
||||
|
||||
door_pin: GPIO19
|
||||
|
||||
one_wire_pin: GPIO26
|
||||
|
||||
# For the ultrasonic sensor
|
||||
trigger_pin: GPIO16
|
||||
echo_pin: GPIO13
|
||||
|
||||
#mdc_pin: GPIO23
|
||||
#mdio_pin: GPIO18
|
||||
#clk_mode: GPIO17_OUT
|
||||
#power_pin: GPIO5
|
||||
|
||||
packages:
|
||||
# network: !include common/ethernet.yaml
|
||||
network: !include common/wifi.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
ble_proxy: !include common/ble_proxy.yaml
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
friendly_name: ${friendly_name}
|
||||
name_add_mac_suffix: false
|
||||
|
||||
esp32:
|
||||
board: ${board}
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
api: # Using settings from common/device_base.yaml
|
||||
|
||||
ota: # Using settings from common/device_base.yaml
|
||||
|
||||
esp32_ble_tracker:
|
||||
|
||||
globals:
|
||||
- id: oled_enabled
|
||||
type: bool
|
||||
restore_value: yes
|
||||
initial_value: 'false'
|
||||
|
||||
- id: screen_power
|
||||
type: bool
|
||||
restore_value: yes
|
||||
initial_value: 'false'
|
||||
|
||||
font:
|
||||
- file: 'fonts/CascadiaMonoPL.ttf'
|
||||
id: font1
|
||||
size: 17
|
||||
|
||||
# - file: "gfonts://Roboto"
|
||||
# id: roboto_20
|
||||
# size: 20
|
||||
|
||||
# - file: "gfonts://Material+Symbols+Outlined"
|
||||
# id: icons_50
|
||||
# size: 50
|
||||
# glyphs: ["\U0000e425"] # mdi-timer
|
||||
|
||||
one_wire:
|
||||
- platform: gpio
|
||||
pin: ${one_wire_pin}
|
||||
|
||||
i2c:
|
||||
sda: ${sda_pin}
|
||||
scl: ${scl_pin}
|
||||
frequency: 800kHz
|
||||
|
||||
sensor:
|
||||
- platform: dallas_temp
|
||||
address: 0xB33C01B607798528
|
||||
name: "Return"
|
||||
id: hvac_return
|
||||
icon: mdi:home-thermometer-outline
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: dallas_temp
|
||||
address: 0x0F3C01B6070C1328
|
||||
name: "Supply"
|
||||
id: hvac_supply
|
||||
icon: mdi:thermostat
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: dallas_temp
|
||||
address: 0xFA3C01B607005B28
|
||||
name: "Ambient"
|
||||
id: ambient
|
||||
icon: mdi:home-thermometer
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: template
|
||||
name: "Delta"
|
||||
id: hvac_delta
|
||||
icon: mdi:thermometer-lines
|
||||
lambda: |-
|
||||
return (id(hvac_supply).state - id(hvac_return).state);
|
||||
update_interval: 10s
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
filters:
|
||||
- or:
|
||||
- throttle: 60s
|
||||
- delta: 1.0
|
||||
|
||||
- platform: ultrasonic
|
||||
trigger_pin: ${trigger_pin}
|
||||
echo_pin: ${echo_pin}
|
||||
id: ultrasonic_source
|
||||
update_interval: 1s
|
||||
internal: True
|
||||
filters:
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
send_first_at: 1
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: distance_from_bottom
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- sensor.template.publish:
|
||||
id: distance_from_top
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_bottom
|
||||
name: "Salt Level in CM"
|
||||
icon: mdi:arrow-collapse-up
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (0.94 - (id(ultrasonic_source).state)) * 100;'
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: level_in_bags
|
||||
state: !lambda 'return id(distance_from_bottom).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_top
|
||||
name: "Salt Level From Top in CM"
|
||||
icon: mdi:arrow-collapse-down
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (id(ultrasonic_source).state) * 100;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "bags"
|
||||
state_class: measurement
|
||||
id: level_in_bags
|
||||
name: "Salt Level in Bags"
|
||||
icon: mdi:counter
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (id(distance_from_bottom).state) / 17.5;'
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: oled
|
||||
model: "SSD1306 128x64"
|
||||
#reset_pin: GPIO14 #D0
|
||||
address: 0x3C
|
||||
lambda: |-
|
||||
it.print(0, 0, id(font1), "Delta:");
|
||||
it.printf(128, 0, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_delta).state);
|
||||
it.print(0, 16, id(font1), "Supply:");
|
||||
it.printf(128, 16, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_supply).state);
|
||||
it.print(0, 32, id(font1), "Return:");
|
||||
it.printf(128, 32, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_return).state);
|
||||
it.print(0, 48, id(font1), "Ambient:");
|
||||
it.printf(128, 48, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(ambient).state);
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: "Door"
|
||||
device_class: door
|
||||
pin: ${door_pin}
|
||||
filters:
|
||||
- invert:
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
id: display_switch
|
||||
icon: mdi:console
|
||||
name: "Display"
|
||||
lambda: |-
|
||||
// if (id(screen_power)) {
|
||||
// id(oled).turn_on();
|
||||
// } else {
|
||||
// id(oled).turn_off();
|
||||
// }
|
||||
return id(screen_power);
|
||||
turn_on_action:
|
||||
- lambda: |-
|
||||
id(screen_power) = true;
|
||||
turn_off_action:
|
||||
- lambda: |-
|
||||
id(screen_power) = false;
|
||||
@@ -0,0 +1,110 @@
|
||||
# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v
|
||||
substitutions:
|
||||
devicename: hvac-multisensor
|
||||
entity_name: hvac_multisensor
|
||||
friendly_name: HVAC MultiSensor
|
||||
comment: Clever MultiSensor
|
||||
platform: ESP8266
|
||||
board: d1_mini
|
||||
#variant: esp32
|
||||
# framework: esp-idf
|
||||
#framework: arduino
|
||||
static_ip: !secret hvac-multisensor-ip
|
||||
|
||||
packages:
|
||||
network: !include common/wifi.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
friendly_name: ${friendly_name}
|
||||
name_add_mac_suffix: false
|
||||
|
||||
esp8266:
|
||||
board: ${board}
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
#level: VERBOSE
|
||||
|
||||
|
||||
one_wire:
|
||||
- platform: gpio
|
||||
pin: D5
|
||||
|
||||
sensor:
|
||||
- platform: dallas_temp
|
||||
address: 0x5a3c01d6078a2e28
|
||||
name: "Probe 1"
|
||||
id: probe1
|
||||
icon: mdi:thermostat
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: |-
|
||||
float val = x;
|
||||
if (isnan(val)) {
|
||||
val = 0.0;
|
||||
}
|
||||
return val * (9.0/5.0) + 32.0;
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
- or:
|
||||
- throttle: 60s
|
||||
- delta: 1.0
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: dallas_temp
|
||||
address: 0x6b3c01d6077bbb28
|
||||
name: "Probe 2"
|
||||
id: probe2
|
||||
icon: mdi:thermostat
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
- or:
|
||||
- throttle: 60s
|
||||
- delta: 1.0
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: dallas_temp
|
||||
address: 0x2a3c01d6073e0728
|
||||
name: "Probe 3"
|
||||
id: probe3
|
||||
icon: mdi:thermostat
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
- or:
|
||||
- throttle: 60s
|
||||
- delta: 1.0
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: template
|
||||
name: "Delta"
|
||||
id: hvac_delta
|
||||
icon: mdi:thermometer-lines
|
||||
lambda: |-
|
||||
return round( (id(probe1).state - id(probe2).state) * 100.0) / 100.0;
|
||||
update_interval: 10s
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
device_class: ""
|
||||
accuracy_decimals: 1
|
||||
filters:
|
||||
#- lambda: 'return round( (id(probe1).state - id(probe2).state) * 100.0) / 100.0;'
|
||||
- clamp:
|
||||
min_value: -100.0
|
||||
max_value: 100.0
|
||||
- or:
|
||||
- throttle: 60s
|
||||
- delta: 1.0
|
||||
@@ -0,0 +1,106 @@
|
||||
substitutions:
|
||||
devicename: kitchen-appliance-temps
|
||||
entity_name: kitchen_appliance_temps
|
||||
friendly_name: Kitchen Appliance Temps
|
||||
platform: ESP32
|
||||
board: esp32dev
|
||||
static_ip: !secret kitchen-appliance-temps-ip
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
packages:
|
||||
wifi: !include common/wifi.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
|
||||
i2c:
|
||||
sda: GPIO21
|
||||
scl: GPIO22
|
||||
scan: true
|
||||
id: i2c_bus_a
|
||||
|
||||
spi:
|
||||
clk_pin: GPIO18
|
||||
miso_pin: GPIO19
|
||||
mosi_pin: GPIO23
|
||||
id: spi_bus_a
|
||||
|
||||
mcp23017:
|
||||
- id: 'mcp23017_hub_a'
|
||||
address: 0x20
|
||||
|
||||
sensor:
|
||||
- platform: max31855
|
||||
#- platform: max6675
|
||||
name: "Oven Temperature"
|
||||
cs_pin: GPIO25
|
||||
#update_interval: 5s
|
||||
update_interval: 1s
|
||||
unit_of_measurement: "°C"
|
||||
device_class: temperature
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
filters:
|
||||
- or:
|
||||
- heartbeat: 60s
|
||||
- delta: 18.0
|
||||
- lambda: !lambda |-
|
||||
if (x > 320) return {};
|
||||
if (x < -10) return {};
|
||||
return x;
|
||||
|
||||
- platform: max31855
|
||||
name: "Fridge Temperature"
|
||||
cs_pin: GPIO32
|
||||
update_interval: 5s
|
||||
unit_of_measurement: "°C"
|
||||
device_class: temperature
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
filters:
|
||||
- or:
|
||||
- heartbeat: 60s
|
||||
- delta: 1.8
|
||||
- lambda: !lambda |-
|
||||
if (x > 320) return {};
|
||||
if (x < -10) return {};
|
||||
return x;
|
||||
|
||||
- platform: max31855
|
||||
name: "Freezer Temperature"
|
||||
cs_pin: GPIO33
|
||||
update_interval: 5s
|
||||
unit_of_measurement: "°C"
|
||||
device_class: temperature
|
||||
state_class: measurement
|
||||
accuracy_decimals: 0
|
||||
filters:
|
||||
- or:
|
||||
- heartbeat: 60s
|
||||
- delta: 1.8
|
||||
- lambda: !lambda |-
|
||||
if (x > 320) return {};
|
||||
if (x < -10) return {};
|
||||
return x;
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: "Fridge Door"
|
||||
pin:
|
||||
mcp23xxx: mcp23017_hub_a
|
||||
number: 0
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: false
|
||||
|
||||
- platform: gpio
|
||||
name: "Freezer Door"
|
||||
pin:
|
||||
mcp23xxx: mcp23017_hub_a
|
||||
number: 1
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: false
|
||||
@@ -0,0 +1,29 @@
|
||||
substitutions:
|
||||
devicename: master-bed
|
||||
entity_name: master_bed
|
||||
friendly_name: Master Bed
|
||||
platform: ESP32
|
||||
board: wemos_d1_mini32
|
||||
static_ip: !secret master-bed-ip
|
||||
dout_pin: !secret master-bed-dout
|
||||
clk_pin: !secret master-bed-clk
|
||||
loadcell_zero: !secret master-bed-zero
|
||||
loadcell_load: !secret master-bed-load
|
||||
loadcell_weight: !secret master-bed-weight
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
level: DEBUG
|
||||
logs:
|
||||
sensor: INFO
|
||||
hx711: DEBUG
|
||||
|
||||
packages:
|
||||
wifi: !include common/ethernet.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
hx711: !include common/hx711_single_verbose.yaml
|
||||
# Disabling this to see if it does a better job of staying online
|
||||
# ble_proxy: !include common/ble_proxy.yaml
|
||||
|
||||
esp32:
|
||||
board: wemos_d1_mini32
|
||||
@@ -0,0 +1,229 @@
|
||||
# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v
|
||||
|
||||
|
||||
substitutions:
|
||||
devicename: furnace-room-multisensor
|
||||
entity_name: furnace_room_multisensor
|
||||
friendly_name: Furnace Room MultiSensor
|
||||
comment: Clever MultiSensor
|
||||
platform: ESP32
|
||||
board: esp32dev
|
||||
static_ip: !secret furnace-room-multisensor-ip
|
||||
|
||||
one_wire_pin: GPIO16
|
||||
sda_pin: GPIO21
|
||||
scl_pin: GPIO22
|
||||
door_pin: GPIO27
|
||||
trigger_pin: GPIO33
|
||||
echo_pin: GPIO35
|
||||
#mdc_pin: GPIO23
|
||||
#mdio_pin: GPIO18
|
||||
#clk_mode: GPIO17_OUT
|
||||
#power_pin: GPIO5
|
||||
|
||||
packages:
|
||||
#wifi: !include common/wifi_no_power_save.yaml
|
||||
ethernet: !include common/ethernet.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
ble_proxy: !include common/ble_proxy.yaml
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
friendly_name: ${friendly_name}
|
||||
|
||||
esp32:
|
||||
board: ${board}
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
api: # Using settings from common/device_base.yaml
|
||||
|
||||
ota: # Using settings from common/device_base.yaml
|
||||
|
||||
wifi: # Using settings from common/wifi*.yaml
|
||||
use_address: "192.168.1.230"
|
||||
|
||||
captive_portal:
|
||||
|
||||
esp32_ble_tracker:
|
||||
|
||||
globals:
|
||||
- id: screen_power
|
||||
type: bool
|
||||
restore_value: yes
|
||||
initial_value: 'true'
|
||||
|
||||
font:
|
||||
- file: 'CascadiaMonoPL.ttf'
|
||||
id: font1
|
||||
size: 17
|
||||
|
||||
one_wire:
|
||||
- platform: gpio
|
||||
pin: ${one_wire_pin}
|
||||
|
||||
i2c:
|
||||
# sda: GPIO13 #D1
|
||||
# scl: GPIO15 #D2
|
||||
sda: ${sda_pin}
|
||||
scl: ${scl_pin}
|
||||
frequency: 800kHz
|
||||
|
||||
display:
|
||||
- platform: ssd1306_i2c
|
||||
id: oled
|
||||
model: "SSD1306 128x64"
|
||||
#reset_pin: GPIO14 #D0
|
||||
address: 0x3C
|
||||
lambda: |-
|
||||
it.print(0, 0, id(font1), "Delt:");
|
||||
it.printf(128, 0, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_delta).state);
|
||||
it.print(0, 16, id(font1), "HVAC:");
|
||||
it.printf(128, 16, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac).state);
|
||||
it.print(0, 32, id(font1), "Retn:");
|
||||
it.printf(128, 32, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(hvac_return).state);
|
||||
it.print(0, 48, id(font1), "Ambt:");
|
||||
it.printf(128, 48, id(font1), TextAlign::TOP_RIGHT, "%.1f°F", id(ambient).state);
|
||||
|
||||
sensor:
|
||||
- platform: dallas_temp
|
||||
address: 0xB33C01B607798528
|
||||
name: "Return Temperature"
|
||||
id: hvac_return
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: dallas_temp
|
||||
address: 0x0F3C01B6070C1328
|
||||
name: "HVAC Temperature"
|
||||
id: hvac
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: dallas_temp
|
||||
address: 0xFA3C01B607005B28
|
||||
name: "Furnace Room Temperature"
|
||||
id: ambient
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- lambda: return x * (9.0/5.0) + 32.0;
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
|
||||
- platform: template
|
||||
name: "HVAC Delta"
|
||||
id: hvac_delta
|
||||
lambda: |-
|
||||
return (id(hvac).state - id(hvac_return).state);
|
||||
update_interval: 10s
|
||||
unit_of_measurement: "°F"
|
||||
state_class: measurement
|
||||
filters:
|
||||
- or:
|
||||
- throttle: 60s
|
||||
- delta: 1.0
|
||||
|
||||
- platform: ultrasonic
|
||||
trigger_pin: ${trigger_pin}
|
||||
echo_pin: ${echo_pin}
|
||||
id: ultrasonic_source
|
||||
#update_interval: 5s
|
||||
internal: True
|
||||
filters:
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
send_first_at: 1
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: distance_from_bottom
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- sensor.template.publish:
|
||||
id: distance_from_top
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_bottom
|
||||
name: "Salt Level in CM"
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (0.94 - (id(ultrasonic_source).state)) * 100;'
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: level_in_bags
|
||||
state: !lambda 'return id(distance_from_bottom).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_top
|
||||
name: "Salt Level From Top in CM"
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (id(ultrasonic_source).state) * 100;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "bags"
|
||||
state_class: measurement
|
||||
id: level_in_bags
|
||||
name: "Salt Level in Bags"
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (id(distance_from_bottom).state) / 17.5;'
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: "Furnace Room Door"
|
||||
device_class: door
|
||||
pin:
|
||||
number: ${door_pin}
|
||||
#mode: INPUT_PULLUP
|
||||
|
||||
- platform: homeassistant
|
||||
internal: true
|
||||
id: light_state
|
||||
entity_id: light.furnace_room
|
||||
on_state:
|
||||
then:
|
||||
- if:
|
||||
condition:
|
||||
lambda: 'return id(light_state).state;'
|
||||
then:
|
||||
- logger.log: "The light is on"
|
||||
else:
|
||||
- logger.log: "The is off. Turning off display"
|
||||
- switch.turn_off: display_switch
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
id: display_switch
|
||||
name: "HVAC Display Switch"
|
||||
lambda: |-
|
||||
if (id(screen_power)) {
|
||||
id(oled).turn_on();
|
||||
} else {
|
||||
id(oled).turn_off();
|
||||
}
|
||||
return id(screen_power);
|
||||
turn_on_action:
|
||||
- lambda: |-
|
||||
id(screen_power) = true;
|
||||
// id(oled).turn_on();
|
||||
turn_off_action:
|
||||
- lambda: |-
|
||||
id(screen_power) = false;
|
||||
// id(oled).turn_off();
|
||||
@@ -0,0 +1,282 @@
|
||||
# CT01 - A - Grid Phase A
|
||||
# CT02 - G - Dryer
|
||||
# CT03 - D - Furnace
|
||||
# CT04 - B - Grid Phase B
|
||||
# CT05 - E - Basement Plugs (Computer is on this circuit)
|
||||
# CT06 - F - Nursery, Kitchen, and Dining Room Lights
|
||||
# CT07 - C - Sump Pump Plug
|
||||
# CT08 - H - Microwave Plug
|
||||
# CT09 - I - Stove/Oven
|
||||
# CT10 - J - Front Room Plugs
|
||||
# CT11 - M - Heat Pump
|
||||
# CT12 - L - Kitchen Circuit 1 (Fridge is on this circuit)
|
||||
|
||||
substitutions:
|
||||
devicename: power-monitor
|
||||
disp_name: power-monitor
|
||||
friendly_name: 'PM:'
|
||||
entity_name: power_monitor
|
||||
comment: Clever Power Monitor
|
||||
static_ip: !secret power-monitor-ip
|
||||
platform: ESP32
|
||||
board: nodemcu-32s
|
||||
update_time: 500ms
|
||||
kwh_report_interval: 60s
|
||||
watt_heartbeat: 60s
|
||||
throttle_time: 60s
|
||||
watt_delta: "50.0"
|
||||
#watt_delta: "5.0"
|
||||
#grid_watt_delta: "10.0"
|
||||
grid_watt_delta: "200.0"
|
||||
#fast_update_time: 10s
|
||||
#medium_update_time: 30s
|
||||
#slow_update_time: 60s
|
||||
|
||||
main_meter_name1: Meter 1-3
|
||||
main_meter_name2: Meter 4-6
|
||||
main_meter_id1: meter_main1
|
||||
main_meter_id2: meter_main2
|
||||
## Addon1
|
||||
addon1_name1: Addon1 7-9
|
||||
addon1_name2: Addon1 10-12
|
||||
addon1_id1: addon1_1
|
||||
addon1_id2: addon1_2
|
||||
## Addon2
|
||||
addon2_name1: Addon2 13-15
|
||||
addon2_name2: Addon2 16-18
|
||||
addon2_id1: addon2_1
|
||||
addon2_id2: addon2_2
|
||||
## Addon3
|
||||
addon3_name1: Addon3 19-21
|
||||
addon3_name2: Addon3 22-24
|
||||
addon3_id1: addon3_1
|
||||
addon3_id2: addon3_2
|
||||
|
||||
ct1_name: 'Grid Phase A'
|
||||
ct4_name: 'Grid Phase B'
|
||||
|
||||
ct22_name: 'Well' # 1, 3 # sct010 - O
|
||||
ct12_name: 'Kitchen 1' # 5 # sct006 - L
|
||||
ct16_name: 'Kitchen 2' # 7 # sct006 - S
|
||||
ct18_name: 'Laundry Plug' # 9 # sct006 - N
|
||||
ct8_name: 'Microwave Plug' # 11 # sct006 - H
|
||||
ct17_name: 'Bathroom Plug' # 13 # sct006 - R
|
||||
ct11_name: 'Heat Pump' # 15, 17 - M
|
||||
ct24_name: 'Basement Bedroom and Furnace Room Lights' # 19 # sct006 - K
|
||||
ct5_name: 'Basement Plugs' # 21a # sct006 - E
|
||||
ct23_name: 'Basement and Laundry Lights and Plugs' # 21b # sct006 - W
|
||||
ct7_name: 'Sump Pump Plug' # 23 # sct006 - C
|
||||
|
||||
ct6_name: 'Nursery, Dining, Kitchen Lights' # 2 # sct006 - F
|
||||
ct20_name: 'Master Suite' # 4 # sct006 - T
|
||||
ct3_name: 'Furnace' # 6 # sct006 - D
|
||||
ct15_name: 'Basement Stairs and Lights' # 8 # sct006 - P
|
||||
ct21_name: 'Dishwasher' # 10 # sct006 - V
|
||||
ct13_name: 'Garage Outside and Front Garage Lights' # 12 # sct006 - U
|
||||
ct10_name: 'Front Room Plugs' # 14 # sct006 - J
|
||||
ct14_name: 'Garage and Outside Plugs' # 16 # sct006 - Q
|
||||
ct9_name: 'Stove' # 18, 20 # sct016 - I
|
||||
ct2_name: 'Dryer' # 22, 24 # sct010 - G
|
||||
|
||||
ct19_name: 'Unused'
|
||||
|
||||
|
||||
# Current Transformers:
|
||||
# 20A/25mA SCT-006: 11143
|
||||
sct006: '11143'
|
||||
# 30A/1V SCT-013-030: 8650
|
||||
# 50A/1V SCT-013-050: 15420
|
||||
# 80A/26.6mA SCT-010: 41660
|
||||
sct010: '41660'
|
||||
# 100A/50ma SCT-013-000: 27518
|
||||
sct013: '27518'
|
||||
# 120A/40mA: SCT-016: 41787
|
||||
sct016: '41787'
|
||||
# 200A/100mA SCT-024: 27518
|
||||
#current_cal: '27518'
|
||||
# Jameco 9VAC Transformer:
|
||||
# For meter versions:
|
||||
# >= v1.3: 7305
|
||||
#voltage_cal: '7305'
|
||||
|
||||
## Main Board
|
||||
current_cal_ct1: '41787'
|
||||
current_cal_ct2: '41660'
|
||||
current_cal_ct3: '11143'
|
||||
current_cal_ct4: '41787'
|
||||
current_cal_ct5: '11143'
|
||||
current_cal_ct6: '11143'
|
||||
## Addon1
|
||||
current_cal_ct7: '11143'
|
||||
current_cal_ct8: '11143'
|
||||
current_cal_ct9: '27518'
|
||||
current_cal_ct10: '11143'
|
||||
current_cal_ct11: '41660'
|
||||
current_cal_ct12: '11143'
|
||||
## Addon2
|
||||
current_cal_ct13: '11143'
|
||||
current_cal_ct14: '11143'
|
||||
current_cal_ct15: '11143'
|
||||
current_cal_ct16: '11143'
|
||||
current_cal_ct17: '11143'
|
||||
current_cal_ct18: '11143'
|
||||
## Addon3
|
||||
current_cal_ct19: '11143'
|
||||
current_cal_ct20: '11143'
|
||||
current_cal_ct21: '11143'
|
||||
current_cal_ct22: '41660'
|
||||
current_cal_ct23: '11143'
|
||||
current_cal_ct24: '11143'
|
||||
# This only needs to be changed if you're using something other than the
|
||||
# Jameco 9VAC Transformer:
|
||||
voltage_cal1: '7305'
|
||||
voltage_cal2: '7305'
|
||||
|
||||
electric_freq: "60Hz"
|
||||
|
||||
offset_calibration: "true"
|
||||
gain_calibration: "true"
|
||||
|
||||
|
||||
# spi_clk: 18
|
||||
# spi_miso: 19
|
||||
# spi_mosi: 23
|
||||
# ic1_main: 5
|
||||
# ic1_addon1: 0
|
||||
# ic1_addon2: 27
|
||||
# ic1_addon3: 2
|
||||
# ic2_main: 4
|
||||
# ic2_addon1: 16
|
||||
# ic2_addon2: 17
|
||||
# ic2_addon3: 21
|
||||
|
||||
# ethernet:
|
||||
# id: eth
|
||||
# type: W5500
|
||||
# clk_pin: GPIO13
|
||||
# mosi_pin: GPIO11
|
||||
# miso_pin: GPIO12
|
||||
# cs_pin: GPIO14
|
||||
# interrupt_pin: GPIO10
|
||||
# reset_pin: GPIO9
|
||||
esphome:
|
||||
name: ${disp_name}
|
||||
friendly_name: "${friendly_name}"
|
||||
name_add_mac_suffix: true
|
||||
min_version: '2025.7.0'
|
||||
project:
|
||||
name: circuitsetup.6c-energy-meter-3-addons
|
||||
version: "1.7"
|
||||
|
||||
packages:
|
||||
wifi: !include common/wifi.yaml
|
||||
# device_base: !include common/complex_esp32_base.yaml
|
||||
common: !include circuit-setup/6chan_common.yaml
|
||||
main: !include circuit-setup/meter_sensors/6chan_main_sensor.yaml
|
||||
main_status: !include circuit-setup/status_fields/6chan_main_status.yaml
|
||||
main_cal: !include circuit-setup/calibration/6chan_main_calibration.yaml
|
||||
addon_1: !include circuit-setup/meter_sensors/6chan_addon1.yaml
|
||||
addon_2: !include circuit-setup/meter_sensors/6chan_addon2.yaml
|
||||
addon_3: !include circuit-setup/meter_sensors/6chan_addon3.yaml
|
||||
|
||||
|
||||
# Enable Home Assistant API
|
||||
# An encryption key is recommended and can be generated here:
|
||||
# https://esphome.io/components/api.html#configuration-variables
|
||||
api:
|
||||
# encryption:
|
||||
# key: "YOUR_ENCRYPTION_KEY_HERE"
|
||||
|
||||
# Enable OTA updating
|
||||
ota:
|
||||
- platform: esphome
|
||||
|
||||
|
||||
# In combination with the `ap` this allows
|
||||
# provisioning wifi credentials to the device.
|
||||
captive_portal:
|
||||
|
||||
# Sets up Bluetooth LE to provision wifi credentials
|
||||
# to the device.
|
||||
esp32_improv:
|
||||
authorizer: none
|
||||
|
||||
# Sets up the improv via serial client for wifi provisioning
|
||||
improv_serial:
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
sensor:
|
||||
## The max value for current that the meter can output is 65.535. If you expect to measure current over 65A,
|
||||
## divide the current_cal_ctx (above) by 2 (120A CT) or 4 (200A CT) and multiply the current and power values
|
||||
## by 2 or 4, uncommenting the below and changing the id and phase_x accordingly
|
||||
#- id: !extend ${main_meter_id1} # CTs 1-3
|
||||
# phase_a: # CT1
|
||||
# current:
|
||||
# filters:
|
||||
# - multiply: 2
|
||||
# power:
|
||||
# filters:
|
||||
# - multiply: 2
|
||||
#
|
||||
## uncomment if monitoring 2 voltages
|
||||
#- id: !extend ${main_meter_id2}
|
||||
# phase_a:
|
||||
# voltage:
|
||||
# name: Voltage 2
|
||||
# id: ic2Volts
|
||||
# accuracy_decimals: 1
|
||||
# frequency:
|
||||
# name: Frequency 2
|
||||
|
||||
## Comment out to show amps and watts per meter board in Home Assistant
|
||||
- id: !extend totalAmpsMain
|
||||
internal: true
|
||||
- id: !extend totalWattsMain
|
||||
internal: true
|
||||
- id: !extend totalAmpsAddOn1
|
||||
internal: true
|
||||
- id: !extend totalWattsAddOn1
|
||||
internal: true
|
||||
- id: !extend totalAmpsAddOn2
|
||||
internal: true
|
||||
- id: !extend totalWattsAddOn2
|
||||
internal: true
|
||||
- id: !extend totalAmpsAddOn3
|
||||
internal: true
|
||||
- id: !extend totalWattsAddOn3
|
||||
internal: true
|
||||
|
||||
#Total Amps
|
||||
###########
|
||||
- platform: template
|
||||
name: ${friendly_name} Total Amps
|
||||
id: totalAmps
|
||||
lambda: return id(totalAmpsMain).state + id(totalAmpsAddOn1).state + id(totalAmpsAddOn2).state + id(totalAmpsAddOn3).state ;
|
||||
accuracy_decimals: 2
|
||||
unit_of_measurement: A
|
||||
device_class: current
|
||||
update_interval: ${update_time}
|
||||
|
||||
#Total Watts
|
||||
############
|
||||
- platform: template
|
||||
name: ${friendly_name} Total Watts
|
||||
id: totalWatts
|
||||
lambda: return id(totalWattsMain).state + id(totalWattsAddOn1).state + id(totalWattsAddOn2).state + id(totalWattsAddOn3).state ;
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: W
|
||||
device_class: power
|
||||
update_interval: ${update_time}
|
||||
|
||||
#kWh
|
||||
####
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} Total kWh
|
||||
power_id: totalWatts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
@@ -0,0 +1,847 @@
|
||||
# CT01 - A - Grid Phase A
|
||||
# CT02 - G - Dryer
|
||||
# CT03 - D - Furnace
|
||||
# CT04 - B - Grid Phase B
|
||||
# CT05 - E - Basement Plugs (Computer is on this circuit)
|
||||
# CT06 - F - Nursery, Kitchen, and Dining Room Lights
|
||||
# CT07 - C - Sump Pump Plug
|
||||
# CT08 - H - Microwave Plug
|
||||
# CT09 - I - Stove/Oven
|
||||
# CT10 - J - Front Room Plugs
|
||||
# CT11 - M - Heat Pump
|
||||
# CT12 - L - Kitchen Circuit 1 (Fridge is on this circuit)
|
||||
|
||||
substitutions:
|
||||
devicename: power-monitor
|
||||
friendly_name: 'PM:'
|
||||
entity_name: power_monitor
|
||||
comment: Clever Power Monitor
|
||||
static_ip: !secret power-monitor-ip
|
||||
platform: ESP32
|
||||
board: nodemcu-32s
|
||||
update_time: 500ms
|
||||
kwh_report_interval: 60s
|
||||
watt_heartbeat: 60s
|
||||
throttle_time: 60s
|
||||
watt_delta: "50.0"
|
||||
#watt_delta: "5.0"
|
||||
#grid_watt_delta: "10.0"
|
||||
grid_watt_delta: "200.0"
|
||||
#fast_update_time: 10s
|
||||
#medium_update_time: 30s
|
||||
#slow_update_time: 60s
|
||||
|
||||
ct01Name: 'Grid Phase A'
|
||||
ct04Name: 'Grid Phase B'
|
||||
|
||||
ct22Name: 'Well' # 1, 3 # sct010 - O
|
||||
ct12Name: 'Kitchen 1' # 5 # sct006 - L
|
||||
ct16Name: 'Kitchen 2' # 7 # sct006 - S
|
||||
ct18Name: 'Laundry Plug' # 9 # sct006 - N
|
||||
ct08Name: 'Microwave Plug' # 11 # sct006 - H
|
||||
ct17Name: 'Bathroom Plug' # 13 # sct006 - R
|
||||
ct11Name: 'Heat Pump' # 15, 17 - M
|
||||
ct24Name: 'Basement Bedroom and Furnace Room Lights' # 19 # sct006 - K
|
||||
ct05Name: 'Basement Plugs' # 21a # sct006 - E
|
||||
ct23Name: 'Basement and Laundry Lights and Plugs' # 21b # sct006 - W
|
||||
ct07Name: 'Sump Pump Plug' # 23 # sct006 - C
|
||||
|
||||
ct06Name: 'Nursery, Dining, Kitchen Lights' # 2 # sct006 - F
|
||||
ct20Name: 'Master Suite' # 4 # sct006 - T
|
||||
ct03Name: 'Furnace' # 6 # sct006 - D
|
||||
ct15Name: 'Basement Stairs and Lights' # 8 # sct006 - P
|
||||
ct21Name: 'Dishwasher' # 10 # sct006 - V
|
||||
ct13Name: 'Garage Outside and Front Garage Lights' # 12 # sct006 - U
|
||||
ct10Name: 'Front Room Plugs' # 14 # sct006 - J
|
||||
ct14Name: 'Garage and Outside Plugs' # 16 # sct006 - Q
|
||||
ct09Name: 'Stove' # 18, 20 # sct016 - I
|
||||
ct02Name: 'Dryer' # 22, 24 # sct010 - G
|
||||
|
||||
ct19Name: 'Unused'
|
||||
|
||||
|
||||
# Current Transformers:
|
||||
# 20A/25mA SCT-006: 11143
|
||||
sct006: '11143'
|
||||
# 30A/1V SCT-013-030: 8650
|
||||
# 50A/1V SCT-013-050: 15420
|
||||
# 80A/26.6mA SCT-010: 41660
|
||||
sct010: '41660'
|
||||
# 100A/50ma SCT-013-000: 27518
|
||||
sct013: '27518'
|
||||
# 120A/40mA: SCT-016: 41787
|
||||
sct016: '41787'
|
||||
# 200A/100mA SCT-024: 27518
|
||||
#current_cal: '27518'
|
||||
# Jameco 9VAC Transformer:
|
||||
# For meter versions:
|
||||
# >= v1.3: 7305
|
||||
voltage_cal: '7305'
|
||||
|
||||
|
||||
spi_clk: 18
|
||||
spi_miso: 19
|
||||
spi_mosi: 23
|
||||
ic1_main: 5
|
||||
ic1_addon1: 0
|
||||
ic1_addon2: 27
|
||||
ic1_addon3: 2
|
||||
ic2_main: 4
|
||||
ic2_addon1: 16
|
||||
ic2_addon2: 17
|
||||
ic2_addon3: 21
|
||||
|
||||
# ethernet:
|
||||
# id: eth
|
||||
# type: W5500
|
||||
# clk_pin: GPIO13
|
||||
# mosi_pin: GPIO11
|
||||
# miso_pin: GPIO12
|
||||
# cs_pin: GPIO14
|
||||
# interrupt_pin: GPIO10
|
||||
# reset_pin: GPIO9
|
||||
|
||||
|
||||
packages:
|
||||
wifi: !include common/wifi.yaml
|
||||
# device_base: !include common/complex_esp32_base.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
mqtt: !include common/mqtt_null.yaml
|
||||
|
||||
esp32:
|
||||
board: nodemcu-32s
|
||||
|
||||
# web_server:
|
||||
# port: 80
|
||||
|
||||
time:
|
||||
- platform: sntp
|
||||
id: sntp_time
|
||||
timezone: America/Detroit
|
||||
|
||||
logger:
|
||||
# level: DEBUG
|
||||
# logs:
|
||||
# sensor: DEBUG
|
||||
|
||||
spi:
|
||||
clk_pin: ${spi_clk}
|
||||
miso_pin: ${spi_miso}
|
||||
mosi_pin: ${spi_mosi}
|
||||
|
||||
sensor:
|
||||
#IC1 Main
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic1_main}
|
||||
phase_a:
|
||||
voltage:
|
||||
name: ${friendly_name} [V]
|
||||
id: ic1Volts
|
||||
filters:
|
||||
- throttle_average: 60s
|
||||
accuracy_decimals: 1
|
||||
current:
|
||||
name: ${friendly_name} ${ct01Name} [A]
|
||||
id: ct1Amps
|
||||
filters:
|
||||
- or:
|
||||
- delta: 2
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
power:
|
||||
name: ${friendly_name} ${ct01Name} [W]
|
||||
id: ct1Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${grid_watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct016}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct02Name} [W]
|
||||
id: ct2Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct010}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct03Name} [W]
|
||||
id: ct3Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
frequency:
|
||||
name: ${friendly_name} Freq A
|
||||
filters:
|
||||
- or:
|
||||
- delta: 0.05
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
#IC2 Main
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_main}
|
||||
phase_a:
|
||||
current:
|
||||
name: ${friendly_name} ${ct04Name} [A]
|
||||
id: ct4Amps
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${grid_watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
power:
|
||||
name: ${friendly_name} ${ct04Name} [W]
|
||||
id: ct4Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct016}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct05Name} [W]
|
||||
id: ct5Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct06Name} [W]
|
||||
id: ct6Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
frequency:
|
||||
name: ${friendly_name} Freq B
|
||||
filters:
|
||||
- or:
|
||||
- delta: 0.05
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
|
||||
#IC1 AddOn 1
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic1_addon1}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${friendly_name} ${ct07Name} [W]
|
||||
id: ct7Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct08Name} [W]
|
||||
id: ct8Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct09Name} [W]
|
||||
id: ct9Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct013}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC2 AddOn 1
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_addon1}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${friendly_name} ${ct10Name} [W]
|
||||
id: ct10Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct11Name} [W]
|
||||
id: ct11Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct010}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct12Name} [W]
|
||||
id: ct12Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
#IC1 AddOn 2
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic1_addon2}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${friendly_name} ${ct13Name} [W]
|
||||
id: ct13Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct14Name} [W]
|
||||
id: ct14Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct15Name} [W]
|
||||
id: ct15Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC2 AddOn 2
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_addon2}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${friendly_name} ${ct16Name} [W]
|
||||
id: ct16Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct17Name} [W]
|
||||
id: ct17Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct18Name} [W]
|
||||
id: ct18Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC1 AddOn 3
|
||||
- platform: atm90e32
|
||||
#do not use GPIO2 if ESP32 has an on-board LED assigned to it
|
||||
cs_pin: ${ic1_addon3}
|
||||
phase_a:
|
||||
power:
|
||||
name: ${friendly_name} ${ct19Name} [W]
|
||||
id: ct19Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct20Name} [W]
|
||||
id: ct20Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct21Name} [W]
|
||||
id: ct21Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
qos: 1
|
||||
retain: true
|
||||
availability:
|
||||
topic: ${mqtt_root_topic}/${devicename}/${ct21Name}_w/status
|
||||
payload_available: online
|
||||
payload_not_available: offline
|
||||
state_topic: ${mqtt_root_topic}/${devicename}/${ct21Name}_w
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
#IC2 AddOn 3
|
||||
- platform: atm90e32
|
||||
cs_pin: ${ic2_addon3}
|
||||
phase_a:
|
||||
power:
|
||||
#name: ${friendly_name} ${ct22Name} [W]
|
||||
internal: true
|
||||
id: ct22Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct010}
|
||||
phase_b:
|
||||
power:
|
||||
name: ${friendly_name} ${ct23Name} [W]
|
||||
id: ct23Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
phase_c:
|
||||
power:
|
||||
name: ${friendly_name} ${ct24Name} [W]
|
||||
id: ct24Watts
|
||||
filters:
|
||||
- or:
|
||||
- delta: ${watt_delta}
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
- multiply: -1
|
||||
accuracy_decimals: 1
|
||||
gain_voltage: ${voltage_cal}
|
||||
gain_ct: ${sct006}
|
||||
line_frequency: 60Hz
|
||||
gain_pga: 1X
|
||||
update_interval: ${update_time}
|
||||
|
||||
#Total Amps From Grid
|
||||
- platform: template
|
||||
name: ${friendly_name} Grid Total [A]
|
||||
id: totalAmpsFromGrid
|
||||
lambda: return id(ct1Amps).state + id(ct4Amps).state ;
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: A
|
||||
device_class: current
|
||||
state_class: measurement
|
||||
update_interval: ${update_time}
|
||||
filters:
|
||||
- or:
|
||||
- delta: 2.0
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
|
||||
#Total Watts From Grid
|
||||
- platform: template
|
||||
name: ${friendly_name} Grid Total [W]
|
||||
id: totalWattsFromGrid
|
||||
lambda: return id(ct1Watts).state + id(ct4Watts).state ;
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: W
|
||||
device_class: power
|
||||
state_class: measurement
|
||||
update_interval: ${update_time}
|
||||
filters:
|
||||
- or:
|
||||
- delta: 5.0
|
||||
- throttle_average: ${throttle_time}
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
|
||||
#kWh From Grid
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} Grid [kWh]
|
||||
power_id: totalWattsFromGrid
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
# - heartbeat: ${kwh_report_interval}
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
# The CT for the Well needs to be calibrated.
|
||||
# In the interim, I'm using this lambda
|
||||
- platform: template
|
||||
name: ${friendly_name} ${ct22Name} [W]
|
||||
id: ct22WattsPositive
|
||||
state_class: measurement
|
||||
lambda: |-
|
||||
if (id(ct22Watts).state < 0){
|
||||
return 0;
|
||||
} else {
|
||||
return id(ct22Watts).state ;
|
||||
}
|
||||
accuracy_decimals: 1
|
||||
unit_of_measurement: W
|
||||
icon: mdi:lightning-bolt-circle
|
||||
update_interval: ${update_time}
|
||||
filters:
|
||||
- delta: 5.0
|
||||
# - heartbeat: ${watt_heartbeat}
|
||||
|
||||
# kWh from CT1
|
||||
# This is included in the grid calculation
|
||||
|
||||
# kWh from CT2 (the dryer)
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct02Name} [kWh]
|
||||
power_id: ct2Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 3
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct03Name} [kWh]
|
||||
power_id: ct3Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
# kWh From CT 4
|
||||
# This is included in the Grid calculation area
|
||||
|
||||
#kWh From CT 5
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct05Name} [kWh]
|
||||
power_id: ct5Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 6
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct06Name} [kWh]
|
||||
power_id: ct6Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 7
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct07Name} [kWh]
|
||||
power_id: ct7Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 8
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct08Name} [kWh]
|
||||
power_id: ct8Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 9
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct09Name} [kWh]
|
||||
power_id: ct9Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 10
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct10Name} [kWh]
|
||||
power_id: ct10Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 11 (Heat Pump)
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct11Name} [kWh]
|
||||
power_id: ct11Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 12
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct12Name} [kWh]
|
||||
power_id: ct12Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 13
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct13Name} [kWh]
|
||||
power_id: ct13Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 14
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct14Name} [kWh]
|
||||
power_id: ct14Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 15
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct15Name} [kWh]
|
||||
power_id: ct15Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 16
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct16Name} [kWh]
|
||||
power_id: ct16Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 17
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct17Name} [kWh]
|
||||
power_id: ct17Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 18
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct18Name} [kWh]
|
||||
power_id: ct18Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 19
|
||||
# this is not used
|
||||
# - platform: total_daily_energy
|
||||
# name: ${friendly_name} ${ct19Name} [kWh]
|
||||
# power_id: ct19Watts
|
||||
# filters:
|
||||
# - multiply: 0.001
|
||||
# - throttle_average: ${kwh_report_interval}
|
||||
# unit_of_measurement: kWh
|
||||
# device_class: energy
|
||||
# state_class: total_increasing
|
||||
# # min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 20
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct20Name} [kWh]
|
||||
power_id: ct20Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 21
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct21Name} [kWh]
|
||||
power_id: ct21Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
qos: 1
|
||||
retain: true
|
||||
availability:
|
||||
topic: ${mqtt_root_topic}/${devicename}/${ct21Name}_kwh/status
|
||||
payload_available: online
|
||||
payload_not_available: offline
|
||||
state_topic: ${mqtt_root_topic}/${devicename}/${ct21Name}_kwh
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 22
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct22Name} [kWh]
|
||||
power_id: ct22WattsPositive
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 23
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct23Name} [kWh]
|
||||
power_id: ct23Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
|
||||
#kWh From CT 24
|
||||
- platform: total_daily_energy
|
||||
name: ${friendly_name} ${ct24Name} [kWh]
|
||||
power_id: ct24Watts
|
||||
filters:
|
||||
- multiply: 0.001
|
||||
unit_of_measurement: kWh
|
||||
device_class: energy
|
||||
state_class: total_increasing
|
||||
# min_save_interval: ${update_time}
|
||||
@@ -0,0 +1,198 @@
|
||||
substitutions:
|
||||
devicename: furnace-room-multisensor
|
||||
entity_name: furnace_room_multisensor
|
||||
friendly_name: Furnace Room MultiSensor
|
||||
comment: Clever MultiSensor
|
||||
board: nodemcuv2
|
||||
static_ip: !secret furnace-room-multisensor-ip
|
||||
|
||||
|
||||
# For the reed switches
|
||||
door: 35
|
||||
moisture: 36
|
||||
|
||||
# For the ultrasonic sensor
|
||||
trigger: 14
|
||||
echo: 15
|
||||
|
||||
# Infrared Sensor
|
||||
ir_tx: 12
|
||||
ir_rx: 39
|
||||
|
||||
# I2C Pins
|
||||
i2c_sda: 13
|
||||
i2c_scl: 16
|
||||
|
||||
# For the ethernet adapter
|
||||
ethernet_mdc_pin: 23
|
||||
ethernet_mdio_pin: 18
|
||||
ethernet_clk_pin: 0
|
||||
|
||||
# For the relays
|
||||
relay1: 32
|
||||
relay2: 33
|
||||
|
||||
# Built-in button
|
||||
button1: 34
|
||||
|
||||
# For the HVAC temperature sensors
|
||||
one_wire: 17
|
||||
|
||||
one_wire:
|
||||
- platform: gpio
|
||||
pin: ${one_wire}
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
friendly_name: ${friendly_name}
|
||||
name_add_mac_suffix: false
|
||||
|
||||
packages:
|
||||
network: !include common/olimex_evb.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
|
||||
|
||||
# Included in common/olimex-evb.yaml
|
||||
# esp32:
|
||||
# board: esp32dev
|
||||
# framework:
|
||||
# type: esp-idf
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
version: 3
|
||||
include_internal: True
|
||||
|
||||
# # Enable Home Assistant API
|
||||
# api:
|
||||
# encryption:
|
||||
# key: "mupTLNBggWPdKHxBeY1yV47qXgyhVJUgIVVAvfGrZ40="
|
||||
|
||||
# ota:
|
||||
# - platform: esphome
|
||||
# password: "b43bd5c6f724d64a9bd4e92504830d8f"
|
||||
|
||||
remote_receiver:
|
||||
pin: ${ir_rx}
|
||||
dump: all
|
||||
|
||||
remote_transmitter:
|
||||
pin: ${ir_tx}
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
i2c:
|
||||
sda: ${i2c_sda}
|
||||
scl: ${i2c_scl}
|
||||
scan: true
|
||||
id: bus_a
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: "ESP32-EVB button"
|
||||
pin: ${button1}
|
||||
|
||||
- platform: gpio
|
||||
name: "Door"
|
||||
device_class: door
|
||||
filters:
|
||||
- invert:
|
||||
pin:
|
||||
number: ${door}
|
||||
# mode: INPUT_PULLUP
|
||||
|
||||
- platform: gpio
|
||||
name: "Moisture"
|
||||
device_class: moisture
|
||||
pin:
|
||||
number: ${moisture}
|
||||
# mode: INPUT_PULLUP
|
||||
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
pin: ${relay1}
|
||||
name: "Relay1"
|
||||
|
||||
- platform: gpio
|
||||
pin: ${relay2}
|
||||
name: "Relay2"
|
||||
|
||||
sensor:
|
||||
- platform: ultrasonic
|
||||
trigger_pin: ${trigger}
|
||||
echo_pin: ${echo}
|
||||
id: ultrasonic_source
|
||||
update_interval: 1s
|
||||
internal: True
|
||||
filters:
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
send_first_at: 1
|
||||
- lambda: 'return round( x * 10.0) / 10.0;'
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: distance_from_bottom
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- sensor.template.publish:
|
||||
id: distance_from_top
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_bottom
|
||||
name: "Salt Level in CM"
|
||||
icon: mdi:arrow-collapse-up
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (0.94 - x) * 100;'
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: level_in_bags
|
||||
state: !lambda 'return id(distance_from_bottom).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_top
|
||||
name: "Salt Level From Top in CM"
|
||||
icon: mdi:arrow-collapse-down
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return x * 100;'
|
||||
- round: 1
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 150.0
|
||||
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "bags"
|
||||
state_class: measurement
|
||||
id: level_in_bags
|
||||
name: "Salt Level in Bags"
|
||||
icon: mdi:counter
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return x / 17.5;'
|
||||
- round: 1
|
||||
- clamp:
|
||||
min_value: 0.0
|
||||
max_value: 10.0
|
||||
@@ -0,0 +1,111 @@
|
||||
# 3v3 en svp sun 34 35 32 33 25 26 27 14 12 gnd 13 sd2 sd3 gnd 5v
|
||||
substitutions:
|
||||
devicename: water-softener-multisensor
|
||||
entity_name: water_softener_multisensor
|
||||
friendly_name: Water Softener MultiSensor
|
||||
comment: Clever Water Softener MultiSensor
|
||||
platform: ESP32
|
||||
board: wemos_d1_mini32
|
||||
static_ip: !secret water-softener-multisensor-ip
|
||||
|
||||
door_pin: GPIO18
|
||||
|
||||
# For the ultrasonic sensor
|
||||
trigger_pin: GPIO16
|
||||
echo_pin: GPIO17
|
||||
|
||||
packages:
|
||||
# network: !include common/ethernet.yaml
|
||||
network: !include common/wifi.yaml
|
||||
device_base: !include common/device_base.yaml
|
||||
ble_proxy: !include common/ble_proxy.yaml
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
friendly_name: ${friendly_name}
|
||||
name_add_mac_suffix: false
|
||||
|
||||
esp32:
|
||||
board: ${board}
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
api: # Using settings from common/device_base.yaml
|
||||
|
||||
ota: # Using settings from common/device_base.yaml
|
||||
|
||||
esp32_ble_tracker:
|
||||
|
||||
sensor:
|
||||
- platform: ultrasonic
|
||||
trigger_pin: ${trigger_pin}
|
||||
echo_pin: ${echo_pin}
|
||||
id: ultrasonic_source
|
||||
update_interval: 1s
|
||||
internal: True
|
||||
filters:
|
||||
- sliding_window_moving_average:
|
||||
window_size: 5
|
||||
send_every: 5
|
||||
send_first_at: 1
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: distance_from_bottom
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- sensor.template.publish:
|
||||
id: distance_from_top
|
||||
state: !lambda 'return id(ultrasonic_source).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_bottom
|
||||
name: "Salt Level in CM"
|
||||
icon: mdi:arrow-collapse-up
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (0.94 - (id(ultrasonic_source).state)) * 100;'
|
||||
on_value:
|
||||
then:
|
||||
- sensor.template.publish:
|
||||
id: level_in_bags
|
||||
state: !lambda 'return id(distance_from_bottom).state;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "cm"
|
||||
state_class: measurement
|
||||
id: distance_from_top
|
||||
name: "Salt Level From Top in CM"
|
||||
icon: mdi:arrow-collapse-down
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (id(ultrasonic_source).state) * 100;'
|
||||
|
||||
- platform: template
|
||||
unit_of_measurement: "bags"
|
||||
state_class: measurement
|
||||
id: level_in_bags
|
||||
name: "Salt Level in Bags"
|
||||
icon: mdi:counter
|
||||
disabled_by_default: true
|
||||
#update_interval: 5s
|
||||
filters:
|
||||
- lambda: 'return (id(distance_from_bottom).state) / 17.5;'
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
name: "Door"
|
||||
device_class: door
|
||||
pin:
|
||||
number: ${door_pin}
|
||||
mode: INPUT_PULLUP
|
||||
# filters:
|
||||
# - invert:
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
substitutions:
|
||||
devicename: white-bed
|
||||
entity_name: white_bed
|
||||
friendly_name: White Bed
|
||||
platform: ESP32
|
||||
board: nodemcu-32s
|
||||
static_ip: !secret white-bed-ip
|
||||
center_sensor_gpio: GPIO34
|
||||
|
||||
|
||||
esp32:
|
||||
board: nodemcu-32s
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
esphome:
|
||||
name: ${devicename}
|
||||
# platform: ${platform}
|
||||
# board: ${board}
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
# Sync time with Home Assistant.
|
||||
time:
|
||||
- platform: homeassistant
|
||||
id: homeassistant_time
|
||||
|
||||
# Enable Home Assistant API
|
||||
api:
|
||||
reboot_timeout: 15min
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
|
||||
|
||||
packages:
|
||||
#wifi: !include common/wifi.yaml
|
||||
wifi: !include common/wifi_no_power_save.yaml
|
||||
ble: !include bed-presence/bluetooth-proxy.yaml
|
||||
|
||||
diagnostics: !include
|
||||
file: bed-presence/diagnostics.yaml
|
||||
vars:
|
||||
boot_gpio: GPIO9
|
||||
uptime_id: bed_presence_uptime
|
||||
restart_id: btn_restart
|
||||
status_id: bed_presence_status
|
||||
|
||||
bed_sensor: !include
|
||||
file: bed-presence/sensor.yaml
|
||||
vars:
|
||||
sensor_name: Center
|
||||
sensor_id: center_occupied
|
||||
sensor_gpio: ${center_sensor_gpio}
|
||||
|
||||
switch:
|
||||
- platform: template
|
||||
name: Full Range
|
||||
id: full_range
|
||||
optimistic: true
|
||||
restore_mode: RESTORE_DEFAULT_OFF
|
||||
entity_category: config
|
||||
icon: mdi:arrow-expand
|
||||
|
||||
select:
|
||||
- platform: template
|
||||
name: "Response Speed"
|
||||
id: response_speed
|
||||
icon: mdi:speedometer
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
options:
|
||||
- "Fast"
|
||||
- "Normal"
|
||||
- "Slow"
|
||||
initial_option: "Normal"
|
||||
entity_category: config
|
||||
Reference in New Issue
Block a user