Can anyone help me with challenge Ive gotten this far with Discord just need a little bit more help.
Im using a slow_pwm signal to adjust a dosing pump and would like to adjust the speed of the pump within Home Assistant.
So far i have added this to ESPhome node
esphome:
name: sprinkler_controller
platform: ESP32
board: esp32-poe-iso
on_boot:
priority: -10
then:
- output.turn_on: dose_feedrate
- output.set_level:
id: dose_feedrate
level: "50%"
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
power_pin: GPIO12
manual_ip:
static_ip: 192.168.1.52
gateway: 192.168.1.1
subnet: 255.255.255.0
#captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
power_supply:
- id: 'power_supply1'
pin:
number: 13
inverted: true
enable_time: 20ms
keep_on_time: 60min
switch:
- platform: output
name: "Kerb Sprinklers"
output: 'valve_1'
- platform: output
name: "House Side Sprinklers"
output: 'valve_2'
- platform: gpio
pin:
number: 5
inverted: true
name: "Spare"
- platform: output
name: "Dose feedrate"
output: "dose_feedrate"
output:
- platform: slow_pwm
pin:
number: 15
id: dose_feedrate
period: 4s
- platform: gpio
pin:
number: 2
inverted: true
id: valve_1
power_supply: power_supply1
- platform: gpio
pin:
number: 4
inverted: true
id: valve_2
power_supply: power_supply1
This was the example code i was given Thank you @MauriceM#9564
api:
services:
- service: set_duty_cycle
variables:
new_duty_cycle: float
then:
- output.set_level:
id: my_thingy
level: !lambda return new_duty_cycle;
- service: set_period
variables:
new_period: int
then:
- lambda: id(my_thingy).set_period(new_period);
Added this to Config.yaml file in HA
api:
services:
- service: set_duty_cycle
variables:
new_duty_cycle: float
then:
- output.set_level:
id: dose_feedrate
level: -lambda return 0.25
- service: set_period
variables:
new_period: int
then:
- lambda: id(dose_feedrate).set_period(500);
Restarted HA server
In the services drop down i cant find either of these service calls so ive tried to enter it manual
and just keep getting this error I think I’m way in over my head here.
Any help would be great and i thank you in advance.