Automation with temp sensors - Synology

Hello, I’m new to HA and trying out some automation. I have a synology in a closet and recently installed some fans connected to a TP Link plug. I want to turn on the fans when the avg temperate of the synology goes above a certain point and then turn them off when it goes below. So below is what I’ve come up with so far. I believe it’s working… I had to stress my NAS to increase temps and then turn on the device fans to max to decrease temps to get this to work properly.

I have a few questions. Is this a correct way to do it? Does the script look correct? Is there a better way to do it? I noticed that in my dashboard the temps listed doen’t update often enough. Is there a way to get those to update more frequently… or better yet get my script to run more frequently based on real time temp of the synology drives?

alias: Synology Fans
description: ''
trigger:
  - platform: state
    entity_id: sensor.synology_average_disk_temp
condition: []
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.synology_average_disk_temp
            below: '95'
        sequence:
          - type: turn_off
            device_id: 40a760a1a440502a0cbf941cb95d1b1c
            entity_id: switch.fans
            domain: switch
          - service: notify.mobile_app_turtle_power
            data:
              message: 'Synology Fans Turned Off '
              title: Synology
      - conditions:
          - condition: numeric_state
            entity_id: sensor.synology_average_disk_temp
            above: '95'
        sequence:
          - type: turn_on
            device_id: 40a760a1a440502a0cbf941cb95d1b1c
            entity_id: switch.fans
            domain: switch
          - service: notify.mobile_app_turtle_power
            data:
              message: Synology Turned Fans On
              title: Synology
    default: []
mode: single

You could create a generic thermostat rather than using an automation.

Hey thanks! I got this to work as well. I think the problem I’m having is that the Synology temp sensor doesn’t update frequently. I get big time gaps between when it updates in my dashboard to what it actually is viewing from DSM > Info > Storage and looking at all the temps.

Is this just a limitation of synology or is there a way to have the automation pull up-to-date temp readings?

Would I be better off buying a HA compatible temp sensor to get a reading of the enclosure instead of the hard drives?

Can you share the configuration for your temperature sensor?

This works but it’s pulling the same data that is listed on the main dashboard. The main dashboard doesn’t update in real time. I think it might becaue the type of polling that synology does? Not 100% sure.

alias: Test
description: ''
trigger:
  - platform: time_pattern
    minutes: /1
condition: []
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.synology_average_disk_temp
            above: '95'
        sequence:
          - type: turn_on
            device_id: 40a760a1a440502a0cbf941cb95d1b1c
            entity_id: switch.fans
            domain: switch
      - conditions:
          - condition: numeric_state
            entity_id: sensor.synology_average_disk_temp
            below: '95'
        sequence:
          - type: turn_off
            device_id: 40a760a1a440502a0cbf941cb95d1b1c
            entity_id: switch.fans
            domain: switch
    default: []
mode: single

That’s your automation, not your temperature sensor configuration. Where does this come from:

sensor.synology_average_disk_temp

Okay, guess I had a brain fart… I Was watching a youtube video while reading your comment and think I got them mixed up. I guess I have no idea how to add a generic thermostat. I don’t see it anywhere in the automation set up?

sensor.synology_average_disk_temp

is pulled from Synology DSM that I added as a device.

So this integration?

Does not look like you have any control over update interval.

Yep that’s it!

Alright so I guess what I have is the best I can do for now. Any recommendations maybe for Air temperature devices that are compatiable with HA that have the ability to control update interval?