# OpenFAN Service

![Dashboard](https://docs.sasakaranovic.com/openfan/screenshot-dashboard.png)

![Dashboard](https://docs.sasakaranovic.com/openfan/screenshot-fan-curves.png)

OpenFAN service is a simple docker/python application that can run stand-alone or in parallel to the existing OpenFAN Controller docker container and allows you to automate your OpenFAN fan curves.

This application is designed to work with Unraid, TrueNAS or bare-metal setup that has [OpenFAN hardware](https://shop.sasakaranovic.com/products/openfan-pc-fan-controller) installed.\
You can also use it stand-alone or in combination with the OpenFAN Controller container running.

Source code is available on [GitHub](https://github.com/SasaKaranovic/OpenFAN-Service) if you wish to take a look or contribute.

## What does it do?

This is a very simple python/docker application that allows you to define fan curves and then have the fan controller drive your fans based on the temperature sensors you provide.

## Why?

I wanted to have a simple, set-and-forget setup that allows me to configure how each fan on my Unraid server runs based on the temperature sensors.

The idea was to make a simple application that does exactly that; allow simple configuration/automation of fan speeds based on current temperature reading.

## How does it work?

The application has four key components:

1. Controllers
1. Fan Curves
1. Fans
1. Sensors

The number of fans is driven by the controllers that you have connected.\
Sensors are provided by your system (ie Unraid disk temperatures).\
You define fan curves that essentially tell the controller at temperature X, the fan should be at Y speed.\
Each fan curve also has one or more temperature sensors that are used as the temperature value.\
Then finally you assign fans to each fan curve and let the system do its work.

## Installation

### Automatic installation

TBD: Waiting for community application review and approval.

### Manually starting docker container using docker compose

Simply copy and edit the [docker-compose.yml](https://github.com/SasaKaranovic/OpenFAN-Service/blob/master/docker-compose.yml) file to your machine and then run `docker compose up -d`.\
The docker should automatically download the latest image and spin up a container for you.\
After it's complete, you can access the web UI using your browser and visiting the http://localhost:5340

### Manually starting docker container using docker cli

If you don't want to use docker compose, you can build the OpenFAN Service docker container by using the below command directly on your command line

```bash
docker run -d --name openfan-service \
--device=/dev/ttyACM0 \
-v /var/local/emhttp:/unraid:ro \
-v ./config:/config \
--restart unless-stopped \
ghcr.io/sasakaranovic/openfan-service:latest
```
