Custom roof fan controlling unit

Hi

I have a roof fan (Vilpe) which I control using a custom built controller which in turn is connected to Raspberry pi zero. On it I have a Python script to set the speed and turn it on and off.

Now I of course want to integrate it into HA and be able to control if from there. How do I do it?

I cannot seem to add it as a device since only supported integrations are showing up. I saw there is a fan Service which supports on/off and speed control. But it still requires a device which I cannot add.

What is the standard pattern of integrating and controlling own made stuff?

You need to build your python script to accept commands from another computer over a network. Eg build a rest or mqtt interface in.

There is an mqtt fan integration so that may be easiest.

Although about option is to control it over ssh and use a command line integration.

Probably mqtt would be the easiest to implement. I could read mqtt messages with python script and adjust fan accordingly. When I have done that what should component should I choose inthe HA to send just my mqtt integration?

This one I would think https://www.home-assistant.io/integrations/fan.mqtt/

Thanks for the link. That is a good start. I will give it a deep dive.

1 Like

The other hint that may help you write mqtt code for python is that the standard library is paho-mqtt. Good luck.

What is your custom built controller like? I have been looking for wirelessly (Zigbee, Z-Wave) controllable device that could drive the sama Vilpe EC roof fan that takas 0-10V DC input. But havent found one. Vilpe is saying 0-10V light dimmers must not be used.

It is interesting that you asked since I still haven’t had time to integrate it with my Hass. But soon I hope.

I am using this little circuit that I built. Here is the link to my git repo with the simple python code that I use with the circuit. On the github page there is a link to the pi forum discussion on how I built the circuit as well as schematics.

Let me know if you have questions.

Hi

2 years later and I have finally my kitchen fan installed. Time to make it controllable. Before I get going I need to clarify some stuff in my head. Please help me out.

Setup is the same as described in my first post. I will try to use fan.mqtt integration. In that integration one needs to specify mqtt topics. If I understand it correctly I need to do the following:

  • Setup MTQQ integration in my HASS which will act as a subscriber.
  • Point MQTT integration to the MQTT broker which will be running on my Pi where the fan is connected
  • Setup MQTT broker (mosquitto) on my Pi and adjust my python code to be able to both read and write to the topics. Adjust fan speed when the incoming command from HASS comes into command_* topics

Are my assumptions correct?

I assume that fan.mqtt integration publishes stuff to mqtt broker like for fan set speed commands, therefore my broker should allow it?