How do i make a switch turn off when the temperature sensor is "unavailable"

i’m getting my first generic.thermostat set up to control my furnace

this is what’s in my configuration.yaml

climate:

  • platform: generic_thermostat
    name: Furnace
    heater: switch.furnace_heat_switch
    target_sensor: sensor.living_room_temperature
    min_temp: 50
    max_temp: 80
    ac_mode: false
    target_temp: 60
    cold_tolerance: 3
    hot_tolerance: 0
    min_cycle_duration:
    seconds: 5
    keep_alive:
    minutes: 3
    initial_hvac_mode: “off”
    away_temp: 60
    precision: 0.1

when the sensor loses power while the switch is turned on, the switch will stay on. how do i make the switch be off if the sensor goes unavailable?

Make an automation that uses a State Trigger to monitor the state of sensor.living_room_temperature. When the value becomes unavailable it turns off climate.furnace (which also serves to turn off the heater switch). Probably a good idea to also have it notify you that this incident occurred.

If you wish, the same automation can also be used to detect when the sensor’s state changes from unavailable to a valid value and then turn climate.furnace back on.

Let me know if you need help creating the automation.

got it working. my first actual automation. thank you!