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
-
Is MQTT Necessary? or, Use Case for MQTT?
Controllers • 28 Mar 2016, 01:12 • TRS-80 9 Jan 2020, 09:01 -
vThing - CO2 Monitor - Dual Beam - Wifi
OpenHardware.io • 21 Jun 2016, 03:47 • openhardware.io 22 Jun 2016, 16:05 -
Problem with connecting serial gateway to openhab2
OpenHAB • 7 Jan 2020, 19:52 • Marcin Szyda 8 Jan 2020, 18:01 -
Connect humidity sensor to OpenHAB
OpenHAB • 12 Feb 2015, 03:18 • vladimir 18 Feb 2015, 12:38 -
Boxes and Enclosures
Enclosures / 3D Printing • 29 Mar 2014, 21:02 • PITP2 31 Aug 2014, 19:27 -
Change color of RGB led strip over MQTT?
OpenHAB • 6 Jan 2017, 04:24 • augusthalverson 6 Jan 2017, 04:30