mikothegreen
Member
ok here's the code just modify it to suit
when its connected to the fan
set the pid controller in home assistant a few degrees lower than your temp
run the auto tune and watch the output logs in esphome
might take some time it depends on your setup but at the the end it should say some shit like success and give you
kp: what ever you got
ki: what ever you got
kd: what ever you got
then just edit the config in esphome to these numbers
hope this works for ya i"m no coder, all the rotary stuffs in ha automatons and check wiring on the mosfet board, if you look at the pictures they are different in each pic (was wrecked n took a while to figure out why fan was at full speed)
when its connected to the fan
set the pid controller in home assistant a few degrees lower than your temp
run the auto tune and watch the output logs in esphome
might take some time it depends on your setup but at the the end it should say some shit like success and give you
kp: what ever you got
ki: what ever you got
kd: what ever you got
then just edit the config in esphome to these numbers
YAML:
output:
- platform: esp8266_pwm
pin: D1
frequency: 1000
id: pwm_output
inverted: true
min_power: 0.0
max_power: 1.0
sensor:
- platform: homeassistant
name: "scd4 Tent Temperature" #
id: scd4_c02 #
entity_id: sensor.scd4_tent_temperature # change to what ever you have
- platform: rotary_encoder
name: "Rotary Encoder"
pin_a: D2
pin_b: D3
min_value: 0
max_value: 53
resolution: 4
- platform: pid
name: "Climate Result"
type: RESULT
binary_sensor:
- platform: gpio
pin: D4
name: "rotary button"
climate:
- platform: pid
visual:
min_temperature: 15
max_temperature: 30
temperature_step: 0.1
id: pid_climate
name: "Fan Controller"
sensor: scd4_c02
default_target_temperature: 25°C
cool_output: pwm_output
control_parameters:
kp: 0.72757
ki: 0.01819 #change theses after auto tune with your output logs
kd: 7.27541
switch:
- platform: template
name: "PID Climate Autotune"
turn_on_action:
- climate.pid.autotune: pid_climate
Last edited: