Skip to content

Commit

Permalink
Test temp (#71)
Browse files Browse the repository at this point in the history
* additional temperature config added

* changes

* Update temperature_dallas_2.yaml

* Update temperature_dallas_2.yaml

* Update temperature_dallas_2.yaml

* Update temperature_dallas_2.yaml
  • Loading branch information
TheRealFalseReality authored Jul 20, 2024
1 parent 21901f4 commit da15506
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 129 deletions.
130 changes: 1 addition & 129 deletions common/temperature_dallas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ substitutions:
# Calibration Temp. 1
cal_0: "0.0"
cal_100: "100.0"
# # Calibration Temp. 2
# cal_0_2: "0.0"
# cal_100_2: "100.0"

range_cool: "74"
range_warm: "82"

Expand Down Expand Up @@ -38,25 +34,6 @@ sensor:
then:
- component.update: temp_range

# # Temperature Probe 2
# - platform: dallas_temp
# id: temp_2
# icon: mdi:thermometer-lines
# address:
# name: "Temperature 2"
# state_class: "measurement"
# device_class: "temperature"
# filters:
# - calibrate_linear:
# method: least_squares
# datapoints:
# - 0.0 -> ${cal_0_2}
# - 100.0 -> ${cal_100_2}
# disabled_by_default: true
# on_value:
# then:
# - component.update: temp_range_2

# Convert to Fahrenheit - Temp. 1
- platform: template
state_class: "measurement"
Expand All @@ -65,14 +42,6 @@ sensor:
lambda: |-
return id(temp_1).state * 9 / 5 + 32;
# # Convert to Fahrenheit - Temp. 2
# - platform: template
# state_class: "measurement"
# device_class: "temperature"
# id: temp_f_2
# lambda: |-
# return id(temp_2).state * 9 / 5 + 32;

# Calibration Temp. at 0C
- platform: template
name: Calibration at 0°C - Temp. 1
Expand All @@ -99,32 +68,6 @@ sensor:
lambda: |-
return {${cal_100}};
# # Calibration Temp. 2 at 0C
# - platform: template
# name: Calibration at 0°C - Temp. 2
# id: cal_0_2_sen
# icon: mdi:snowflake-alert
# unit_of_measurement: "°C"
# disabled_by_default: true
# state_class: "measurement"
# device_class: "temperature"
# entity_category: "diagnostic"
# lambda: |-
# return {${cal_0_2}};

# # Calibration Temp. 2 at 100C
# - platform: template
# name: Calibration at 100°C - Temp. 2
# id: cal_100_2_sen
# icon: mdi:water-thermometer
# unit_of_measurement: "°C"
# disabled_by_default: true
# state_class: "measurement"
# device_class: "temperature"
# entity_category: "diagnostic"
# lambda: |-
# return {${cal_100_2}};

binary_sensor:
- platform: template
name: Ideal Temperature
Expand All @@ -137,18 +80,6 @@ binary_sensor:
return false;
}
# - platform: template
# name: Ideal Temperature 2
# id: ideal_temp_2
# icon: mdi:thermometer-check
# disabled_by_default: true
# lambda: |-
# if (id(temp_range_2).state == "OK") {
# return true;
# } else {
# return false;
# }

text_sensor:
# Temperature Range 1
- platform: template
Expand All @@ -170,27 +101,6 @@ text_sensor:
return {"Unknown"};
}
# # Temperature Range 2
# - platform: template
# name: Temperature 2 Range
# id: temp_range_2
# icon: mdi:thermometer-water
# update_interval: "${update_temp}"
# disabled_by_default: true
# lambda: |-
# if(id(temp_f_2).state <= id(range_cool_2).state) {
# return {"Cool"};
# }
# if(id(temp_f_2).state < id(range_warm_2).state && id(temp_f_2).state > id(range_cool_2).state) {
# return {"OK"};
# }
# if(id(temp_f_2).state >= id(range_warm_2).state) {
# return {"Warm"};
# }
# else {
# return {"Unknown"};
# }

number:
# Temperature 1 when Cool
- platform: template
Expand Down Expand Up @@ -226,42 +136,4 @@ number:
device_class: "temperature"
on_value:
then:
- component.update: temp_range

# # Temperature 2 when Cool
# - platform: template
# name: "Temp. 2 Cool"
# id: range_cool_2
# icon: mdi:snowflake-thermometer
# optimistic: true
# disabled_by_default: true
# mode: box
# min_value: 0.0
# max_value: 100.0
# step: 0.5
# restore_value: True
# initial_value: ${range_cool}
# entity_category: "Config"
# device_class: "temperature"
# on_value:
# then:
# - component.update: temp_range_2

# # Temperature 2 when Warm
# - platform: template
# name: "Temp. 2 Warm"
# icon: mdi:sun-thermometer
# id: range_warm_2
# optimistic: true
# disabled_by_default: true
# mode: box
# min_value: 0.0
# max_value: 100.0
# step: 0.5
# restore_value: True
# initial_value: ${range_warm}
# entity_category: "Config"
# device_class: "temperature"
# on_value:
# then:
# - component.update: temp_range_2
- component.update: temp_range
129 changes: 129 additions & 0 deletions common/temperature_dallas_2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
substitutions:
temp_address_2: ''

# Calibration variables
# 0C using Ice Water; 100C using Boiling Water
# # Calibration Temp. 2
cal_0_temp_2: "0.0"
cal_100_temp_2: "100.0"

sensor:
# Temperature Probe 2
- platform: dallas_temp
id: temp_2
icon: mdi:thermometer-lines
address: ${temp_address_2}
name: "Temperature 2"
state_class: "measurement"
device_class: "temperature"
filters:
- calibrate_linear:
method: least_squares
datapoints:
- 0.0 -> ${cal_0_2}
- 100.0 -> ${cal_100_2}
on_value:
then:
- component.update: temp_range_2

# Convert to Fahrenheit - Temp. 2
- platform: template
state_class: "measurement"
device_class: "temperature"
id: temp_f_2
lambda: |-
return id(temp_2).state * 9 / 5 + 32;
# Calibration Temp. 2 at 0C
- platform: template
name: Calibration at 0°C - Temp. 2
id: cal_0_2_sen
icon: mdi:snowflake-alert
unit_of_measurement: "°C"
state_class: "measurement"
device_class: "temperature"
entity_category: "diagnostic"
lambda: |-
return {${cal_0_2}};
# Calibration Temp. 2 at 100C
- platform: template
name: Calibration at 100°C - Temp. 2
id: cal_100_2_sen
icon: mdi:water-thermometer
unit_of_measurement: "°C"
state_class: "measurement"
device_class: "temperature"
entity_category: "diagnostic"
lambda: |-
return {${cal_100_2}};
binary_sensor:
- platform: template
name: Ideal Temperature 2
id: ideal_temp_2
icon: mdi:thermometer-check
lambda: |-
if (id(temp_range_2).state == "OK") {
return true;
} else {
return false;
}
text_sensor:
# Temperature Range 2
- platform: template
name: Temperature 2 Range
id: temp_range_2
icon: mdi:thermometer-water
update_interval: "${update_temp}"
lambda: |-
if(id(temp_f_2).state <= id(range_cool_2).state) {
return {"Cool"};
}
if(id(temp_f_2).state < id(range_warm_2).state && id(temp_f_2).state > id(range_cool_2).state) {
return {"OK"};
}
if(id(temp_f_2).state >= id(range_warm_2).state) {
return {"Warm"};
}
else {
return {"Unknown"};
}
number:
# Temperature 2 when Cool
- platform: template
name: "Temp. 2 Cool"
id: range_cool_2
icon: mdi:snowflake-thermometer
optimistic: true
mode: box
min_value: 0.0
max_value: 100.0
step: 0.5
restore_value: True
initial_value: ${range_cool}
entity_category: "Config"
device_class: "temperature"
on_value:
then:
- component.update: temp_range_2

# Temperature 2 when Warm
- platform: template
name: "Temp. 2 Warm"
icon: mdi:sun-thermometer
id: range_warm_2
optimistic: true
mode: box
min_value: 0.0
max_value: 100.0
step: 0.5
restore_value: True
initial_value: ${range_warm}
entity_category: "Config"
device_class: "temperature"
on_value:
then:
- component.update: temp_range_2

0 comments on commit da15506

Please sign in to comment.