Advertisement
Bart274

Icloud automation

Nov 3rd, 2016
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.85 KB | None | 0 0
  1. device_tracker:
  2.   - platform: nmap_tracker
  3.     hosts: 192.168.0.1/24
  4.     home_interval: 1
  5.     consider_home: 300
  6.     interval_seconds: 15
  7.   - platform: bluetooth_tracker
  8.     track_new_devices: True
  9.     scan_interval: 15
  10.   - platform: icloud
  11.     account_name: bart
  12.     username: ***
  13.     password: ***
  14.   - platform: icloud
  15.     account_name: sharon
  16.     username: ***
  17.     password: ***
  18.  
  19. group:
  20.   barthelper:
  21.     name: Bart Helper
  22.     entities:
  23.      - device_tracker.iphonebartnmap
  24.       - device_tracker.iphonebartbt
  25.   sharonhelper:
  26.     name: Sharon Helper
  27.     entities:
  28.      - device_tracker.iphonevansharonnmap
  29.       - device_tracker.iphonevansharonbt
  30.  
  31. automation:
  32.   - alias: Bart kan vertrekken op het werk
  33.     trigger:
  34.       platform: time
  35.       after: '17:30:00'
  36.     condition:
  37.       condition: state
  38.       entity_id: device_tracker.iphonebart
  39.       state: 'Data Consult'
  40.     action:
  41.       - service: device_tracker.icloud_set_interval
  42.         data:
  43.           account_name: 'bart'
  44.           interval: 1
  45.           device_name: 'iphonebart'
  46.   - alias: Sharon kan vertrekken op het werk in de week
  47.     trigger:
  48.       platform: time
  49.       after: '18:30:00'
  50.     condition:
  51.       condition: and
  52.       conditions:
  53.         - condition: state
  54.           entity_id: device_tracker.iphonevansharon
  55.           state: 'Bel&Bo'
  56.         - condition: time
  57.           weekday:
  58.            - mon
  59.             - tue
  60.             - wed
  61.             - thu
  62.             - fri
  63.     action:
  64.       - service: device_tracker.icloud_set_interval
  65.         data:
  66.           account_name: 'sharon'
  67.           interval: 1
  68.           device_name: 'iphonevansharon'
  69.   - alias: Sharon kan vertrekken op het werk op zaterdag
  70.     trigger:
  71.       platform: time
  72.       after: '18:00:00'
  73.     condition:
  74.       condition: and
  75.       conditions:
  76.         - condition: state
  77.           entity_id: device_tracker.iphonevansharon
  78.           state: 'Bel&Bo'
  79.         - condition: time
  80.           weekday:
  81.            - sat
  82.     action:
  83.       - service: device_tracker.icloud_set_interval
  84.         data:
  85.           account_name: 'sharon'
  86.           interval: 1
  87.           device_name: 'iphonevansharon'
  88.   - alias: Bart NMAP is different from icloud
  89.     trigger:
  90.       platform: state
  91.       entity_id: group.barthelper
  92.     condition:
  93.       condition: template
  94.       value_template: "{{ states.group.barthelper.state != states.device_tracker.iphonebart.state }}"
  95.     action:
  96.       - service: device_tracker.icloud_set_interval
  97.         data:
  98.           account_name: bart
  99.           device_name: iphonebart
  100.           interval: 1
  101.   - alias: Bart NMAP is the same as icloud
  102.     trigger:
  103.       platform: state
  104.       entity_id: group.barthelper
  105.     condition:
  106.       condition: template
  107.       value_template: "{{ states.group.barthelper.state == states.device_tracker.iphonebart.state }}"
  108.     action:
  109.       - service: device_tracker.icloud_set_interval
  110.         data:
  111.           account_name: bart
  112.           device_name: iphonebart
  113.   - alias: Sharon NMAP is different from icloud
  114.     trigger:
  115.       platform: state
  116.       entity_id: group.sharonhelper
  117.     condition:
  118.       condition: template
  119.       value_template: "{{ states.group.sharonhelper.state != states.device_tracker.iphonevansharon.state }}"
  120.     action:
  121.       - service: device_tracker.icloud_set_interval
  122.         data:
  123.           account_name: sharon
  124.           device_name: iphonevansharon
  125.           interval: 1
  126.   - alias: Sharon NMAP is the same as icloud
  127.     trigger:
  128.       platform: state
  129.       entity_id: group.sharonhelper
  130.     condition:
  131.       condition: template
  132.       value_template: "{{ states.group.sharonhelper.state == states.device_tracker.iphonevansharon.state }}"
  133.     action:
  134.       - service: device_tracker.icloud_set_interval
  135.         data:
  136.           account_name: sharon
  137.           device_name: iphonevansharon
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement