Closed BWibo closed 2 years ago
Hey, thank you for your feedback!
Indeed the implementation is correct but does obviously not provide sufficient feedback... As to why the last POST
did fail.
The STA requires an JSON-Object as unitOfMeasurement
(containing three specific entries) therefore the following snippet does create the Datastream as you tried to achieve:
import stapy as sta
sta.set_api_url("https://top-secret-frost-server.de/v1.1")
iotid_obprop = sta.Post.observed_property("Temperature", "Temperature", "Temperature")
iotid_thing = sta.Post.thing("rpi-new", "Rpi4")
iotid_sensor = sta.Post.sensor("Temperature", "On-Board temperature sensor", "text/html", "https://abc.de")
unit = {
"name": "Degree Celsius",
"symbol": "degC",
"definition": "http://www.qudt.org/qudt/owl/1.0.0/unit/Instances.html#DegreeCelsius"
}
iotid_datastream = sta.Post.datastream(
"Rpi-4 temperature",
"Rpi4 temperature datastream",
unit,
"http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
iotid_thing, iotid_obprop, iotid_sensor
)
For more (advanced) information see the following link
Ah right, I forgot for a moment that UoM is not just a String in STA. Thx.
Hey there, thx for this library, looks promising. I just did some testing and ran into an error when posting a Datastream:
Any idea what I am doing wrong? I tired with setting a dict as
properties
as well.