Translate "XXX" to "0" if numerical value is expectet

2,504 views
Skip to first unread message

Christoph Wempe

unread,
Nov 5, 2012, 11:43:42 AM11/5/12
to ope...@googlegroups.com
I'm reading some values of my fathers photo-voltaic generator.

I'm doing this via HTTP-binding of the web interface.

But when it's dark the web interface shows "XXX" for the current value.
Is there a way to tell openhab to interpret this as "0"?

The monitoring-tool "mrtg" has an option calles "unknown as zero" for cases like this.

Thomas Eichstädt-Engelen

unread,
Nov 5, 2012, 11:45:59 AM11/5/12
to ope...@googlegroups.com
Hi Christoph,

which kind of transformation are you using? When using XSLT you could replace values ...

Regards,

Thomas E.-E.


--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/oUxGcRcpwVcJ.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.

Christoph Wempe

unread,
Nov 5, 2012, 2:20:18 PM11/5/12
to ope...@googlegroups.com
Just HTTP with RegEx:

Number Solar_Aktuell "aktuell [%.1f W]" <firstfloor> (gAttic) { http="<[http://user:password @192.168.0.27/index.fhtml:60000:REGEX(.*?aktuell</td>.*?  (.*?)</td>.*)]" }

Thomas Eichstädt-Engelen

unread,
Nov 5, 2012, 4:20:46 PM11/5/12
to ope...@googlegroups.com
hmmm ... which web interface are you talking about? Classic UI? I am wondering that XXX should because the type is "Number" and "XXX" is no valid Number at all. In that cases "-" should be shown :-/

Could you send some log entries around the State update?


To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/IGwsNuOCBr4J.

Christoph Wempe

unread,
Nov 5, 2012, 4:37:40 PM11/5/12
to ope...@googlegroups.com
Maybe I didn't discribed the problem proper. :)

I meant the web interface of the solar-device.
It shows "XXX".



When opening GreenT (openHAB-web interface) or HABdroid I get this log:
22:30:19.813 ERROR o.o.u.i.i.ItemUIRegistryImpl[:396] - Cannot retrieve item 'Solar_aktuell' for widget org.openhab.model.sitemap.Chart


solar_hm.sitemap
sitemap home label="Solar HM"
{
Frame label="Solar" {
Text item=Solar_aktuell {
Frame {
Text item=Solar_aktuell
Text  item=Solar_Tagesenergie
Text  item=Solar_Gesamt
}
Frame {
Chart item=gSolar_Energie period=d refresh=300000
Chart item=Solar_aktuell period=d refresh=300000
}
}
}
}


Maybe this problem doesn't exist tomorrow after openHAD will get the first valid values for this item.

I think we will wait and see what happens tomorrow. :)

Christoph Wempe

unread,
Nov 6, 2012, 4:33:39 AM11/6/12
to ope...@googlegroups.com
My bad!

I just realized I misspeled the item-name in the sitemap. (case-sensitive: "Solar_aktuell" vs. "Solar_Aktuell")

Everythings works fine now.

Thanks anyway. :)
Reply all
Reply to author
Forward
0 new messages