83 lines
2.9 KiB
YAML
83 lines
2.9 KiB
YAML
#:########################################################################################:#
|
|
# Package: Refrigerator Temperature MQTT Publishing
|
|
# File: fridge_temperatures.yaml
|
|
# Version: v1.2.0
|
|
# Date: 2026-08-30
|
|
#
|
|
# Purpose:
|
|
# Publishes refrigerator and freezer temperature changes to household MQTT
|
|
# status topics for use by external displays and consumers.
|
|
#
|
|
# Behaviour:
|
|
# - Creates a calibrated main kitchen fridge temperature entity.
|
|
# - Publishes each valid temperature entity state whenever it changes.
|
|
# - Suppresses unknown and unavailable source states.
|
|
# - Covers the drinks fridge, drinks freezer, and main kitchen fridge.
|
|
#
|
|
# Dependencies:
|
|
# - The three configured Home Assistant temperature sensors.
|
|
# - Home Assistant MQTT integration and broker connectivity.
|
|
#
|
|
# Version History:
|
|
# - v1.2.0 (2026-08-30): Moved the calibrated main fridge source to X65TS.
|
|
# - v1.1.0 (2026-08-17): Added the -0.84 C main fridge sensor calibration.
|
|
# - v1.0.0 (2024-09-04): Initial refrigerator temperature publishing package.
|
|
#:########################################################################################:#
|
|
|
|
template:
|
|
- sensor:
|
|
- name: "Main Kitchen Fridge Temperature Calibrated"
|
|
unique_id: main_kitchen_fridge_temperature_calibrated
|
|
device_class: temperature
|
|
state_class: measurement
|
|
unit_of_measurement: "°C"
|
|
availability: "{{ has_value('sensor.main_kitchen_fridge_temperature_x65ts_temperature') }}"
|
|
state: >-
|
|
{{ (states('sensor.main_kitchen_fridge_temperature_x65ts_temperature') | float - 0.84) | round(2) }}
|
|
|
|
automation:
|
|
- id: publish_fridge_temps_drinks_fridge
|
|
alias: publish_fridge_temps_drinks_fridge
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.drinks_fridge_environment_lcd_btt01_temperature
|
|
not_to:
|
|
- "unavailable"
|
|
- "unknown"
|
|
action:
|
|
- service: mqtt.publish
|
|
data:
|
|
topic: "viewroad-status/fridges/drinks-fridge"
|
|
payload: "{{ trigger.to_state.state }}"
|
|
mode: single
|
|
|
|
- id: publish_freezer_temps_drinks_fridge
|
|
alias: pub_freezer_temps_drinks_fridge
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.drinks_freezer_environment_lcd_btt02_temperature
|
|
not_to:
|
|
- "unavailable"
|
|
- "unknown"
|
|
action:
|
|
- service: mqtt.publish
|
|
data:
|
|
topic: "viewroad-status/fridges/drinks-freezer"
|
|
payload: "{{ trigger.to_state.state }}"
|
|
mode: single
|
|
|
|
- id: publish_main_kitchen_fridge_temp_zth08
|
|
alias: publish_main_kitchen_fridge_temp_zth08
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.main_kitchen_fridge_temperature_calibrated
|
|
not_to:
|
|
- "unavailable"
|
|
- "unknown"
|
|
action:
|
|
- service: mqtt.publish
|
|
data:
|
|
topic: "viewroad-status/fridges/mainkitchen_fridge"
|
|
payload: "{{ trigger.to_state.state }}"
|
|
mode: single
|