Live output app?

Is there an app that can display current/live power readings? I'm not looking for charts, just minimal delay between what's displayed and the actual, live numbers. The delays on the flukso.net and pvoutput.org websites are too long.

Prefer Windows, could live with iPad or iPhone if I had to.

If there's is no such app yet, I would appreciate a pointer to docs for the API.

gebhardm's picture

MQTT client on command line; there is nothing faster - see it as a "retro app" ;-)
How to set such up? See https://www.flukso.net/content/mqtt-mq-telemetry-transport

  • Install a MQTT client on your computer - use for example http://mosquitto.org/download/
  • Having done that, you have a MQTT client, for example mosquitto_sub from mosquitto.org

  • Call your FLM using the command line: mosquitto_sub -h "your FLM's local IP address" -p 1883 -v -t /sensor/# - for example: mosquitto_sub -h 192.168.0.50 -p 1883 -v -t /sensor/#
  • The # denotes a wildcard that will show all your sensors' topics, so gauge and counter on each sensor-ID, -v is used to show which sensor sent what data...
  • Enjoy!

This works independent of the OS you use, but may not be convenient enough for "current generation users"...

tdullers's picture

Better solution IMHO to do it on IPAD/IPHONE -> MQTTInspector
Available in the App store

AceNZ's picture

I installed the MQTT client, and it runs fine.

The format of the output isn't useful for me, though. I'm looking for a way to quickly see, at a glance, what my current power levels are.

AceNZ's picture

I might be able to use a C# MQTT client library of some kind to write a small app for Windows, but without a good sample app, it's going to take longer to understand and implement than I'd like.

Maybe JSON will be easier.

AceNZ's picture

I ended up writing my own WPF app, using the JSON API. That way I can also calculate net power use.

Works great!

Lelek62's picture

Hi AceNZ,

that sounds really interesting. Are you willing to share your app? I am also desparately trying to use the minute tab for realtime power readings but it just doen´t work on any browser or hardware platform.
So I would be really interested in your solution.

Given the your name and your timing are you baed in New Zealand?
Greetings form Southern Germany

Erik

AceNZ's picture

The app is a complete hack, probably not useful to others. I'm including the code below that does most of the work. It uses the Newtonsoft JSON library that's available through NuGet.

The minute tab doesn't work for me, either. I see requests from Firefox in the Fiddler web debugger, but nothing shows up in the browser.

Yes, I'm in New Zealand. I went to Munich a number of times in the 1980s for work -- enjoyed it and other parts of Bavaria very much.

  1. using Newtonsoft.Json;
  2.  
  3. public string host = "http://192.168.1.14:8080/sensor/";
  4.  
  5. private int GetReading(int old, int min, string sensor)
  6. {
  7.     int reading = -1;
  8.     try
  9.     {
  10.         var req = WebRequest.Create(host + sensor + "?version=1.0&interval=minute&unit=watt");
  11.         var resp = req.GetResponse();
  12.         using (var stream = resp.GetResponseStream())
  13.         {
  14.             using (var reader = new StreamReader(stream))
  15.             {
  16.                 string data = reader.ReadToEnd();
  17.                 var wattInfo = JsonConvert.DeserializeObject<List<List<string>>>(data);
  18.                 string val = wattInfo[wattInfo.Count - 1][1];
  19.                 if (val == "nan")
  20.                 {
  21.                     val = wattInfo[wattInfo.Count - 2][1];
  22.                 }
  23.                 reading = int.Parse(val);
  24.                 if (reading < min)
  25.                 {
  26.                     reading = 0;
  27.                 }
  28.                 else
  29.                 {
  30.                     reading -= min;
  31.                 }
  32.             }
  33.         }
  34.     }
  35.     catch (Exception ex)
  36.     {
  37.         // ignore
  38.     }
  39.     return reading == -1 ? old : reading;
  40. }

bazzle's picture

@AceNZ

Can you give a step by step guide on what you did to get this on your iphone/pad please?

AceNZ's picture

@bazzle
Sorry, this is a PC / Windows app (WPF). It might be possible to make it show up on an iPhone/iPad using Remote Desktop, although that still requires a PC somewhere.

I've had it running on my desktop since I finished it, with updates every 5 seconds. Pretty interesting to see various blips through the day for both generation and consumption, within seconds of when they happen.

I've had a Centameter device for years that does something similar, but the wireless interface it uses isn't good enough for it to be located at my workstation, and it just gives a single number, rather than the breakdown and totals I have configured.

Now that I know how the API works and that the data is useful, I may end up adding some charts and/or gauges to the app, to pretty it up a bit.

Lelek62's picture

@AceNZ
Thank you very much for providing your code snippet. I will try to reuse it as soon as I find a bit of time after Christmas.
All the best for the Christmas break and a happy year 2014!

Erik