mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
updating common esphome sensors
finally fixing hvac-multisensor. All of this was caused by the display switch referenced the display while it wasn't plugged in. Updated code to check for the existence first.
This commit is contained in:
@@ -27,7 +27,7 @@ sensor:
|
||||
id: occupied
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} Raw Value"
|
||||
name: "Raw Value"
|
||||
lambda: |-
|
||||
return id(hx711_value_raw).raw_state;
|
||||
unit_of_measurement: w
|
||||
@@ -35,7 +35,7 @@ sensor:
|
||||
state_class: measurement
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} Auto Tare"
|
||||
name: "Auto Tare"
|
||||
lambda: |-
|
||||
return id(auto_tare_difference);
|
||||
unit_of_measurement: w
|
||||
@@ -43,7 +43,7 @@ sensor:
|
||||
state_class: measurement
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} Initial Zero"
|
||||
name: "Initial Zero"
|
||||
lambda: |-
|
||||
return id(initial_zero);
|
||||
unit_of_measurement: w
|
||||
@@ -95,7 +95,7 @@ sensor:
|
||||
# Mapped value to lbs
|
||||
- platform: template
|
||||
id: hx711_value
|
||||
name: "${friendly_name} Weight"
|
||||
name: "Weight"
|
||||
internal: False
|
||||
filters:
|
||||
# apply auto_tare difference
|
||||
@@ -125,7 +125,7 @@ sensor:
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
device_class: occupancy
|
||||
name: "${friendly_name} Occupied"
|
||||
name: "Occupied"
|
||||
icon: mdi:bed
|
||||
lambda: |-
|
||||
if (
|
||||
@@ -137,7 +137,7 @@ binary_sensor:
|
||||
}
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} HX711 Error"
|
||||
name: "HX711 Error"
|
||||
id: hx711_error
|
||||
device_class: problem
|
||||
lambda: |-
|
||||
@@ -152,7 +152,7 @@ binary_sensor:
|
||||
switch:
|
||||
- platform: template
|
||||
id: force_occupancy
|
||||
name: "${friendly_name} Force Occupancy"
|
||||
name: "Force Occupancy"
|
||||
lambda: |-
|
||||
return id(occupancy_forced);
|
||||
turn_on_action:
|
||||
@@ -166,7 +166,7 @@ switch:
|
||||
id: auto_tare
|
||||
# optimistic: true
|
||||
# assumed_state: true
|
||||
name: "${friendly_name} Auto Tare"
|
||||
name: "Auto Tare"
|
||||
lambda: |-
|
||||
return id(auto_tare_enabled);
|
||||
turn_on_action:
|
||||
@@ -179,14 +179,14 @@ switch:
|
||||
button:
|
||||
- platform: template
|
||||
id: manual_tare
|
||||
name: "${friendly_name} Manual Tare"
|
||||
name: "Manual Tare"
|
||||
on_press:
|
||||
- lambda: |-
|
||||
id(auto_tare_difference) = id(initial_zero) - id(hx711_value_raw).state;
|
||||
|
||||
- platform: template
|
||||
id: reset_tare
|
||||
name: "${friendly_name} Reset Tare"
|
||||
name: "Reset Tare"
|
||||
on_press:
|
||||
- lambda: |-
|
||||
id(auto_tare_difference) = 0;
|
||||
Reference in New Issue
Block a user