I recently purchased the OpenFAN Micro from OpenFAN Micro – Karanovic Research
Working through the documentation, I setup a RESTful Command integration and I wanted to share my initial setup. Testing soon to come.
My mission: Control dual Noctua NF-S12A PWM 4-Pin fans for my server rack via variable speed controls based on internal temperatures.
OpenFAN Micro API Documentation: Web API - Karanovic Research
rest_command:
set_fan_pwm:
url: "http://192.168.0.150/api/v0/fan/0/set?value={{ pwm_value }}"
method: get
sensor:
- platform: rest
name: "OpenFAN Micro RPM"
resource: "http://192.168.0.150/api/v0/fan/status"
value_template: "{{ value_json.rpm }}"
unit_of_measurement: "RPM"
- platform: rest
name: "OpenFAN Micro PWM"
resource: "http://192.168.0.150/api/v0/fan/status"
value_template: "{{ value_json.pwm_percent }}"
unit_of_measurement: "%"
fan:
- platform: template
fans:
openfan_micro:
friendly_name: "OpenFAN Micro"
value_template: "{{ states('sensor.openfan_micro_rpm')|int(0) > 0 }}"
percentage_template: "{{ states('sensor.openfan_micro_pwm')|int(0) }}"
turn_on:
sequence:
- action: rest_command.set_fan_pwm
data:
pwm_value: "50" # Default to 50% when turning on
turn_off:
- action: rest_command.set_fan_pwm
data:
pwm_value: "0"
set_percentage:
- action: rest_command.set_fan_pwm
data_template:
pwm_value: "{{ percentage | int }}"