Skip to content

Commit

Permalink
Added PC Power Options
Browse files Browse the repository at this point in the history
added input_select for PC Shutdown reboot hibernate and suspend
  • Loading branch information
CiquattroFPV committed Jun 5, 2017
1 parent 4824912 commit 48a91e7
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 7 deletions.
70 changes: 70 additions & 0 deletions automations.yaml
Expand Up @@ -911,3 +911,73 @@
- service: notify.homenicoassistant_bot
data:
message: "Sunset - Lights ON at {{ states('sensor.date__time') }}"


####################################################
# #
# PC States #
# #
####################################################
####################################################
# PC restart #
####################################################

- id: PC Restart
alias: pc_restart
trigger:
platform: state
entity_id: input_select.pcoptions
to: "Restart"
action:
- service: shell_command.restart_pc
- service: notify.homenicoassistant_bot
data:
message: "PC Restart at {{ states('sensor.date__time') }}"

####################################################
# PC Shutdown #
####################################################

- id: PC Restart
alias: pc_shutdown
trigger:
platform: state
entity_id: input_select.pcoptions
to: "Shutdown"
action:
- service: shell_command.shutdown_pc
- service: notify.homenicoassistant_bot
data:
message: "PC Shutdown at {{ states('sensor.date__time') }}"

####################################################
# PC Sleep #
####################################################

- id: PC Sleep
alias: pc_sleep
trigger:
platform: state
entity_id: input_select.pcoptions
to: "Sleep"
action:
- service: shell_command.sleep_pc
- service: notify.homenicoassistant_bot
data:
message: "PC Sleep at {{ states('sensor.date__time') }}"

####################################################
# PC Hibernate #
####################################################

- id: PC Hibernate
alias: pc_hibernate
trigger:
platform: state
entity_id: input_select.pcoptions
to: "Hibernate"
action:
- service: shell_command.hibernate_pc
- service: notify.homenicoassistant_bot
data:
message: "PC Hibernated at {{ states('sensor.date__time') }}"
16 changes: 11 additions & 5 deletions camera.yaml
@@ -1,8 +1,8 @@
- platform: foscam
ip: 10.10.10.205
username: !secret foscam_username
password: !secret foscam_pwd
name: "Camera Salone R2"
#- platform: foscam
#ip: 10.10.10.205
#username: !secret foscam_username
#password: !secret foscam_pwd
#name: "Camera Salone R2"
- platform: generic
still_image_url: http://api.sat24.com/animated/IT/visual/1/Central%20European%20Standard%20Time/2380259'%20width=400%20height=291
name: Rome
Expand All @@ -18,3 +18,9 @@
name: ISS
still_image_url: https://maps.googleapis.com/maps/api/staticmap?center={{ states.binary_sensor.iss.attributes.lat }},{{ states.binary_sensor.iss.attributes.long }}&zoom=3&size=500x500&maptype=roadmap&markers=color:blue%7Clabel:P%7C{{ states.binary_sensor.iss.attributes.lat }},{{ states.binary_sensor.iss.attributes.long }}
limit_refetch_to_url_change: true
- platform: synology
url: !secret synology_url
username: !secret synology_user
password: !secret synology_pwd
timeout: 15
verify_ssl: False
10 changes: 10 additions & 0 deletions input_select/pc_power_options.yaml
@@ -0,0 +1,10 @@
pcoptions:
name: PC Power Options
options:
- Restart
- Shutdown
- None
- Sleep
- Hibernate
initial: None
icon: mdi:desktop-tower
8 changes: 6 additions & 2 deletions shell_commands.yaml
@@ -1,3 +1,7 @@
nico_update: 'mosquitto_pub -d -u Nico -P password -t owntracks/Nico/Nico/cmd -m "{"_type":"cmd","action":"reportLocation"}"'
mamma_update: 'mosquitto_pub -d -u mamma -P password -t owntracks/mamma/mamma/cmd -m "{"_type":"cmd","action":"reportLocation"}"'
nico_update: 'mosquitto_pub -d -u Nico -P forzalazio -t owntracks/Nico/Nico/cmd -m "{"_type":"cmd","action":"reportLocation"}"'
mamma_update: 'mosquitto_pub -d -u mamma -P forzalazio -t owntracks/mamma/mamma/cmd -m "{"_type":"cmd","action":"reportLocation"}"'
restart_ha: sudo service hass-daemon restart &
shutdown_pc: '/usr/bin/curl -X GET "http://10.10.10.217:7760/poweroff"'
restart_pc: '/usr/bin/curl -X GET "http://10.10.10.217:7760/reboot"'
sleep_pc: '/usr/bin/curl -X GET "http://10.10.10.217:7760/suspend"'
hibernate_pc: '/usr/bin/curl -X GET "http://10.10.10.217:7760/hibernate"'

0 comments on commit 48a91e7

Please sign in to comment.