Misiu / argon40

Home Assistant support for Argon ONE Pi 3 & 4 cases and Argon Fan HAT
MIT License
118 stars 21 forks source link

template on fanspeed ? #27

Closed Mariusthvdb closed 3 years ago

Mariusthvdb commented 3 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I have to write these verbose automations, where a small template could be very helpful Describe the solution you'd like A clear and concise description of what you want to happen. like to template the fan speed, based on the state of the temp sensor

automation:
  - alias: "Set fan speed"
    trigger:
      platform: numeric_state
      entity_id: sensor.cpu_temp
#      above: 50.0
#      for:
#        minutes: 1
    action:
      - service: argon40.set_fan_speed
        data:
          speed: >
             {% set temp = states('sensor.cpu_temp')|float %}
             {% if temp <= 30 %} 0
             {% elif temp <= 40 %} 5
             {% elif temp <= 45 %} 10
             {% elif temp <= 50 %} 20
             {% elif temp <= 55 %} 30
             {% elif temp <= 60 %} 40
             {% elif temp <= 65 %} 50
             {% elif temp <= 70 %} 60
             {% elif temp <= 75 %} 70
             {% elif temp <= 80 %} 90
             {% else %} 100
             {% endif %}

could be written more mathematically, but just to set the idea

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

none really, this service is unique, so maybe only the other add-on which sets speeds automatically (and doesnt allow for manual precision)

Additional context Add any other context or screenshots about the feature request here.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.