forked from matt8707/hass-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secrets_redacted.yaml
152 lines (137 loc) · 7.31 KB
/
secrets_redacted.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
homeassistant_latitude: REDACTED
homeassistant_longitude: REDACTED
homeassistant_elevation: REDACTED
recorder_db_url: mysql://homeassistant:REDACTED/homeassistant?charset=utf8mb4
nas_host: REDACTED
#philhawthorne/ha-dockermon
restart_container: curl http://REDACTED/container/home-assistant/restart
#plex
plex_token: REDACTED
plex_port: REDACTED
#imac
imac_wol_mac: REDACTED
imac_wol_host: REDACTED
imac_off: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "tell app \"System Events\" to shut down" 2>/dev/null'
imac_sleep: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "tell app \"System Events\" to sleep" 2>/dev/null'
imac_restart: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "tell app \"System Events\" to restart" 2>/dev/null'
imac_cpu: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED top -l 1 | awk '/CPU usage/ {print $7}' 2>/dev/null
imac_mem: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED ps -A -o %mem | awk '{ mem += $1} END {print mem}' 2>/dev/null
imac_uptime: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED sysctl -n kern.boottime | awk '{print $4}' 2>/dev/null
imac_ip: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED curl icanhazip.com || echo 0
#monitors
monitors_mute_on: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "set volume with output muted" 2>/dev/null'
monitors_mute_off: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "set volume without output muted" 2>/dev/null'
monitors_mute_state: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "output muted of (get volume settings)"' || echo false
monitors_volume_slider: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "set volume output volume {{ states('input_number.monitors_volume') | int }} --100%" 2>/dev/null'
monitors_update_volume: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "output volume of (get volume settings)"' || echo 0
monitors_calibrate_monitors: |-
ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED osascript <<EOF
tell application "System Events"
click menu bar item 1 of menu bar 2 of application process "SoundID Reference"
click menu item "KRK (28 Sep)" of menu 1 of menu bar 2 of application process "SoundID Reference"
end tell
EOF
monitors_calibrate_headphones: |-
ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED osascript <<EOF
tell application "System Events"
click menu bar item 1 of menu bar 2 of application process "SoundID Reference"
click menu item "Beyerdynamic DT 990 Pro 250 Ohm Wired Av..." of menu 1 of menu bar 2 of application process "SoundID Reference"
end tell
EOF
#ps5
playstation_5_ip: REDACTED
playstation_5_wake: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'docker exec playactor sh -c "playactor wake --host-name PS5-635" 2>/dev/null'
playstation_5_sleep: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'docker exec playactor sh -c "playactor standby --host-name PS5-635" 2>/dev/null'
#vacuum
xiaomi_vacuum_host: REDACTED
xiaomi_vacuum_token: REDACTED
xiaomi_cloud_username: REDACTED
xiaomi_cloud_password: REDACTED
#rpi
rpi_poweroff: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED sudo shutdown -h now 2>/dev/null
rpi_reboot: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED sudo reboot 2>/dev/null
rpi_led_off: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED "sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness' && sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness'"
rpi_cpu: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED top -bn 1 | grep "Cpu(s)" | awk '{print 100 - $8}' 2>/dev/null
rpi_mem: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED free | grep Mem | awk '{print $3 / $2 * 100}' 2>/dev/null
rpi_sd: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED df / | awk '{print $5}' | tail -n 1 2>/dev/null
rpi_uptime: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED uptime -s 2>/dev/null
rpi_ping_host: REDACTED
rpi_monitor_docker_url: tcp://REDACTED
#unifi
unifi_poweroff: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED poweroff
unifi_reboot: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED reboot
unifi_ip: REDACTED
unifi_port: REDACTED
unifi_user: REDACTED
unifi_pass: REDACTED
#github
github_username: REDACTED
github_access_token: REDACTED
#updates
updates_kemper: |-
ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED /opt/homebrew/bin/python3 GitHub/kemper-version/kemper-version.py || \
echo '{"profiler_latest": "", "profiler_installed": "", "rigmanager_latest": "", "rigmanager_installed": ""}'
updates_playactor_installed: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'docker exec playactor sh -c "playactor about" 2>/dev/null'
#switchbot
switchbot_mqtt_command: homeassistant/switch/switchbot/REDACTED/set
switchbot_mqtt_state: homeassistant/switch/switchbot/REDACTED/state
switchbot_mqtt_battery: homeassistant/switch/switchbot/REDACTED/battery-percentage
# youtube_token: abc
# apexcharts_tibber: abc
# apexcharts_influx: abc
# apexcharts_github: abc
youtube_token: REDACTED
apexcharts_influx: |-
let params = new URLSearchParams({
db: "home_assistant",
q: "SELECT value FROM kg WHERE entity_id = 'mattias_weight'"
}),
request = async () => {
let a = [],
r = await fetch("REDACTED/query?" + params),
j = await r.json();
for (let r of j.results[0].series[0].values) a.push([new Date(r[0]), r[1]]);
return a
};
return request()
apexcharts_tibber: |-
let array = [],
request = async () => {
let request = await fetch("https://api.tibber.com/v1-beta/gql", {
method: "POST",
headers: {
Authorization: "Bearer REDACTED",
"Content-Type": "application/json"
},
body: JSON.stringify({
query: "{viewer{homes{consumption(resolution: MONTHLY, last: 12){nodes{from consumption}}}}}"
})
}),
json = await request.json();
for (let request of json.data.viewer.homes[0].consumption.nodes) array.push([new Date(request.from), request.consumption]);
return array
};
return request()
apexcharts_github: |-
let stargazers_total = [],
auth = {
headers: new Headers({
accept: "application/vnd.github.v3.star+json",
Authorization: "token REDACTED"
})
},
response = await fetch("https://api.github.com/repos/matt8707/hass-config", auth),
data = await response.json();
stargazers_total.push(data.stargazers_count);
let apex_arr = [],
stargazer_count = 0,
totalPages = Math.ceil(stargazers_total[0] / 100);
for (var i = 1; i <= totalPages; i++) {
let data = await fetch(`https://api.github.com/repos/matt8707/hass-config/stargazers?per_page=100&page=${i}`, auth);
(await data.json()).forEach(data => {
Object.entries(data).forEach(([key, value]) => {
key === "starred_at" && (stargazer_count++, apex_arr.push([new Date(value), stargazer_count]))
})
})
}
return apex_arr;