|
| 1 | +homeassistant_latitude: REDACTED |
| 2 | +homeassistant_longitude: REDACTED |
| 3 | +homeassistant_elevation: REDACTED |
| 4 | + |
| 5 | +recorder_db_url: mysql://homeassistant:REDACTED/homeassistant?charset=utf8mb4 |
| 6 | +nas_host: REDACTED |
| 7 | + |
| 8 | +#philhawthorne/ha-dockermon |
| 9 | +restart_container: curl http://REDACTED/container/home-assistant/restart |
| 10 | + |
| 11 | +#plex |
| 12 | +plex_token: REDACTED |
| 13 | +plex_port: REDACTED |
| 14 | + |
| 15 | +#imac |
| 16 | +imac_wol_mac: REDACTED |
| 17 | +imac_wol_host: REDACTED |
| 18 | +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' |
| 19 | +imac_sleep: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "tell app \"System Events\" to sleep" 2>/dev/null' |
| 20 | +imac_restart: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "tell app \"System Events\" to restart" 2>/dev/null' |
| 21 | +imac_cpu: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED top -l 1 | awk '/CPU usage/ {print $7}' 2>/dev/null |
| 22 | +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 |
| 23 | +imac_uptime: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED sysctl -n kern.boottime | awk '{print $4}' 2>/dev/null |
| 24 | +imac_ip: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED curl icanhazip.com || echo 0 |
| 25 | + |
| 26 | +#monitors |
| 27 | +monitors_mute_on: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "set volume with output muted" 2>/dev/null' |
| 28 | +monitors_mute_off: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "set volume without output muted" 2>/dev/null' |
| 29 | +monitors_mute_state: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "output muted of (get volume settings)"' || echo false |
| 30 | +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' |
| 31 | +monitors_update_volume: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'osascript -e "output volume of (get volume settings)"' || echo 0 |
| 32 | +monitors_calibrate_monitors: |- |
| 33 | + ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED osascript <<EOF |
| 34 | + tell application "System Events" |
| 35 | + click menu bar item 1 of menu bar 2 of application process "SoundID Reference" |
| 36 | + click menu item "KRK (28 Sep)" of menu 1 of menu bar 2 of application process "SoundID Reference" |
| 37 | + end tell |
| 38 | + EOF |
| 39 | +monitors_calibrate_headphones: |- |
| 40 | + ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED osascript <<EOF |
| 41 | + tell application "System Events" |
| 42 | + click menu bar item 1 of menu bar 2 of application process "SoundID Reference" |
| 43 | + click menu item "Beyerdynamic DT 990 Pro 250 Ohm Wired Av..." of menu 1 of menu bar 2 of application process "SoundID Reference" |
| 44 | + end tell |
| 45 | + EOF |
| 46 | +
|
| 47 | +#ps5 |
| 48 | +playstation_5_ip: REDACTED |
| 49 | +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' |
| 50 | +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' |
| 51 | + |
| 52 | +#vacuum |
| 53 | +xiaomi_vacuum_host: REDACTED |
| 54 | +xiaomi_vacuum_token: REDACTED |
| 55 | +xiaomi_cloud_username: REDACTED |
| 56 | +xiaomi_cloud_password: REDACTED |
| 57 | + |
| 58 | +#rpi |
| 59 | +rpi_poweroff: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED sudo shutdown -h now 2>/dev/null |
| 60 | +rpi_reboot: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED sudo reboot 2>/dev/null |
| 61 | +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'" |
| 62 | +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 |
| 63 | +rpi_mem: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED free | grep Mem | awk '{print $3 / $2 * 100}' 2>/dev/null |
| 64 | +rpi_sd: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED df / | awk '{print $5}' | tail -n 1 2>/dev/null |
| 65 | +rpi_uptime: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED uptime -s 2>/dev/null |
| 66 | +rpi_ping_host: REDACTED |
| 67 | +rpi_monitor_docker_url: tcp://REDACTED |
| 68 | + |
| 69 | +#unifi |
| 70 | +unifi_poweroff: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED poweroff |
| 71 | +unifi_reboot: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED reboot |
| 72 | +unifi_ip: REDACTED |
| 73 | +unifi_port: REDACTED |
| 74 | +unifi_user: REDACTED |
| 75 | +unifi_pass: REDACTED |
| 76 | + |
| 77 | +#github |
| 78 | +github_username: REDACTED |
| 79 | +github_access_token: REDACTED |
| 80 | + |
| 81 | +#updates |
| 82 | +updates_kemper: |- |
| 83 | + ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED /opt/homebrew/bin/python3 GitHub/kemper-version/kemper-version.py || \ |
| 84 | + echo '{"profiler_latest": "", "profiler_installed": "", "rigmanager_latest": "", "rigmanager_installed": ""}' |
| 85 | +updates_playactor_installed: ssh -q -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa REDACTED 'docker exec playactor sh -c "playactor about" 2>/dev/null' |
| 86 | + |
| 87 | +#switchbot |
| 88 | +switchbot_mqtt_command: homeassistant/switch/switchbot/REDACTED/set |
| 89 | +switchbot_mqtt_state: homeassistant/switch/switchbot/REDACTED/state |
| 90 | +switchbot_mqtt_battery: homeassistant/switch/switchbot/REDACTED/battery-percentage |
| 91 | + |
| 92 | +# youtube_token: abc |
| 93 | +# apexcharts_tibber: abc |
| 94 | +# apexcharts_influx: abc |
| 95 | +# apexcharts_github: abc |
| 96 | + |
| 97 | +youtube_token: REDACTED |
| 98 | +apexcharts_influx: |- |
| 99 | + let params = new URLSearchParams({ |
| 100 | + db: "home_assistant", |
| 101 | + q: "SELECT value FROM kg WHERE entity_id = 'mattias_weight'" |
| 102 | + }), |
| 103 | + request = async () => { |
| 104 | + let a = [], |
| 105 | + r = await fetch("REDACTED/query?" + params), |
| 106 | + j = await r.json(); |
| 107 | + for (let r of j.results[0].series[0].values) a.push([new Date(r[0]), r[1]]); |
| 108 | + return a |
| 109 | + }; |
| 110 | + return request() |
| 111 | +apexcharts_tibber: |- |
| 112 | + let array = [], |
| 113 | + request = async () => { |
| 114 | + let request = await fetch("https://api.tibber.com/v1-beta/gql", { |
| 115 | + method: "POST", |
| 116 | + headers: { |
| 117 | + Authorization: "Bearer REDACTED", |
| 118 | + "Content-Type": "application/json" |
| 119 | + }, |
| 120 | + body: JSON.stringify({ |
| 121 | + query: "{viewer{homes{consumption(resolution: MONTHLY, last: 12){nodes{from consumption}}}}}" |
| 122 | + }) |
| 123 | + }), |
| 124 | + json = await request.json(); |
| 125 | + for (let request of json.data.viewer.homes[0].consumption.nodes) array.push([new Date(request.from), request.consumption]); |
| 126 | + return array |
| 127 | + }; |
| 128 | + return request() |
| 129 | +apexcharts_github: |- |
| 130 | + let stargazers_total = [], |
| 131 | + auth = { |
| 132 | + headers: new Headers({ |
| 133 | + accept: "application/vnd.github.v3.star+json", |
| 134 | + Authorization: "token REDACTED" |
| 135 | + }) |
| 136 | + }, |
| 137 | + response = await fetch("https://api.github.com/repos/matt8707/hass-config", auth), |
| 138 | + data = await response.json(); |
| 139 | + stargazers_total.push(data.stargazers_count); |
| 140 | +
|
| 141 | + let apex_arr = [], |
| 142 | + stargazer_count = 0, |
| 143 | + totalPages = Math.ceil(stargazers_total[0] / 100); |
| 144 | + for (var i = 1; i <= totalPages; i++) { |
| 145 | + let data = await fetch(`https://api.github.com/repos/matt8707/hass-config/stargazers?per_page=100&page=${i}`, auth); |
| 146 | + (await data.json()).forEach(data => { |
| 147 | + Object.entries(data).forEach(([key, value]) => { |
| 148 | + key === "starred_at" && (stargazer_count++, apex_arr.push([new Date(value), stargazer_count])) |
| 149 | + }) |
| 150 | + }) |
| 151 | + } |
| 152 | + return apex_arr; |
0 commit comments