-
Notifications
You must be signed in to change notification settings - Fork 42
/
hass-sample.yaml
116 lines (112 loc) · 3.42 KB
/
hass-sample.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# replace the string kjetilsv with your topic defined in the mqtt client
camera:
- platform: mqtt
topic: kjetilsv/mqttcamera
name: kjetilsv
switch:
#power options
- platform: mqtt
name: "Kjetilsvhibernate"
command_topic: "kjetilsv/hibernate"
payload_on: "1"
optimistic: false
- platform: mqtt
name: "Kjetilsvsuspend"
command_topic: "kjetilsv/suspend"
payload_on: "1"
optimistic: false
- platform: mqtt
name: "Kjetilsvreboot"
command_topic: "kjetilsv/reboot"
payload_on: "1"
optimistic: false
- platform: mqtt
name: "Kjetilsvshutdown"
command_topic: "kjetilsv/shutdown"
payload_on: "1"
optimistic: false
#Lock computer
#add custom command
#topic: "lockcomputer"
#cmdtxt: "rundll32.exe"
#cmdparameters: "user32.dll, LockWorkStation"
#thanks to https://github.com/FatBasta
- platform: mqtt
name: "Kjetilsvlockcomputer"
command_topic: "kjetilsv/lockcomputer"
payload_on: "1"
#Instead of slider/input box i just made three presets low,normal og full(90%)
- platform: mqtt
name: "KjetilsvVolume20"
state_topic: "kjetilsv/volume"
command_topic: "kjetilsv/volume/set"
payload_on: "20"
- platform: mqtt
name: "KjetilsvVolume20"
state_topic: "kjetilsv/volume"
command_topic: "kjetilsv/volume/set"
payload_on: "20"
- platform: mqtt
name: "KjetilsvVolume90"
state_topic: "kjetilsv/volume"
command_topic: "kjetilsv/volume/set"
payload_on: "90"
#commandline scripts
- platform: command_line
switches:
dinner_time:
command_on: '/home/homeassistant/.homeassistant/scripts/dinner.sh'
#dinner.sh
#mosquitto_pub -t kjetilsv/toast -m "Home Assistant,Dinner time!,,c:\temp\dinner.jpg"
#mosquitto_pub -t kjetilsv/tts -m "dinner time,DINNER TIME, D I N N E R TIME"
- platform: command_line
switches:
come_down:
command_on: '/home/homeassistant/.homeassistant/scripts/comedown.sh'
#comedown.sh
#mosquitto_pub -t kjetilsv/toast -m "Home Assistant,kom ned!,,c:\temp\iselin.jpg"
#mosquitto_pub -t kjetilsv/tts -m "NAG NAG NAG"
sensor:
#hardware
- platform: mqtt
state_topic: "kjetilsv/freememory"
name: "Kjetilsv freememory"
- platform: mqtt
state_topic: "kjetilsv/cpuprosessortime"
name: "Kjetilsv Cpu load"
#media
- platform: mqtt
state_topic: "kjetilsv/mute"
name: "Kjetilsv Volume muted"
- platform: mqtt
state_topic: "kjetilsv/volume"
name: "Kjetilsv Volume"
#disk usage
- platform: mqtt
state_topic: "kjetilsv/drive/C/percentfree"
name: 'Kjetilsv C:\ precent free space'
unit_of_measurement: "%"
- platform: mqtt
state_topic: "kjetilsv/drive/D/percentfree"
name: 'Kjetilsv D:\ precent free space'
unit_of_measurement: "%"
- platform: mqtt
state_topic: "kjetilsv/drive/E/percentfree"
name: 'Kjetilsv E:\ precent free space'
unit_of_measurement: "%"
- platform: mqtt
state_topic: "kjetilsv/drive/F/percentfree"
name: 'Kjetilsv F:\ precent free space'
unit_of_measurement: "%"
#usage of the mqtt notification to tts
automation:
- alias: Muted
trigger:
platform: state
entity_id: switch.Kjetilsvmute
to: 'on'
action:
service: mqtt.publish
data_template:
payload: "your audio is muted, so you can hear this"
topic: "kjetilsv/tts"