i am trying desperately to light a LED with my Raspberry3 running openhab2.
I have a Thing:
Thing exec:command:ledein “LED ein” [ command="sudo sh /etc/openhab2/scripts/ledein.sh %2$ ]
I have an Item:
Switch ledein “LED” { channel=“exec:command:ledein:run”}
an a sitemap:
Switch item=ledein mappings=[ “ON”=“Ein”, “OFF”=“Aus” ]
I don´t have a LED giving light.
I´m shure its pretty easy,
but sorry , I’m german
EDIT led goes on by running the command line from the thing
Looking at your Things file you are missing a " at the end.
Thing exec:command:ledein “LED ein” [ command="sudo sh /etc/openhab2/scripts/ledein.sh %2$ ]
Changed to add the missing "
Thing exec:command:ledein “LED ein” [ command="sudo sh /etc/openhab2/scripts/ledein.sh %2$" ]
When the light turns on by running the command is the %2$ used or just sudo sh /etc/openhab2/scripts/ledein.sh? If the %2$ is needed then make sure you have the Regex transformation installed.
What errors do you see in the logs? You can view them by selecting openhab2 log viewer (front tail) from the web interface (same place you select to open PaperUI).
I added the missing ", but LED is still dark. sudo sh /etc/openhab2/scripts/ledein.sh works both ways, with and without %2$
in sudoers.tmp openhab and openhab2 are ALL=(ALL:ALL) ALL
ledein is chmod -x
Now to the Log: I am not able to get it. The place where I select PaperUI only has HomeBuilder, - Paper and Basic UI and HABPanel.
AND the last Entry in Event.log ( var/logs/openhab2) is from December 2018
BUT log:tail gives me a friendly
08:37:32.542 [INFO ] [smarthome.event.ItemStateChangedEvent] - ledein changed from ON to OFF
in green letters
and a lot of Text in red concerning my fritzboxTR064 Binding ad some pink stuff because Name isn’t the same as in home …
How did you install OH, with apt-get or manually? The file should be openhab:openhab or openhab:openhabian.
What package did you select, minimal, simple, etc…? I have the standard package installed and it comes with OH by default (best I remember). If you go to sudo openhabian-config and use the tools I think you can add the front tail log.
Many Thanks.
I rember that i don´t wanted an openhabian Raspi but a Raspi with Jessie and Openhab.
Because of I want to get more familiar with Linux and like to use GPIO. Is this possible with the Image ?
If using the image it will be Stretch not Jessie but you can still use GPIO’s and it’s still linux. After you get it running, and familiar with OH, you can always get another SD card and go back to installing manually.
So finally is works.
I did a fresh install of Jessie an an apt-get install of openHAB.
I still can´t start the script via Openhab but the Quest is done:
A LED ist on when a poweroutlet is switched by openHAB and goes off when poweroutlet is switched off.
I will further try to switch LED by Openhab