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.
This commit is contained in:
1
home-assistant/.gitignore
vendored
1
home-assistant/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
mosquitto.passwd
|
||||
secrets.yaml.in
|
||||
|
||||
@@ -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
|
||||
|
||||
1
home-assistant/restart-kitchen-mqttmarionette.sh
Normal file
1
home-assistant/restart-kitchen-mqttmarionette.sh
Normal 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
|
||||
@@ -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
|
||||
|
||||
2
home-assistant/ssh_known_hosts
Normal file
2
home-assistant/ssh_known_hosts
Normal file
@@ -0,0 +1,2 @@
|
||||
diddy.pyrocufflink.red ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILx6gRqlVnvdqTIJTH16NBLJ4ORfTsBaUIEpt5ZMkkNW
|
||||
kitchen.pyrocufflink.red ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBLzMLOlFXPiovBwYLmXCVV8Md/xR36zwPj6egT9V3O7
|
||||
Reference in New Issue
Block a user