OK so, assuming your HA is on Raspberry PI logon to it via SSH and run the same command:
(you should first switch to virtual env) sudo su -s /bin/bash homeassistant source /srv/homeassistant/homeassistant_venv/bin/activate or source /srv/homeassistant/homeassistant/bin/activate depending on your install options.
and then paste the command and in case there is any error please copy it to https://hastebin.com/ and paste the link here.
I guess you would have more luck asking for help on HA discord chat https://discordgg/c5DvZ4e. Itās way more responsive
sorry for the very late reply (life getās in the way sometimes)
i have been looking at my config and comparing it what you have and i honestly canāt find a reason it wouldnāt work, especially if http://192.168.0.141:8909/?action=System.Shutdown works in the browser.
Does it work if you SSH into the Raspberry Pi and type the command
Instead I made something similar, by plugging my computer into a Wemo Switch, I can turn on through HASS UI and my Echo. In addition, i created a cmd switch, that remotely shutdown my computer, when triggered through hass UI or my Echo. after the power consumption is at its lowest, the Wemo Switch turns off.
thatās a cool way to do itā¦ how did you make the cmd switch? does the wemo turn off the power if your machine goes to sleep? or did you have to disable sleep mode?
I donāt think itās possible with Airytec Switch Off, for that to work I guess you would need to put in your password into the URL, similar to how IP cameras can include password and username in rtsp linkā¦ there may well be software out there that supports a feature like this but I have never looked. the other solution might be to come up with some script that can inject the username and password for you but again i have no experience in this.
For any1 interested, i have combined it with a WOL command on a switch:
switches.yaml:
- platform: wake_on_lan
name: My PC
mac_address: "00-00-00-00-00-00"
host: xxx.xxx.xxx.xxx
icon: mdi:desktop-classic
turn_off:
service: shell_command.sleep_my_pc
Problem arised when I tried adding further functionality, i.e. turn off the monitors (with the help of nircmd.exe)
The predefined commands of the airytec thingy (say the preinstalled one that launches calculator) do work when calling them from the tray icon but do not work from the web interface that airytec is providing nor when calling them from HA.
They do create a process (calc.exe) in the task manager but the actual window never appears.
Hi to all.
If you have any problem (like curl not works or similar) try to force manually on Windows Firewall (if enabled) app rules (Local and not) add the executable path (ex. C:\Program Files\Airytec\Switch Off\swoff.exe ) and try to modify config.yaml without () after curl .
It works for me!
Donāt think my issue is on curl, the command runs but I only get the calculator on windows as a process and k thing pops up.
I think itās some issue of airytech
it works on hass.io as well.
Generally, shell commands work on SSH for hass.io, only likes of sudo etc. donāt.
Back to hass.io, I followed the instruction, set up password for Airytec in Options, I couldnāt see View web interface link otherwise. Created firewall rule for port 8000 (not sure if necessary tho).
Left automation: code part as it is, and for shell command:
But I have the next problem. If I turn off the PC using Airytec (via hass.io) then my PC (Win 10) will not turn on via WOL, only turns on with a physical button. If I turn off the PC using the start menu, then my PC (Win 10) will turn on via WOL.
I found I had this problem also but my friend doesnāt have this issue, itās possible it is somthing to do with the WOL implementation in the system itself. To be honest I never shut down using airytec. If Iām away from home I use WOL to turn on the machine then I access it with TeamViewer which I have setup to autostart. When I am done I perform a shutdown from the start menu. the whole purpose for me with this is the ability to reboot the machine if there are any problems with remote access caused by a crash etc.
Thank you bilalY for the answer. At the moment I use this same circuit (with Teamviewer), but I wanted automation. Now, I use hibernation instead of turning off (this is for automation).
Hiā¦I tried the OP method and it did not work. I have to add program switchoff into the Windows Firewall to allow its access; then it works smoothlyā¦thanks a lot.