For Authorized Service Providers, Run Apple Service Diagnostics to check which sensor went beyond expected thermal limits. If the issue persists, make an appointment at an Apple Store. Hold D on boot to run Apple Diagnostics and follow the instructions if any errors are found. Multiple temperature sensors exceeded the defined limit. Try resetting the SMC by connecting the switched off computer to power, holding ⌃control ⌥option ⇧shift and pressing power. On a laptop, the Mac should hibernate before the battery becomes so discharged it is unable to shutdown correctly, therefore if you see this shutdown cause on a laptop it may indicate a hardware issue with the battery or with the battery controller for reading the charge. ![]() It could be the case that the power button stuck down and forced a shutdown.Ĭheck power supply/battery on a laptop, or the power supply for a Mac without a battery. This does not indicate an issue with your system.Ĭheck the power button if you did not perform a hard shutdown yourself. Shutdown was initiated normally, from the macOS Shut Down menu or other shutdown command such as /sbin/shutdown. Have you got this error too, or any information? Leave a comment below! If during application usage, see if there’s an update to the app by the developer, and leave a comment below with the name of the app and the model of your Mac. Source: /usr/src/homeassistant/homeassistant/components/shell_command/_init_.If this occurs during boot, try Safe Mode by holding ⇧shift at boot to limit what opens during startup. Here is the error I get, but I know that is not related Unfortunatelly when I run it from lovelace it doesn’t work.Īlthough it does work from terminal, all the times. service: shell_command.shutdown_imac_right ![]() Shutdown_imac_right: ssh -i /config/ssh_keys/id_rsa "sudo shutdown -h now"Īfter that I create a script as follows: alias: shutdown imac right So, I go ahead and I create the shell command as follows: #shutdown imac right ssh -i /config/ssh_keys/id_rsa "sudo shutdown -h now" When I run the following command from HA terminal everything works smoothly and imac shuts down. (of course, replace to get full name of current user with to shut down, it’s easier to test without rebootingįollow up my previous post, another problem came up So, remove the leading echo, and you have what you want: ssh localhost 'osascript -e '"'"'tell application "System Events" to get full name of current user'"'" There are many ways to provide the proper quotes, the trick here is to end the initial single quote with a single quote, then start double with single inside, and terminate double and start single again… ![]() Gives: ssh localhost osascript -e 'tell application "System Events" to get full name of current user' Osascript expects a single arg after the -e, but the ssh execution gives 3 strings to execute on remote side, which, after shell evaluation loses the quotes, so you can test this: echo ssh localhost 'osascript -e '"'"'tell application "System Events" to get full name of current user'"'" Gives ssh -i /config/ssh_keys/id_rsa osascript -e tell app "System Events" to shut downĪs you can see single quotes are “lost” (because evaluated by shell on remote side) Simply add an echo at the beginning, and you will “see” what is executed: echo ssh -i /config/ssh_keys/id_rsa osascript -e 'tell app "System Events" to shut down' (if you need only the shutdown, you can also specify it): something like: (“user” is the actual username) user ALL = NOPASSWD: /sbin/shutdownĬoncerning your initial request, using osascript, the issue is about argument values… ![]() Personally I prefer the solution that is more unix-ish, than mac-ish.Īnd right, I would add that line to /etc/sudoers
0 Comments
Leave a Reply. |