Im Space Bot
Aus /dev/tal
Version vom 19. August 2025, 14:44 Uhr von Thoto (Diskussion | Beiträge)
| Space-Status Release status: stable [box doku] | |
|---|---|
| Description | Info/API ob der Raum aktuell geöffnet ist |
| Author(s) | thoto |
| Last Version | 201708-2 (201708-2) |
| Platform | Linux/Shellskript/PHP |
| License | GPLv3 |
| Download | https://github.com/devtal-de/statespace |
Funktionsweise
Das Serviceding (bis 2017-07-22 das Nagios) prüft via Cron-Job ob der ZyXEL-Switch im /dev/tal eingeschaltet ist (ehemals Portstatus an übergeordnetem Switch via SNMP, seit 2016 via ICMP-Ping) und aktualisiert den Status auf moon.devtal.de.
API
Zur Abfrage sollte aktuell die URL https://devtal.de/~thoto/statespace/state.php verwendet werden. Es wird "closed" oder "open" zurückgeliefert. Sollte sich die API ändern, wird es kurzzeitig etwas anderes liefern.
Home-Assistant
Konfiguration als Binary Sensor:
rest:
- resource: https://devtal.de/~thoto/statespace/state.php
scan_interval: 360
binary_sensor:
name: space_status
value_template: "{{ value == 'open' }}"
availability: "{{ value in ('open', 'closed') }}"