Jump to content

Openhab formating bug?


xsherlock

Recommended Posts

Not sure if that is a bug or a feature? :)

 

I define Temp sensor wit default xx.y precision.

 

Number GF_Living_Temperature "Temperature [%.1f C]" <temperature> (GF_Living) {tinkerforge="uid=qnM"}

 

I would expect that when acccessing those from the Rest interface it will be already rounded  but it is not.

 

<item>

<type>NumberItem</type>

<name>GF_Living_Temperature</name>

<state>26.68</state>

<link>

 

Is that intended?

 

Maciej

Link zu diesem Kommentar
Share on other sites

Hi Maciej,

 

I'm the developer of the openHAB Tinkerforge binding. Unfortunately I'm not familiar with the REST interface. I think this question is not TF specific but a general openHAB REST interface question. Therefore your chance to get a good answer is better if you ask the openHAB community at https://community.openhab.org

 

Regards,

Theo

Link zu diesem Kommentar
Share on other sites

The rest interface is available over http://xxx.xxx.xxx.xx:8080/rest/items

It give you back state of all the items in XML. it is an integral part of openhab.

 

So is that true that a your binding is not looking at all at the sensor state formatting parameters in the .items file and just passes to openhab full precision?  is that with all the other bindings?

 

Fixing that afterwards in the openhab is quite a pain as requires creating a rule executing on every update.

 

Would you consider adding a parameter to binding in order to to return rounded result? This sensor has so much jitter that last digit is meaningless anyway.

 

I would also "fix" the current/voltage binding to give an option to return, voltage/current/power in V/A/W with definded precision and not the millis.

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...