Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created an esphome-config for this board, which is more flexible in some situations #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WiFiFanCon

Control 12V PC Fans via Wi-Fi and [Tasmota](https://github.com/arendst/Tasmota)
Control 12V PC Fans via Wi-Fi, [Tasmota](https://github.com/arendst/Tasmota) and [esphome](https://esphome.io/)

[<img src="./img/board.jpg" width=650>](./img/board.jpg)
[<img src="./img/tasmota_home.png">](./img/board.jpg)
Expand All @@ -19,7 +19,13 @@ Control 12V PC Fans via Wi-Fi and [Tasmota](https://github.com/arendst/Tasmota)

Head over to the [./pcb](./pcb) for the pcb.

For the firmware, install [Tasmota](https://github.com/arendst/Tasmota) e.g. using their fancy fully browser-based installer, then check out the [./berry](./berry) folder.
### Installation

#### Tasmota
Install [Tasmota](https://github.com/arendst/Tasmota) e.g. using their fancy fully browser-based installer, then check out the [./berry](./berry) folder.

#### esphome
install the [yaml](./esphome/wififancontrol.yaml) via one of esphome's installation methods

## Why?

Expand Down
7 changes: 7 additions & 0 deletions esphome/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Features

* just plain fan control (%), independent of any temperatures, no PID, no HVAC-Setup
* sensors for the RPM-Value of each Fan
* some debug-values exposed as sensors, e.G. networking-stuff or a reboot button

See [screenshots](./img/) for details.
264 changes: 264 additions & 0 deletions esphome/wififancontrol.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
# base-config to build on to ensure the same basics on all controller

esphome:
name: wififancontrol
friendly_name: "WiFi Fan Controller"

esp32:
board: esp32dev

# Enable logging
logger:
level: DEBUG
logs:
component: ERROR

api:
encryption:
key: !secret api_key_wz-retro-fancontroller

# temporary disabling forced reboots when no api-client is connected. disable for productive use
# reboot_timeout: 0s

ota:
- platform: esphome
password: !secret ota_password

# temporary enable webserver while building and testing. disable for productive use
#web_server:
# port: 80
# version: 2

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

switch:
# Expose an ESP32 restart button to HA
- platform: restart
name: Controller Restart
id: controller_restart
icon: mdi:restart

text_sensor:

# some basic wifi and networking telemetry
- platform: wifi_info
ip_address:
name: IP Address
icon: mdi:wifi
entity_category: "diagnostic"
disabled_by_default: false
ssid:
name: SSID
icon: mdi:wifi
entity_category: "diagnostic"
disabled_by_default: false
bssid:
name: BSSID
icon: mdi:wifi
entity_category: "diagnostic"
disabled_by_default: true
mac_address:
name: MAC-Address
icon: mdi:wifi
entity_category: "diagnostic"
disabled_by_default: false
dns_address:
name: DNS-Address
icon: mdi:wifi
entity_category: "diagnostic"
disabled_by_default: false

# uptime sensor in raw seconds

sensor:

- platform: wifi_signal
name: WiFi Signal Strength
update_interval: 10s
id: wifi_signal_db
entity_category: "diagnostic"

- platform: uptime
name: Uptime
id: uptime_sensor
update_interval: 10s
icon: mdi:clock-start
disabled_by_default: true

# Fan Controller Setup

- platform: pulse_counter
pin:
number: GPIO16
mode: INPUT_PULLUP
unit_of_measurement: 'RPM'
id: fan1_speed_tach
name: Fan 1 RPM
icon: mdi:gauge
update_interval: 5s
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE

- platform: pulse_counter
pin:
number: GPIO18
mode: INPUT_PULLUP
unit_of_measurement: 'RPM'
id: fan2_speed_tach
name: Fan 2 RPM
icon: mdi:gauge
update_interval: 5s
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE

- platform: pulse_counter
pin:
number: GPIO21
mode: INPUT_PULLUP
unit_of_measurement: 'RPM'
id: fan3_speed_tach
name: Fan 3 RPM
icon: mdi:gauge
update_interval: 5s
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE

- platform: pulse_counter
pin:
number: GPIO23
mode: INPUT_PULLUP
unit_of_measurement: 'RPM'
id: fan4_speed_tach
name: Fan 4 RPM
icon: mdi:gauge
update_interval: 5s
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE


# "ledc" is the name of the pwm output system on an esp32, on esp8266 it is "esp8266_pwm".
# 25KHz is standard PC fan frequency, minimises buzzing
# 25% is a reasonable pwm-output, that should kick on most fans and should set as min_power.
# At 0, actually turn the Fan off. May not work with every fan. Check your fan's
# specsheet if the fan indeed turns off at 0% PWM. Most serverfans usually stay
# alway on at 35% or so as long there is supply-voltage present. Fans that can turn off
# are e.G. from Noctua, Iceberg Thermal. However, some fans that have a 0-RPM mode
# documented refuse to stop entirely (e.G. fans from Arctic). In such cases
# you have to find a way to also cut power to the fan when set to 0%.

output:
- platform: ledc
id: fan1_pwm
pin: GPIO17
frequency: "25000 Hz"
min_power: 25%
max_power: 100%
zero_means_zero: true

- platform: ledc
id: fan2_pwm
pin: GPIO19
frequency: "25000 Hz"
min_power: 25%
max_power: 100%
zero_means_zero: true

- platform: ledc
id: fan3_pwm
pin: GPIO22
frequency: "25000 Hz"
min_power: 25%
max_power: 100%
zero_means_zero: true

- platform: ledc
id: fan4_pwm
pin: GPIO25
frequency: "25000 Hz"
min_power: 25%
max_power: 100%
zero_means_zero: true

number:

- platform: template
name: "Fan 1 PWM"
id: fan1_set_speed
internal: false
max_value: 100.0
min_value: 0.0
step: 1
optimistic: true
mode: slider
restore_value: true
on_value:
then:
- output.set_level:
id: fan1_pwm
level: !lambda "return x/100;"

- platform: template
name: "Fan 2 PWM"
id: fan2_set_speed
internal: false
max_value: 100.0
min_value: 0.0
step: 1
optimistic: true
mode: slider
restore_value: true
on_value:
then:
- output.set_level:
id: fan2_pwm
level: !lambda "return x/100;"

- platform: template
name: "Fan 3 PWM"
id: fan3_set_speed
internal: false
max_value: 100.0
min_value: 0.0
step: 1
optimistic: true
mode: slider
restore_value: true
on_value:
then:
- output.set_level:
id: fan3_pwm
level: !lambda "return x/100;"

- platform: template
name: "Fan 4 PWM"
id: fan4_set_speed
internal: false
max_value: 100.0
min_value: 0.0
step: 1
optimistic: true
mode: slider
restore_value: true
on_value:
then:
- output.set_level:
id: fan4_pwm
level: !lambda "return x/100;"
Binary file added img/esphome_homeassistant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/esphome_webui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.