1
0
Fork 0

home-assistant: Add restart MQTTMarionette script

There's obviously a bug or something in `mqttmarionette` because it
occasionally gets "stuck" in a state where it is running but does
not reconnect to the MQTT broker.  In such situations, it has to be
restarted (and even then it doesn't shut down correctly but has to
be killed with SIGKILL, usually).  I have been doing this manually, but
with this shell script and a corresponding "shell command" integration
in Home Assistant, it can be done automatically.  This is similar to
how Home Assistant restarts Mopidy on the living room stereo when it
gets into the same kind of state.
pull/9/head
Dustin 2024-08-23 09:24:46 -05:00
parent 7dffb5195a
commit 94b7168b1e
5 changed files with 9 additions and 0 deletions

View File

@ -1 +1,2 @@
mosquitto.passwd
secrets.yaml.in

View File

@ -28,7 +28,9 @@ configMapGenerator:
- event-snapshot.sh
- groups.yaml
- restart-diddy-mopidy.sh
- restart-kitchen-mqttmarionette.sh
- shell-command.yaml
- ssh_known_hosts
- rest-command.yaml
options:
disableNameSuffixHash: true

View File

@ -0,0 +1 @@
ssh -i /run/secrets/home-assistant/sshkey.pem -oUserKnownHostsFile=/run/config/ssh_known_hosts -oBatchMode=yes kitchen@kitchen.pyrocufflink.red restart-mqttmarionette

View File

@ -3,3 +3,6 @@ event_snapshot: >-
restart_diddy_mopidy: >-
sh /run/config/restart-diddy-mopidy.sh
restart_kitchen_mqttmarionette: >-
sh /run/config/restart-kitchen-mqttmarionette.sh

View File

@ -0,0 +1,2 @@
diddy.pyrocufflink.red ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILx6gRqlVnvdqTIJTH16NBLJ4ORfTsBaUIEpt5ZMkkNW
kitchen.pyrocufflink.red ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBLzMLOlFXPiovBwYLmXCVV8Md/xR36zwPj6egT9V3O7