forked from CiquattroFPV/Homeassistant-Example-Config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.yaml
83 lines (70 loc) · 2.46 KB
/
scripts.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
####ALARM ####
####TEST SCRIPTS####
####GLOBAL SCRIPTS####
####TRIGGERED LIGHTS
####NOTIFICATIONS AND ALERTS####
owntracks_update:
alias: Owntracks Update
sequence:
- service: mqtt.publish
data:
topic: "owntracks/Nico/Nico/cmd"
payload_template: '{"_type":"cmd","action":"reportLocation", "batt": %BATT}'
- service: mqtt.publish
data:
topic: "owntracks/mamma/mamma/cmd"
payload_template: '{"_type":"cmd","action":"reportLocation", "batt": %BATT}'
####TELEGRAM
nico_gps_notify_telegram:
alias: Script for Notify Nico's Location on Telegram
sequence:
- service: telegram_bot.send_location
data:
caption: 'Nico location'
target:
- !secret telegram_clientid
- !secret telegram_clientid2
latitude: '{{ states.device_tracker.nico_nico.attributes.latitude|float }}'
longitude: '{{ states.device_tracker.nico_nico.attributes.longitude|float }}'
disable_notification: true
mamma_gps_notify_telegram:
alias: Script for Notify Mom's Location on Telegram
sequence:
- service: telegram_bot.send_location
data:
caption: 'Mom location'
target:
- !secret telegram_clientid
- !secret telegram_clientid2
latitude: '{{ states.device_tracker.mamma_mamma.attributes.latitude|float }}'
longitude: '{{ states.device_tracker.mamma_mamma.attributes.longitude|float }}'
disable_notification: true
####MEDIA####
jarvis_greeting:
alias: Jarvis Greeting
sequence:
- service: tts.google_say
data_template:
entity_id: media_player.kd55xd9305
message: >
{% if now().strftime("%H")|int < 12 %}
Buongiorno da Jarvis.
{% elif now().strftime("%H")|int < 18 %}
Buon Pomeriggio da Jarvis.
{% else %}
Buonasera da Jarvis
{% endif %}
Il tempo è {{states.sensor.owm_condition.state}} e la temperatura è di {{states.sensor.owm_temperature.state}} Centigradi a Roma. Ti auguro una buona giornata.
- service: media_player.turn_off
entity_id: media_player.kd55xd9305
####CAMERA####
camera_snapshot:
alias: Camera Snapshot
sequence:
- service: telegram_bot.send_photo
data:
caption: 'Camera Snapshot'
target:
- !secret telegram_clientid
# - !secret telegram_clientid2
url: !secret foscam_snapshot