Platform information:
- Hardware: Raspberry Pi 3
- OS: openHABian
- openHAB version: 2.2
Hey all,
this is my first post in this forum, thanks for your attention…
I have an OH-server on the first Raspberry Pi and want to display some stats from the client Raspberry Pi on the Basic UI/OH-server.
I already established an automatic ssh login to the client. It seems to work fine, as my script on the OH-server displays the stats, when I start it with
bash script.sh
Script:
#! /bin/bash
#read stats
INPUT=$(/usr/bin/ssh -i /home/openhabian/.ssh/id_rsa pi@192.168.XXX.XXX "/bin/cat /sys/bus/w1/devices/28-0000079f43f0/w1_slave |tail -n1 |cut -d\"=\" -f2")
TEMP=$(echo "scale=2; $INPUT / 1000" | bc)
# return stats
echo $TEMP
I added the following
things
Thing exec:command:workingtemp [command="bash /etc/openhab2/scripts/script.sh"]
items
Number Working_Temperature "Working Area [%.1f °C]" <temperature>
String working_temperature_out { channel="exec:command:workingtemp:output" }
rules
rule "Working Area Temperature"
when
Item working_temperature_out received update
then
Working_Temperature.postUpdate(
( ( Float::parseFloat(working_temperature_out.state.toString) as Number ) * 10 ) / 10
)
end
and added it to a sitemap with:
Text item=Working_Temperature
But in the log the following message appears:
2018-01-12 14:02:14.597 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Working Area Temperature': For input string: "Warning: Identity file /home/openhabian/.ssh/id_rsa not accessible: Permission denied.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
Warning: Identity file /home/openhabian/.ssh/id_rsa not accessible: Permission denied.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password)."
When I use a script with a local sensor on OH-server/Raspberry with exactly the same things/items/rules/sitemap it is working fine.
So I guess there seems to be a problem with the /.ssh permission. Do I need to add another user or service to be able to handle my /.ssh folder?
Thanks for your help and have a nice weekend
Stefan