Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. OpenHAB
  4. openhab controlling rc switch on raspberry pi

openhab controlling rc switch on raspberry pi

Scheduled Pinned Locked Moved OpenHAB
rc switchopenhab
6 Posts 3 Posters 3.6k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • siodS Offline
    siodS Offline
    siod
    wrote on last edited by
    #1

    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!!

    still learning...

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TimO
      Hero Member
      wrote on last edited by
      #2

      Is the user, that runs OH allowed to sudo?

      1 Reply Last reply
      0
      • siodS Offline
        siodS Offline
        siod
        wrote on last edited by
        #3

        For testing purposes I use the root user, I guess he should be able to sudo!? But I'm a total Linux noob...

        still learning...

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jan Gatzke
          wrote on last edited by
          #4

          Did you install the exec addon?

          siodS 1 Reply Last reply
          0
          • T Offline
            T Offline
            TimO
            Hero Member
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • J Jan Gatzke

              Did you install the exec addon?

              siodS Offline
              siodS Offline
              siod
              wrote on last edited by
              #6

              @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: :)

              still learning...

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              17

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular