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 1
to 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?
-
For testing purposes I use the root user, I guess he should be able to sudo!? But I'm a total Linux noob...
-
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.
-
@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
Suggested Topics
-
Openhab 2 Mysensors smart chicken coop
My Project • 1 Mar 2017, 02:08 • Ticupolu 8 Mar 2017, 15:48 -
OpenHab Questions
OpenHAB • 16 Mar 2015, 13:24 • Chaotic 18 Mar 2015, 10:34 -
Problem with connecting serial gateway to openhab2
OpenHAB • 7 Jan 2020, 19:52 • Marcin Szyda 8 Jan 2020, 18:01 -
OpenHab mqtt binding only one topic
OpenHAB • 27 Jan 2015, 17:46 • mothpaul 28 Jan 2015, 15:37 -
Light dimmer with openhab and esp8266
General Discussion • 22 Aug 2018, 11:54 • neelam 22 Aug 2018, 12:01 -
A "poor mans version" of awning control
My Project • 5 Feb 2016, 19:08 • mbj 5 Feb 2016, 19:08 -
Adding sensors and relays to serial gateway
Development • 8 Dec 2015, 16:09 • Tino 9 Dec 2015, 16:19