Skip to content

Automation using “Run script over SSH” works in testing, but not when triggered by HomeKit

Automation using “Run script over SSH” works in testing, but not when triggered by HomeKit

** What I’m trying to do: ** – when a door opens, use the “Run script over SSH” action to trigger an AppleScript to send me an iMessage * I’ve worked before *, but at some point in the last month, it stopped working. I’ve done a lot of different HomeKit automations, so I can’t tell if something I did triggered the problem. [It shouldn’t make any difference, but I have other Automations triggered by the same door opening (playing a sound on the HomePod). I keep them in separate Automations because ultimately I want the iMessage one to be executed only when I’m not home]

& # x200B; ** Details about my process ** 1) The door sensor opens, performs a “Run script over SSH” action 2) The “Run script over SSH” action calls an AppleScript on a Mac Mini. I use password authentication 3) AppleScript sends me an iMessageâ & # x20AC; & # x2122; ** What works: ** 1) When I am in the “Run script over SSH” action itself and touch the orange triangle, I get the “Unknown host” dialog. The key fingerprint of the host is displayed. On the host computer, in the Console, I see three “failed sending: invalid argument” errors in the sshd process, followed by three kernel process errors, all related to sshd. If I tap the Continue button, AppleScript runs correctly and receives the correct iMessage delivery. The console on the target iMac adds a bunch of errors (to be fair, sending an iMessage directly from the Messages app on Mac OS to the host computer seems to generate similar errors) 2) When I’m inside the automation and touch the “Test automation” button, I see the same results as above, without the Unknown Host dialog and the need to touch Continue. The same error messages in the host console, the same successful iMessage sent & # x200B;

[Host iMac’s Console (success)](https://preview.redd.it/l2h4tzlvf6z61.png?width=1054&format=png&auto=webp&s=1375fcaf58b7dd0d9506296eabc908d877c7469b) ** What does not work: ** 1) Triggering uș. The host console has the same three sshd errors and the same three kernel errors, but nothing happens beyond that (no other console errors, no iMessage) & # x200B;

[Host iMac’s Console (fail)](https://preview.redd.it/9gc9kkr5h6z61.png?width=1082&format=png&auto=webp&s=cc15fadb5e94ad24176944d16676d62c3929c4db) & # x200B; Am I doing something wrong? Would using SSH key authentication help? (and if “yes”, an indicator to how to implement this!) Any help or guidance or request for more information is appreciated.