so im trying to make an automation where I can turn on and off my PC via HA. So far, turning on the PC via the wake-on-lan automation works, but the shutdown isnt. I think it's because the entity for the turn off switch isnt being created
I am essentially following this guide: https://community.home-assistant.io/t/turning-off-a-windows-pc-with-home-assistant/27970
here is my config added to configuration.yml:
- platform: command_line
switches:
pc:
command_off: 'curl http://192.168.x.x:5001/Shutdown'
- platform: wake_on_lan
name: windowswol
host: 192.168.x.x
mac: 74:56:3C:x:x:x
- platform: template
switches:
windows:
value_template: '{{ states.switch.windowswol.state }}'
turn_on:
service: switch.turn_on
entity_id: switch.windowswol
turn_off:
service: switch.turn_off
entity_id: switch.pc ```
I see entities 'switch.windowswol' and 'switch.windows', but shouldnt there also be 'switch.pc'?
If I run 'curl http://192.168.x.x:5001/Shutdown' in the HA terminal, shutdown works, which is why I think its because I dont have an entitiy being created for shutdown, and im not sure why
any help would be much appreciated
So, I found this great project on github to turn off a windows machine and wanted to share it as it’s something I’ve wanted to do for ages. go to the releases section and download the zip file and the rest should be easy here is the link and how I’ve integrated it into my home assistant switch: - platform: command_line switches: pc: ...