Im Space Bot: Unterschied zwischen den Versionen
Aus /dev/tal
Thoto (Diskussion | Beiträge) |
|||
| (14 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
| − | = | + | {{ProjektInfoBox |
| + | |name = Space-Status | ||
| + | |status = stable | ||
| + | |image = | ||
| + | |description = Info/API ob der Raum aktuell geöffnet ist | ||
| + | |author = thoto | ||
| + | |username = thoto | ||
| + | |version = 201708-2 | ||
| + | |update = 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 <code>moon.devtal.de</code>. | |
| − | + | ||
| − | == | + | == API == |
| + | Zur Abfrage sollte aktuell die URL <code>https://devtal.de/~thoto/statespace/state.php</code> 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: | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | == | + | <pre> |
| + | 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') }}" | ||
| + | </pre> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
[[Kategorie:Projekt]] | [[Kategorie:Projekt]] | ||
Aktuelle Version vom 19. August 2025, 14:44 Uhr
| 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') }}"