I had created a smarthome prototype using a raspberry pi 3. I control 4 items (2 LEDS, 1 dynamo, 1 motor servo) with it and one of things that I want to control is motor servo.
But I have no idea how to control it on openhab.
Can anyone give me the solutions please?
p.s. : I only use a raspberry pi 3
Openhab itself isn’t going to be able to generate the 20ms duty cycle needed for a servo.
You can use a python script to run the servo, here is a tutorial for the raspberrypi gpio
You can then add in the python mqtt paho library to connect to openhab via an mqtt broker , tutorial below
Of coarse this assumes your familiar enough with python and that you have mqtt working or can get it running.
Just how I would do it as it would be quickest for me but there are many ways of achieving this.
When I saw this topic what came to mind are the Z-Wave blind or roller shutter controls.
and then what should I do on openhab? I have no idea at all for this issue
Using whatever communication channel you have chosen, MQTT perhaps, openHAB needs only to send a number corresponding to the position you want the servo to take up.
There are various DMX to Servo driver boards out there.
So you could use the DMX binding in openHAB2, with an Art-NET (LAN DMX) adapter and a DMX to Servo driver.
16 channel Servo driver
8 channel DMX Servo driver
I know there is an even easier solution in development with one of my suppliers, but it’s not publicly available yet.
There are mqtt tutorials on the forums here for openhab that can show you how to get going with openhab. Take a look at those and come back with any questions along the way