Sorry, no. But in your initial post you said it worked through te dashboard as a switch. I would keep that and adjust my automation to start the switch; seems way easier.
alias: CPU Fan aan na boot
description: ""
trigger:
- platform: homeassistant
event: start
condition: []
action:
mode: single
- service: switch.turn_on
data: {}
target:
entity_id: rpi_fan_switch_port_17
2023-07-26 14:34:25.382 ERROR (MainThread) [homeassistant.components.light] Error while setting up rpi_gpio_pwm platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 353, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ha-rpi_gpio_pwm/light.py", line 70, in setup_platform
opt_args["pin_factory"] = PiGPIOFactory(host=led_conf[CONF_HOST], port= led_conf[CONF_PORT])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gpiozero/pins/pigpio.py", line 101, in __init__
raise IOError('failed to connect to %s:%s' % (host, port))
OSError: failed to connect to localhost:8888
So I decided to use rpi_gpio and gpio17 to link climate module.
of the rpi_gpio_pwm add-on, simply by installing the Poeschl pigpio add-on (as written in the rpi_gpio_pwm readme) and then restarting HA.
Installing pigpio is done by adding https://github.com/Poeschl/Hassio-Addons into your HA add-ons custom repositories.
I hope it can be useful to someone.