rule âKlingel anschalten-ausschaltenâ
when
Item Klingel changed
then
if (Klingel.state == ON) Klingel_AN_schalten.sendCommand(ON)
else Klingel_AUS_schalten.sendCommand(ON)
end
Please help me, because I tried the whole day to get this running âŠ
Have tried to use the absolute path in your Thing. I do it in this way:
Thing exec:command:cpu_temp "OH2-PI Temperatur" @ "Kinderzimmer"
[command="/bin/bash /etc/openhab2/scripts/cpu_temp.sh", interval=120, timeout=30, transform="REGEX((.*?))"]
Does it help ?
This is events log
2019-07-16 21:45:53.651 [ome.event.ItemCommandEvent] - Item âKlingelâ received command ON
2019-07-16 21:45:53.657 [vent.ItemStateChangedEvent] - Klingel changed from OFF to ON
2019-07-16 21:45:53.660 [ome.event.ItemCommandEvent] - Item âKlingel_AN_schaltenâ received command ON
2019-07-16 21:45:53.661 [nt.ItemStatePredictedEvent] - Klingel_AN_schalten predicted to become ON
2019-07-16 21:45:53.665 [vent.ItemStateChangedEvent] - Klingel_AN_schalten changed from OFF to ON
2019-07-16 21:45:53.680 [vent.ItemStateChangedEvent] - Klingel_AN_schalten changed from ON to OFF
How about changing the rule to use exec action, instead of binding. This allows you to get results info. (Once its sorted out you can go back to using binding)
rule "Klingel anschalten-ausschalten"
when
Item Klingel changed
then
var execresult = "timed out"
if (Klingel.state == ON) {
execresult = executeCommandLine( "bash /docker/config/openhab/conf/scripts/relais_an.sh", 3000)
} else {
execresult = executeCommandLine( "bash /docker/config/openhab/conf/scripts/relais_aus.sh", 3000)
}
logInfo("test". "result: " + execresult
end
Sorry for the long time of not answering but some more important issues happened.
I tried it and it brought me to a new error which I am not able to solve.
If I am running the script within the container as root
it is looking for key files in this directory: Found key in /root/.ssh/known_hosts:1
But if I am running the script via button from openhab panel:
debug1: Trying private key: /openhab/.ssh/id_rsa
debug1: Trying private key: /openhab/.ssh/id_dsa
debug1: Trying private key: /openhab/.ssh/id_ecdsa
debug1: Trying private key: /openhab/.ssh/id_ed25519
debug1: Next authentication method: password
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
ssh command is identically, because the file is passed to the container
docker host and container are having user openhab AND in both home dir is a .ssh folder
permissions are ok and for openhab user âŠ