Page 1 of 1

How to get temperature from thermometer to web page?

Posted: Thu Feb 18, 2016 8:24 am
by Don MC
I'm trying to make my set-top box display temperature on the TV screen. It's just a matter of telling the box to get a value from NetHome and then displaying it. But I don't know how to get it from NetHome. I can type this into my web browser:
http://rasp.berry.ip.address:8020/rest/items/64
and get all sorts of info from that particular thermometer. But I only need the temperature value ("21.5" or whatever it is at the moment).

What do I need to type to get that?

Re: How to get temperature from thermometer to web page?

Posted: Thu Feb 18, 2016 9:29 pm
by stefangsbb
If you create a "TCPCommandPort" with for example port 8007, then you can connect with TCP to that port and send the command:

Code: Select all

get,64,Temperature
then you will get the reply like:

Code: Select all

ok,Temperature,-18%2C0
You will have to parse out the temperature and replace %2C with , but it may still be simpler to do that than to parse the json. I am guessing that the client asking for the value uses some kind of programming language where you can do some processing of the value?

Re: How to get temperature from thermometer to web page?

Posted: Fri Feb 19, 2016 1:41 pm
by Don MC
Thanks.
I'm not sure quite yet how the client works. It's all greek to me. It's an Enigma2 box, with Python on top of a Linux core. The GUI is configured by XML files. An example for displaying the time on the info bar would be:

Code: Select all

<widget source="global.CurrentTime" render="Label" position="825,52" zPosition="1" size="59,20" font="Regular;21" foregroundColor="infobar-frgrnd" backgroundColor="infobar-bkgrnd" transparent="1" noWrap="1" halign="right" valign="top">
<convert type="ClockToText">Format:%H:%M</convert>
</widget>
Maybe that's a bad example. I suppose it can be made to display any text from any source and not necessarily "global.CurrentTime".
I already have NetHome send a message to the box when my sauna is ready (goes above 80°C). This is done by a http request to the box's web interface. It's a built-in feature of Enigma2. The message pops up on the TV screen and disappears after a pre-set timeout, or by clicking OK on the remote.
It would be nice to have the current temperature show on the infobar as well.

Re: How to get temperature from thermometer to web page?

Posted: Sun Mar 20, 2016 8:19 pm
by lassiko
Don MC wrote: It would be nice to have the current temperature show on the infobar as well.
Did you get this working. I am also using enigma2 box and will get a temperature info from sauna but would be nice to see it all the time in infobar.

Thanks

Re: How to get temperature from thermometer to web page?

Posted: Wed Mar 23, 2016 6:10 pm
by Don MC
Sadly not yet. I've been busy lately and learning how to do this doesn't fit my schedule.
Seems though that the infobar skin doesn't directly support fetching any kind of text from another source. If there would be some kind of weather plugin that sits on the infobar and that we could modify to fetch temperarure data from NH.