Martin's corner on the web

Emoncms data on my phone

I wanted to have quick access to certain measurements on my home monitoring system, most important the two hot water tanks (solar and heat pump) temperatures and room temperatures. I could, of course, have my laptop to check these, but not so convenient when I am on the go.

I decided to have this on my phone – I used a neat tool called “Apps Geyser“. It converts any web content into an Android application. The web page that I wanted to convert is the public dashboard for my emoncms installation. Creating the application was fast and easy – just as advertised. In 5 minutes I had an application on my phone’s desktop that when started visualizes my dashboards. I have a 3G data plan, so I can check some system parameters on the go.

So, with a single click I can see this on my phone:

That’s convenient, but kind of slow – it takes few seconds to load and then uses up 3G traffic to sync live. Also, if left constantly on, the application drains the battery in an hour.. Basically I needed to check couple temperatures, this solution seems like an overkill.

I’d rather have this information as w widget on-screen, so I looked into an application called “Meta Widget” – that can clip web content into dynamic, interactive widgets. Looks exactly what I need. I created a simple dashboard that contains plain data and tried to harvest it with Meta Widget.. but it didn’t work. Maybe because the dashboards are heavily JavaScript dependent. So I ended up creating a small PHP page that would pull the data I am interested in, then I will use Meta Widget to read the data from that PHP page and display on my phone’s screen.

 

<?php

$relative_humidity=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=1");
$outsidetempN=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=2");
$outsidetempS=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=3");
$DaniTemp=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=4");
$LivingTemp=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=5");
$SolarBoilerTemp=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=6");
$HPBoilerTemp=file_get_contents("http://**URL**/feed/value.json?apikey=**key**&id=7");

?>
<!DOCTYPE html PUBLIC
  "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Emoncms data</title>
  </head>
  <body>

<table>
<tr><td>Relative humidity:<?php echo $relative_humidity; ?>%</td></tr>
<tr><td>Outside t North side:<?php echo $outsidetempN; ?>C</td></tr>
<tr><td>Outside t South side:<?php echo $outsidetempS; ?>C</td></tr>
<tr><td>Dani room:<?php echo $DaniTemp; ?>C</td></tr>
<tr><td>Living room:<?php echo $LivingTemp; ?>C</td></tr>
<tr><td>Solar boiler:<?php echo $SolarBoilerTemp; ?>C</td></tr>
<tr><td>HP boiler:<?php echo $HPBoilerTemp; ?>C</td></tr>
</table>
</body>
</html>

That allowed me to have this information on my phone’s desktop – you can set it to refresh every few minutes:

I have few more on the next desktop.. quite handy.

3 thoughts on “Emoncms data on my phone

    1. admin Post author

      Thanks for the link, though I needed to be able to monitor this with my phone. I always carry it with me, unlike the laptop.

  1. Manuel

    Wow very nice, that´s what i´m looking for. Is there a tutorial how to get this PHP page on my mobile ?
    I´m not very familiar with PHP. Maybe you could help me…