From: Giorgio Ravera Date: Thu, 7 Feb 2019 18:38:51 +0000 (+0100) Subject: Addedd Laura from Google Maps X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=6692f284b030692270d484d9a182630d63a3d93f;p=homeassistant.git Addedd Laura from Google Maps --- diff --git a/automation/welcome.yaml b/automation/welcome.yaml index 0382154a..89d8d198 100644 --- a/automation/welcome.yaml +++ b/automation/welcome.yaml @@ -9,25 +9,52 @@ - platform: state entity_id: - device_tracker.google_maps_115265981849847357125 - - device_tracker.laura - to: 'home' + - device_tracker.google_maps_103158638433668748797 + to: 'Casa' for: '00:00:30' condition: [] - #condition: - #condition: time - #after: '10:00:00' - #before: '23:00:00' - #condition: state - #entity_id: input_boolean.home_mode_night - #state: 'off' action: + - wait_template: >- + {# Giorgio #} + {% if is_state_attr('trigger.to_state.entity_id', 'friendly_name', 'Giorgio') %} + {% if is_state('device_tracker.s9', 'home') %} + true + {% else %} + false + {% endif %} + + {# Laura #} + {% elif is_state_attr('trigger.to_state.entity_id', 'friendly_name', 'Laura') %} + {% if is_state('device_tracker.a5', 'home') %} + true + {% else %} + false + {% endif %} + + {# Anna #} + {% elif is_state_attr('trigger.to_state.entity_id', 'friendly_name', 'Anna') %} + {% if is_state('device_tracker.a3', 'home') %} + true + {% else %} + false + {% endif %} + + {# Others #} + {% else %} + false + {% endif %} + + timeout: '00:10:00' + continue_on_timeout: 'false' + - service: script.speech_engine data_template: language: 'it' message: > - {% set name = trigger.entity_id.split('.')[1]|replace('_', ' ') %} + {% set name = trigger.to_state.entity_id.split('.')[1]|replace('_', ' ') %} + {% set name = state_attr('trigger.to_state.entity_id', 'friendly_name') %} {%- macro greeting_sentence(name) -%} {{ [ "Ciao " ~ name + " è un piacere rivederti a casa", diff --git a/device_tracker/nmap.yaml b/device_tracker/nmap.yaml new file mode 100644 index 00000000..97eefd26 --- /dev/null +++ b/device_tracker/nmap.yaml @@ -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: 600 + new_device_defaults: + track_new_devices: false + hide_if_away: false diff --git a/device_tracker/nmap.yaml.disabled b/device_tracker/nmap.yaml.disabled deleted file mode 100644 index f4c98fe1..00000000 --- a/device_tracker/nmap.yaml.disabled +++ /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: 10 - - # 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: 600 - new_device_defaults: - track_new_devices: false - hide_if_away: false diff --git a/group/default.yaml b/group/default.yaml index 2bbb6a6c..00eae25d 100644 --- a/group/default.yaml +++ b/group/default.yaml @@ -4,7 +4,7 @@ default_view: icon: mdi:home entities: - device_tracker.google_maps_115265981849847357125 - - device_tracker.laura + - device_tracker.google_maps_103158638433668748797 - sensor.home_mode - group.cucina - group.sala diff --git a/group/people.yaml b/group/people.yaml index 231ecd62..dcc60363 100644 --- a/group/people.yaml +++ b/group/people.yaml @@ -4,5 +4,5 @@ people: icon: mdi:account-multiple entities: - device_tracker.google_maps_115265981849847357125 - - device_tracker.laura + - device_tracker.google_maps_103158638433668748797 - device_tracker.anna