So thanks to this community I have gotten a command_line entity to trigger a remote SSH command.
The command I’m running is for my dashcam – when I arrive home in my car, I trigger a remote linux machine to download all the videos off of my dashcam. And this works! The problem is that this command takes several minutes to complete, AND because I’m just using the “command_on:” to trigger the script ont eh remote machine, the switch entity is now stuck “on.”
Ideally what I’d like to happen is that switching the switch “on” would trigger the download to start, and then somehow the download script I’m using on the remote would call BACK to home assistant when the download completes to turn the switch off. Can anyone think of a clever way to do this?
I have a hacky way in my head to do all this (instead of having a command_line switch object I could just have a helper variable that the switch toggles, and the helper turning “on” could trigger the script, and then the switch could just automatically switch off after n minutes or something). But I’d rather be more deterministic than that if possible.