Seite 1 von 1
Finde den Fehler nicht (SSH: Execute command)
Verfasst: So 3. Mär 2024, 09:38
von Markus
Wenn ich unter Dienst folgendes probiere wird der Befehl ordnungsgemäß ausgeführt:
Code: Alles auswählen
service: ssh.execute_command
target:
device_id: 123456
data:
command: sudo reboot
Packe ich das ganze in eine Automatisierung wird diese nicht ausgeführt (und da finde ich den Fehler einfach nicht)
Code: Alles auswählen
alias: Steuerung restart uptime
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.uptimekuma_mqtt_vzlogger_chn2
from: "on"
to: "off"
for:
hours: 0
minutes: 2
seconds: 30
condition: []
action:
- service: ssh.execute_command
data:
command: sudo reboot
target:
device_id: 123456
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- service: notify.mobile_app_myphone
data:
title: VZ restart
mode: single
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: So 3. Mär 2024, 14:45
von Osorkon
Auf welchem Host willst Du den den ssh Befehl ausführen?
Und wo hast Du den Dienst ssh.execute_command her?
Gruß
Osorkon
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: So 3. Mär 2024, 15:28
von Markus
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: Sa 9. Mär 2024, 21:29
von Markus
Ich komm nicht dahinter...
- Screenshot 2024-03-09 212830.jpg (26.65 KiB) 1163 mal betrachtet
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: So 10. Mär 2024, 06:42
von whoami
Probier mal das hier
Code: Alles auswählen
action:
- service: ssh.execute_command
data:
command: sudo reboot
target:
device_id: 123456
response_variable: cmd_result
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: So 10. Mär 2024, 20:33
von Markus
Leider auch nicht...
- Screenshot 2024-03-10 203216.jpg (44.76 KiB) 1128 mal betrachtet
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: Mo 11. Mär 2024, 06:32
von whoami
Du bist schon mal weiter (eine andere Fehlermeldung) zeig mal die aktuelle Logik, 1:1 als yaml.
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: Mo 11. Mär 2024, 06:54
von Markus
Code: Alles auswählen
alias: Steuerung_vz restart uptime
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.uptimekuma_mqtt_vzlogger_chn2
from: "on"
to: "off"
for:
hours: 0
minutes: 2
seconds: 30
condition: []
action:
- service: ssh.execute_command
data:
command: sudo reboot
target:
device_id: 123456
response_variable: cmd_result
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- service: notify.mobile_app_at_lmx3
data:
title: VZ restart
mode: single
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: Mo 11. Mär 2024, 07:01
von Friedi
Markus hat geschrieben: ↑Mo 11. Mär 2024, 06:54
Code: Alles auswählen
- service: notify.mobile_app_at_lmx3
data:
title: VZ restart
mode: single
Bei deinem Code fehlt die Message. Probier mal so:
Code: Alles auswählen
- service: notify.mobile_app_at_lmx3
data:
title: VZ restart
message: Meine Benachrichtigung
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: Mo 11. Mär 2024, 09:32
von Markus
Interessant, hab die Automatisierung manuell ausgeführt und jetzt ( mit Ergänzung der message) ist sie ordnungsgemäß durchgelaufen. Lag das wirklich an der fehlenden Message?
Re: Finde den Fehler nicht (SSH: Execute command)
Verfasst: Mo 11. Mär 2024, 11:32
von Friedi
Klar. Steht ja auch in deiner Fehlermeldung:
- Bild 11.03.24 um 11.31.jpeg (31.28 KiB) 1098 mal betrachtet