NEWS
TTN und HTTP Integration Daten an IOBroker senden
-
TTN bietet mir die Möglichkeit via POST und GET Methode Daten an einen Endpunkt zu senden.
Ich würde gerne einen Datenendpunkt mit IOBroker erzeugen.
Habe da zwei Möglichkeiten gesehen: Einmal die Simple API und die socketio Adapter.
Leider weiß ich nicht genau wie ich ein Datenendpunkt erzeuge. Den Port dann nach außen öffnen wäre kein Problem.
Kann mir da jemand weiterhelfen?
Grüße Patrick -
bist Du mit TTN und IoBroker oder Lora irgendwie weitergekommen?
-
@kilasat Nein leider nicht... hatte auch nicht wirklich Zeit.. dafür..
Aber muss es wohl wieder angehen..
Ich würde gerne meine das hier aufrufen:
http://192.168.178.38:8087/setValueFromBody?stateID1.
Aber mir fehlen da ein bisschen die zusammenhänge.
TTN Schreibt folgendes:- You can configure the URL, the HTTP method (e.g. POST) and optionally the HTTP Authorization header of your endpoint but also a custom HTTP header of your choice. The integration will post data in the following format:
{ "app_id": "my-app-id", // Same as in the topic "dev_id": "my-dev-id", // Same as in the topic "hardware_serial": "0102030405060708", // In case of LoRaWAN: the DevEUI "port": 1, // LoRaWAN FPort "counter": 2, // LoRaWAN frame counter "is_retry": false, // Is set to true if this message is a retry (you could also detect this from the counter) "confirmed": false, // Is set to true if this message was a confirmed message "payload_raw": "AQIDBA==", // Base64 encoded payload: [0x01, 0x02, 0x03, 0x04] "payload_fields": {}, // Object containing the results from the payload functions - left out when empty "metadata": { "time": "1970-01-01T00:00:00Z", // Time when the server received the message "frequency": 868.1, // Frequency at which the message was sent "modulation": "LORA", // Modulation that was used - LORA or FSK "data_rate": "SF7BW125", // Data rate that was used - if LORA modulation "bit_rate": 50000, // Bit rate that was used - if FSK modulation "coding_rate": "4/5", // Coding rate that was used "gateways": [ { "gtw_id": "ttn-herengracht-ams", // EUI of the gateway "timestamp": 12345, // Timestamp when the gateway received the message "time": "1970-01-01T00:00:00Z", // Time when the gateway received the message - left out when gateway does not have synchronized time "channel": 0, // Channel where the gateway received the message "rssi": -25, // Signal strength of the received message "snr": 5, // Signal to noise ratio of the received message "rf_chain": 0, // RF chain where the gateway received the message "latitude": 52.1234, // Latitude of the gateway reported in its status updates "longitude": 6.1234, // Longitude of the gateway "altitude": 6 // Altitude of the gateway }, //...more if received by more gateways... ], "latitude": 52.2345, // Latitude of the device "longitude": 6.2345, // Longitude of the device "altitude": 2 // Altitude of the device }, "downlink_url": "https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/my-app-id/my-process-id?key=ttn-account-v2.secret" }
Was muss ich hier als END-POINT URLS eintragen? (klar die IP vom IOBroker (Port muss weitergeleitet werden usw...) aber was kommt dann? Was muss ich im IOBroker anlegen an Objekten States? Nur ein Objekt?