Compare commits
No commits in common. "master" and "l4d2_the_next" have entirely different histories.
master
...
l4d2_the_n
8 changed files with 7 additions and 60 deletions
|
@ -112,11 +112,6 @@ def process_recording(filename):
|
||||||
|
|
||||||
sample_num += samples_per_block - overlapping_samples
|
sample_num += samples_per_block - overlapping_samples
|
||||||
|
|
||||||
# move to PROCESSED_RECORDINGS_DIR
|
|
||||||
|
|
||||||
os.makedirs(PROCESSED_RECORDINGS_DIR, exist_ok=True)
|
|
||||||
shutil.move(os.path.join(RECORDINGS_DIR, filename), os.path.join(PROCESSED_RECORDINGS_DIR, filename))
|
|
||||||
|
|
||||||
|
|
||||||
# write a spectrogram using the sound from start to end of the event
|
# write a spectrogram using the sound from start to end of the event
|
||||||
def write_event(current_event, soundfile, samplerate):
|
def write_event(current_event, soundfile, samplerate):
|
||||||
|
|
|
@ -19,7 +19,5 @@ do
|
||||||
-t "3600" \
|
-t "3600" \
|
||||||
-c:a flac \
|
-c:a flac \
|
||||||
-compression_level 12 \
|
-compression_level 12 \
|
||||||
"recordings/current/$DATE.flac"
|
"recordings/$DATE.flac"
|
||||||
|
|
||||||
mv "recordings/current/$DATE.flac" "recordings/$DATE.flac"
|
|
||||||
done
|
done
|
||||||
|
|
|
@ -8,7 +8,7 @@ urllib3.disable_warnings()
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
HUE_IP = "${hue_ip}" # replace with your bridge IP
|
HUE_IP = "10.0.0.134" # replace with your bridge IP
|
||||||
HUE_APP_KEY = "${hue_app_key}" # local only
|
HUE_APP_KEY = "${hue_app_key}" # local only
|
||||||
HUE_DEVICE_ID = "31f58786-3242-4e88-b9ce-23f44ba27bbe"
|
HUE_DEVICE_ID = "31f58786-3242-4e88-b9ce-23f44ba27bbe"
|
||||||
TEMPERATURE_LOG_DIR = "/opt/bootshorn/temperatures"
|
TEMPERATURE_LOG_DIR = "/opt/bootshorn/temperatures"
|
||||||
|
|
|
@ -7,15 +7,11 @@ directories = {
|
||||||
'owner': 'ckn',
|
'owner': 'ckn',
|
||||||
'group': 'ckn',
|
'group': 'ckn',
|
||||||
},
|
},
|
||||||
'/opt/bootshorn/temperatures': {
|
|
||||||
'owner': 'ckn',
|
|
||||||
'group': 'ckn',
|
|
||||||
},
|
|
||||||
'/opt/bootshorn/recordings': {
|
'/opt/bootshorn/recordings': {
|
||||||
'owner': 'ckn',
|
'owner': 'ckn',
|
||||||
'group': 'ckn',
|
'group': 'ckn',
|
||||||
},
|
},
|
||||||
'/opt/bootshorn/recordings/current': {
|
'/opt/bootshorn/temperatures': {
|
||||||
'owner': 'ckn',
|
'owner': 'ckn',
|
||||||
'group': 'ckn',
|
'group': 'ckn',
|
||||||
},
|
},
|
||||||
|
@ -38,7 +34,6 @@ files = {
|
||||||
'/opt/bootshorn/temperature': {
|
'/opt/bootshorn/temperature': {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': {
|
'context': {
|
||||||
'hue_ip': repo.get_node('home.hue').hostname,
|
|
||||||
'hue_app_key': repo.vault.decrypt('encrypt$gAAAAABoc2WxZCLbxl-Z4IrSC97CdOeFgBplr9Fp5ujpd0WCCCPNBUY_WquHN86z8hKLq5Y04dwq8TdJW0PMSOSgTFbGgdp_P1q0jOBLEKaW9IIT1YM88h-JYwLf9QGDV_5oEfvnBCtO'),
|
'hue_app_key': repo.vault.decrypt('encrypt$gAAAAABoc2WxZCLbxl-Z4IrSC97CdOeFgBplr9Fp5ujpd0WCCCPNBUY_WquHN86z8hKLq5Y04dwq8TdJW0PMSOSgTFbGgdp_P1q0jOBLEKaW9IIT1YM88h-JYwLf9QGDV_5oEfvnBCtO'),
|
||||||
},
|
},
|
||||||
'owner': 'ckn',
|
'owner': 'ckn',
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
#! /usr/bin/env python3
|
|
||||||
|
|
||||||
import requests
|
|
||||||
from datetime import datetime, timedelta, timezone
|
|
||||||
|
|
||||||
BASE = "https://homeassistant.ckn.li"
|
|
||||||
TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI1YjY0ZWE5N2FiMzM0NTQ0OGMyNjhmZTIxYzAxZTE1MSIsImlhdCI6MTc1NjAzOTAxNCwiZXhwIjoyMDcxMzk5MDE0fQ.X-sQli-NTpCjeXpn19zf-maPRDldkSeTuhKZua1k8uM"
|
|
||||||
ENTITY = "sensor.hue_outdoor_motion_sensor_2_temperature"
|
|
||||||
|
|
||||||
HEADERS = {
|
|
||||||
"Authorization": f"Bearer {TOKEN}",
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
}
|
|
||||||
|
|
||||||
begin = datetime(2025, 7, 1, 0, 0, 0, tzinfo=timezone.utc)
|
|
||||||
current = begin
|
|
||||||
now = datetime.now(timezone.utc)
|
|
||||||
|
|
||||||
while current < now:
|
|
||||||
current += timedelta(hours=1)
|
|
||||||
resp = requests.get(
|
|
||||||
f"{BASE}/api/history/period/{current.isoformat()}",
|
|
||||||
params={
|
|
||||||
"end_time": current.isoformat(),
|
|
||||||
"filter_entity_id": ENTITY
|
|
||||||
},
|
|
||||||
headers=HEADERS,
|
|
||||||
timeout=15,
|
|
||||||
)
|
|
||||||
print(current, resp.json())
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
'hostname': '10.0.0.150',
|
'hostname': '10.0.0.162',
|
||||||
'bundles': [
|
'bundles': [
|
||||||
'bootshorn',
|
'bootshorn',
|
||||||
'systemd',
|
'systemd',
|
||||||
|
@ -7,13 +7,5 @@
|
||||||
],
|
],
|
||||||
'metadata': {
|
'metadata': {
|
||||||
'id': '25c6f3fd-0d32-42c3-aeb3-0147bc3937c7',
|
'id': '25c6f3fd-0d32-42c3-aeb3-0147bc3937c7',
|
||||||
'network': {
|
|
||||||
'internal': {
|
|
||||||
'ipv4': '10.0.0.150/24',
|
|
||||||
'mac': 'd6:d8:61:33:f2:05',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# rsync -avh --progress -e 'ssh -o "StrictHostKeyChecking no"' 10.0.0.150:/opt/bootshorn/recordings /hdd/bootshorn
|
|
||||||
|
|
|
@ -33,9 +33,6 @@
|
||||||
# ssh-ed25519
|
# ssh-ed25519
|
||||||
# AAAAC3NzaC1lZDI1NTE5AAAAIJT9Spe+BYue7iiutl3rSf6PlU6dthHizyK+ZWnLodrA
|
# AAAAC3NzaC1lZDI1NTE5AAAAIJT9Spe+BYue7iiutl3rSf6PlU6dthHizyK+ZWnLodrA
|
||||||
# root@home.server
|
# root@home.server
|
||||||
# - >-
|
|
||||||
# ssh-ed25519
|
|
||||||
# AAAAC3NzaC1lZDI1NTE5AAAAILMVroYmswD4tLk6iH+2tvQiyaMe42yfONDsPDIdFv6I ckn
|
|
||||||
# sftp: true
|
# sftp: true
|
||||||
# compatibility_mode: false
|
# compatibility_mode: false
|
||||||
# allow_agent_forwarding: false
|
# allow_agent_forwarding: false
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
'dummy': True,
|
'dummy': True,
|
||||||
'hostname': '10.0.0.143',
|
'hostname': '10.0.2.100',
|
||||||
'groups': [
|
'groups': [
|
||||||
'home',
|
'home',
|
||||||
],
|
],
|
||||||
|
@ -8,13 +8,13 @@
|
||||||
'id': '87879bc1-130f-4fca-a8d2-e1d93a794df4',
|
'id': '87879bc1-130f-4fca-a8d2-e1d93a794df4',
|
||||||
'network': {
|
'network': {
|
||||||
'internal': {
|
'internal': {
|
||||||
'ipv4': '10.0.0.143/24',
|
'ipv4': '10.0.2.100/24',
|
||||||
'mac': '00:17:88:67:e7:f2',
|
'mac': '00:17:88:67:e7:f2',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'dns': {
|
'dns': {
|
||||||
'hue.ckn.li': {
|
'hue.ckn.li': {
|
||||||
'A': {'10.0.0.143'},
|
'A': {'10.0.2.100'},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue