Cannot post temp value
Closed this issue · 1 comments
andig commented
I'm trying to post a simple °C value to cosm:
pac.update([eeml.Data("Pi Temp", value=temp, at=datetime.datetime.utcnow(), minValue=0, maxValue=None, unit=eeml.Celsius())])
print(pac.geteeml())
pac.put()
This is the xml- potentially with an encoding issue:
<eeml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.eeml.org/xsd/0.5.1" xsi:schemaLocation="http://www.eeml.org/xsd/0.5.1 http://www.eeml.org/xsd/0.5.1/0.5.1.xsd" version="0.5.1">
<environment>
<location>
<lat>52.28336</lat>
<lon>9.83735</lon>
</location>
<data id="Pi Temp">
<current_value minValue="0" at="2012-12-13T08:45:11.317000">42.5</current_value>
<unit type="derivedSI" symbol="°C">Celsius</unit>
</data>
</environment>
</eeml>
And this is the error raised:
Traceback (most recent call last):
File "C:\data\workspace\RaspberryPi\pitempmon.py", line 21, in <module>
pac.put()
File "C:\Python27\lib\site-packages\python_eeml-2.0.0-py2.7.egg\eeml\datastream.py", line 74, in put
raise CosmError(msg)
eeml.datastream.CosmError: Unprocessable Entity: Stream is invalid
andig commented
My mistake- data id must not contain spaces- sorry.