openhab controlling rc switch on raspberry pi
-
Hi guys,
I would like to control a rc switch using my raspberry pi where openhab is also hosted. I already configured everything and it is working fine from shell e.g. as user pi I have to enter
sudo /opt/rcswitch-pi/send 00001 5 1to turn the rc switch on. Now I tried to integrate this into openhab, without success. I added the following line to my home.items file:
Switch Light_FF_Test "Test Funksteckdose" (FF_Test, Lights) {exec="OFF:sudo /opt/rcswitch-pi/send 00001 5 0, ON:sudo /opt/rcswitch-pi/send 00001 5 1"}I see openhab gets the command (log file) but it does not switch the rc switch. Any suggestions? Thank you!!
-
Is the user, that runs OH allowed to sudo?
-
Did you install the exec addon?
-
If OH is running as root you don't need to sudo. Haven't tried to sudo as root yet. :-)
If OH is running with a deamon user, which certainly makes sense for production, this user may not be allowed to sudo. -
Did you install the exec addon?
@Jan-Gatzke said:
Did you install the exec addon?
Thank you Sir!
was asking in a different forum as well, nobody had the idea to install this binding first and I didn´t know a binding is needed for execution of commands...
Well then, problem solved :+1: :)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login