From: Giorgio Ravera Date: Tue, 14 Jan 2020 21:03:53 +0000 (+0100) Subject: Moved device tracker from nmap to ping and updated home assistant update X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=593892996f09b8c6e69a00631d7264366332a9e2;p=homeassistant.git Moved device tracker from nmap to ping and updated home assistant update --- diff --git a/.gitignore b/.gitignore index a2fe8043..5a79d4e6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ deps/ .google_maps_location_sharing.cookies.* .HA_VERSION bravia.conf -home-assistant.log home-assistant_v2.db html5_push_registrations.conf .mercedesme-token-cache @@ -12,6 +11,9 @@ secrets.yaml tts/ .uuid +# Log Files +*.log + # Disabled Files *.disabled @@ -20,7 +22,3 @@ custom_components/ themes/ www/community git_repos/ - -# Scripts -fix_owner.sh -upgrade.sh diff --git a/automation/update_notifications.yaml b/automation/update_notifications.yaml index 875d25c4..7476d173 100644 --- a/automation/update_notifications.yaml +++ b/automation/update_notifications.yaml @@ -52,5 +52,5 @@ service: script.notify_text data_template: title: "HACS - Aggiornamento" - message: "Sono disponibili aggiornamenti per i dispositivi Shelly" + message: "Sono disponibili aggiornamenti per i moduli HACS" enable_persistant: true diff --git a/device_tracker/nmap.yaml b/device_tracker/nmap.yaml deleted file mode 100644 index cfc95993..00000000 --- a/device_tracker/nmap.yaml +++ /dev/null @@ -1,20 +0,0 @@ -###################################################################### -# Device Tracker: Nmap -###################################################################### - -- platform: nmap_tracker - hosts: - - s9.giorgioravera.it - - a5.giorgioravera.it - - a3.giorgioravera.it - scan_options: " --privileged -sP " - # The number of minutes Nmap will not scan this device - home_interval: 30 - - # Seconds between each scan for new devices - interval_seconds: 60 - # Seconds to wait till marking someone as not home after not being seen - consider_home: 300 - new_device_defaults: - track_new_devices: true - hide_if_away: false diff --git a/device_tracker/nmap.yaml.disabled b/device_tracker/nmap.yaml.disabled new file mode 100644 index 00000000..cfc95993 --- /dev/null +++ b/device_tracker/nmap.yaml.disabled @@ -0,0 +1,20 @@ +###################################################################### +# Device Tracker: Nmap +###################################################################### + +- platform: nmap_tracker + hosts: + - s9.giorgioravera.it + - a5.giorgioravera.it + - a3.giorgioravera.it + scan_options: " --privileged -sP " + # The number of minutes Nmap will not scan this device + home_interval: 30 + + # Seconds between each scan for new devices + interval_seconds: 60 + # Seconds to wait till marking someone as not home after not being seen + consider_home: 300 + new_device_defaults: + track_new_devices: true + hide_if_away: false diff --git a/device_tracker/ping.yaml b/device_tracker/ping.yaml new file mode 100644 index 00000000..c034b400 --- /dev/null +++ b/device_tracker/ping.yaml @@ -0,0 +1,18 @@ +###################################################################### +# Device Tracker: Ping +###################################################################### + +- platform: ping + hosts: + s9: s9.giorgioravera.it + a5: a5.giorgioravera.it + a3: a3.giorgioravera.it + count: 5 + + # Seconds between each scan for new devices + interval_seconds: 60 + # Seconds to wait till marking someone as not home after not being seen + consider_home: 300 + new_device_defaults: + track_new_devices: true + hide_if_away: false diff --git a/device_tracker/ping.yaml.disabled b/device_tracker/ping.yaml.disabled deleted file mode 100644 index c034b400..00000000 --- a/device_tracker/ping.yaml.disabled +++ /dev/null @@ -1,18 +0,0 @@ -###################################################################### -# Device Tracker: Ping -###################################################################### - -- platform: ping - hosts: - s9: s9.giorgioravera.it - a5: a5.giorgioravera.it - a3: a3.giorgioravera.it - count: 5 - - # Seconds between each scan for new devices - interval_seconds: 60 - # Seconds to wait till marking someone as not home after not being seen - consider_home: 300 - new_device_defaults: - track_new_devices: true - hide_if_away: false diff --git a/shell_command/homeassistant.yaml b/shell_command/homeassistant.yaml index c3511e31..f665123a 100644 --- a/shell_command/homeassistant.yaml +++ b/shell_command/homeassistant.yaml @@ -1 +1 @@ -homeassistant_upgrade: 'bash /config/homeassistant_upgrade.sh' +homeassistant_upgrade: 'bash /config/shell_scripts/homeassistant_upgrade.sh' diff --git a/shell_scripts/homeassistant_upgrade.sh b/shell_scripts/homeassistant_upgrade.sh old mode 100644 new mode 100755 index 9e431f26..70ed341b --- a/shell_scripts/homeassistant_upgrade.sh +++ b/shell_scripts/homeassistant_upgrade.sh @@ -1,9 +1,12 @@ #!/bin/bash +HASS_HOME="/config" +LOG_FILE="$HASS_HOME/home-assistant_upgrade.log" + echo "Changed directory to homeassistant home" -cd -echo "Activating python environment" -source bin/activate -echo "Upgrading homeassistant" -pip3 install --upgrade homeassistant 2>&1 | tee /var/log/homeassistant/upgrade.log +cd $HASS_HOME +#echo "Activating python environment" +#source bin/activate +echo "Starting upgrading homeassistant" +pip3 install --upgrade homeassistant 2>&1 | tee $LOG_FILE echo "Done"