Help with openhab restart button

(Alexey Sutyagin) #1

Hi
Can you please advise me how to create command to execute openhab restart?
I have added exec binding, set item and thing but not sure how to execute this command:

#item
String openhab_restart “Restart Openhab” { channel=“exec:command:openhab_restart:input”, autoupdate=“false” }

#things
Thing exec:command:openhab_restart [command=“sudo systemctl restart openhab2.service”, interval=0, autorun=true]

0 Likes

Exec binding not working for me
(Rich Koshak) #2

See:

The most likely problem is the openhab user is not a member of sudoers.

0 Likes

(Kim Skatun) #3

Just out of curiosity why would you have a reset button in your sitemap?

I have done similar to you, to restart the ola(light service) on the rpi,

I added a physically switch to cut power to rpi, however maybe a good idea would have been to attach this to an gpio an use an outside openhab script to listen on this pin and then restart openhab

0 Likes

(Alexey Sutyagin) #4

i had many instances when binding has stopped working and only restart helps. I want to be able to control it remotely without logging into rpi.

0 Likes

(Alexey Sutyagin) #5

Thank you. This is what I have done and checked for the openhabian permissions to execute without the password.

0 Likes