Moved upload.sh and Temperatur.txt to /config
Still return code: 127
Almost there…
- id: '1701867996210'
alias: Save Temperature to Local File
description: ''
trigger:
- platform: state
entity_id: sensor.vattentemperatur_1
action:
- service: notify.Vattentemperatur
data_template:
message: ' {{ states.sensor.vattentemperatur_1.state }}'
notify:
- platform: file
name: Vattentemperatur
filename: /config/Vattentemperatur.txt
timestamp: False
shell_command:
upload_script: bash /config/upload.sh
upload.sh:
#!/bin/bash
tail -n -1 Vattentemperatur.txt > last_temp.txt
echo "$(date +'%d/%m')" > datum.txt
sshpass -p ****** scp -P 22 last_temp.txt datum.txt [email protected]:/path/to/t2
- id: '1702997888249'
alias: Upload script
description: Upload to server
trigger:
- platform: time_pattern
minutes: /10
condition: []
action:
- service: shell_command.upload_script
data: {}
mode: single
- Automation “Save Temperature to Local File” adds value via “notify” when sensor value is changed.
- Vattentemperatur.txt is updated.
- Running upload.sh manually from terminal uploads .txt files to server.
- Running automation “Upload to server” does NOT work.
Obviously trapped in a container. I have no idea how to solve this. Any ideas are welcome.