From: Giorgio Ravera Date: Fri, 24 Apr 2020 13:38:49 +0000 (+0200) Subject: Added QNAP package X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=6371cc29940236ef56d7a71f12e8c9f7b2aa2da4;p=homeassistant.git Added QNAP package --- diff --git a/configuration.yaml b/configuration.yaml index ad2038f6..acbb15b6 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -134,6 +134,12 @@ automation: !include_dir_merge_list automation/ # Scripts script: !include_dir_merge_named script/ +# Mobile App +mobile_app: + +# Wake on Lan +wake_on_lan: + # Components: # Google Cast cast: !include components/cast.yaml @@ -161,9 +167,6 @@ weather: !include components/weather.yaml # Speed Test speedtestdotnet: !include components/speedtest.yaml -# Mobile App -mobile_app: - # Panel Iframe: # panel_iframe: !include components/panel_iframe.yaml diff --git a/packages/qnap.yaml b/packages/qnap.yaml new file mode 100644 index 00000000..dc060c46 --- /dev/null +++ b/packages/qnap.yaml @@ -0,0 +1,87 @@ +###################################################################### +# QNAP Package - Switch +###################################################################### + +switch: + + - platform: wake_on_lan + mac: !secret nas_mac + name: NAS + host: !secret nas_host + turn_off: + service: shell_command.nas_turn_off + data: + nas_host: !secret nas_host + nas_username: !secret nas_username + +###################################################################### +# QNAP Package - Shell Command +###################################################################### + +shell_command: + + nas_turn_off: 'ssh {{nas_username}}@{{ nas_host }} -i /config/credentials/id_rsa halt' + plex_start: 'ssh {{nas_username}}@{{ nas_host }} -i /config/credentials/id_rsa /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/plex.sh start' + plex_restart: 'ssh {{nas_username}}@{{ nas_host }} -i /config/credentials/id_rsa /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/plex.sh restart' + plex_stop: 'ssh {{nas_username}}@{{ nas_host }} -i /config/credentials/id_rsa /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/plex.sh stop' + +###################################################################### +# QNAP Package - Script +###################################################################### + +script: + + plex_start: + alias: "Avvia Plex" + sequence: + - service: shell_command.plex_start + data: + nas_host: !secret nas_host + nas_username: !secret nas_username + + plex_restart: + alias: "Riavvia Plex" + sequence: + - service: shell_command.plex_restart + data: + nas_host: !secret nas_host + nas_username: !secret nas_username + + plex_stop: + alias: "Ferma Plex" + sequence: + - service: shell_command.plex_stop + data: + nas_host: !secret nas_host + nas_username: !secret nas_username + + +###################################################################### +# QNAP Package - Google Assistant +###################################################################### + +google_assistant: + entity_config: + switch.nas: + name: NAS + expose: true + room: Generale + script.plex_start: + name: Avvia Plex + expose: true + room: Generale + script.plex_stop: + name: Ferma Plex + expose: true + room: Generale + +homeassistant: + customize: + switch.nas: + icon: mdi:nas + script.plex_start: + icon: mdi:plex + script.plex_restart: + icon: mdi:plex + script.plex_stop: + icon: mdi:plex diff --git a/sensor/qnap.yaml.disabled b/sensor/qnap.yaml.disabled index 957acb14..dc15bd3d 100644 --- a/sensor/qnap.yaml.disabled +++ b/sensor/qnap.yaml.disabled @@ -3,9 +3,9 @@ ###################################################################### - platform: qnap - host: !secret qnap_host - username: !secret qnap_username - password: !secret qnap_password + host: !secret nas_host + username: !secret nas_username + password: !secret nas_password monitored_conditions: - status - system_temp diff --git a/ui-settings.yaml b/ui-settings.yaml index cab4d185..40f39dd1 100644 --- a/ui-settings.yaml +++ b/ui-settings.yaml @@ -76,23 +76,34 @@ views: id: network icon: mdi:lan cards: - - type: glance - title: External IP - entities: - - sensor.ip_1 - - sensor.ip_2 - - type: glance - title: Speed Test - entities: - - sensor.speedtest_ping - - sensor.speedtest_download - - sensor.speedtest_upload - - type: glance - title: pfSense - entities: - - sensor.freebsd_router_kib_sec_received - - sensor.freebsd_router_kib_sec_sent - + - type: vertical-stack + cards: + - type: glance + title: External IP + entities: + - sensor.ip_1 + - sensor.ip_2 + - type: glance + title: Speed Test + entities: + - sensor.speedtest_ping + - sensor.speedtest_download + - sensor.speedtest_upload + - type: glance + title: pfSense + entities: + - sensor.freebsd_router_kib_sec_received + - sensor.freebsd_router_kib_sec_sent + - type: vertical-stack + cards: + - type: entities + title: Nas + show_header_toggle: false + entities: + - switch.nas + - script.plex_start + - script.plex_stop + ###################################################################### # Zigbee ######################################################################