Android Flukso Viz alpha release.

http://dl.dropbox.com/u/11717494/FluksoViz.apk
This will install a Flukso Viz app.

This is an absolute work in progress, with plenty of bugs but I look for a volunteer to test it.

Should work with 3 phase Flukso setup. Will crash with 1 phase setup or lack of IP on the device (no wifi) Only tested on 480x800 resolution, and android 2.2 tablet. Month data is not displayed as I only own a flukso for 2 weeks and it didn't gather enough data to let me debug it.

Implemented features are:
-taping a realtime graph will change amount of the details displayed
-taping the large readout will enter the DeltaMode. Takes a total usage in the last second and subtracts it from. Useful for checking power of a particular light or device.
-The Today/Week table is self explanatory and the percentage sign on the end is a difference to the day/week before.
-For Today power consumed you might see a large number (that might change quickly) just past midnight as this is 24h power use extrapolated value based on the average power from midnight till now.

Screenshot. http://dl.dropbox.com/u/11717494/fluksoviz%20alpha.PNG

Sample installation video: http://www.youtube.com/watch?v=0FPnJHUa3QQ&feature=youtu.be

Source code released under GPLv3: https://dl.dropbox.com/u/11717494/FluksoViz.rar

sherlock's picture

API is the interface in the device that lets me read values directly from the device. If your device is latest v2 then it is ok.

As for the IP address check again in the flukso, connect over the ethernet cable and see in the network page What IP it got from the DHCP server of your Wifi network.
Verify if the ip is correct with the ping from windows/mac PC.

C:\Users\sherlock>ping 172.16.1.21
Pinging 172.16.1.21 with 32 bytes of data:
Reply from 172.16.1.21: bytes=32 time=15ms TTL=64
Reply from 172.16.1.21: bytes=32 time=20ms TTL=64

As for your setup with 2 sensors that are separate, FluksoViz will be only able to display an upper graph, and the large readout will show a SUM of 2 clamps.

In the meantime I uploaded a new version that display network test results screenshot http://dl.dropbox.com/u/11717494/flukso_network_checks.PNG and pauses so the user can make a decision. For your setup. you need first to disable the 3rd sensor in preferences and then run it with only one thread (just local) The second thread for the lower graph is still TODO for the setups other then 3 clamps. will crash with 1 or 2 clamps only

Other new features in this version are:
-monthly use dispaly is calculated corectly and displayed
-apart form day/week/month use in kwh also average W is displayed in smaller font below.

here is new sreenshot http://dl.dropbox.com/u/11717494/fluksoviz%20alpha.PNG (you can see the bathroom floor heating working all night long 20 min on 20 min off)

and the app itself at http://dl.dropbox.com/u/11717494/LoopExample.apk

wkraaij's picture

Hi,

I cannot download this new version, has it been removed?

sherlock's picture

no it is there, a second ago i downloaded it from the public dropbox link. i can email you an apk if you wish.

buzzw's picture

The regular version is available, the test version in not available.

buzzw's picture

I did test the new version. It does not crash anymore, I filled in my sensor #1 API key and token. Now there is a popup:

Network check results:
Wifi or Networking enabled
Local Flukso 192.168.1.106 reachable
Sensor 1 local api key wrong
java.lang.NumberFormatException:
unable to parse 'realtime(1326055469' as integer

sherlock's picture

The test vesion is not nesssesary anymore as the new wersion now have network checks (the popup) that in case of failure, allow you to go to preferences and fix the settings.

Now on your setup and error code. WOW. No idea where that come from, but lets try to trouble shoot.
1)What locale (language) is your device set to? that could be a date format or decimal point issue? (not sure those problems show up on the android)
2)what is your sensor key? does it contains any special chars? are you sure you retyped it correctly?

buzzw's picture

1) My device is running the Dutch locale

2) Since I was not sure which key should be filled in where, I exchanged both keys. Now the app says "sensor 1 local api key wrong \\ java.io.IOException: Not Found

Could you explain how the tokens in the admin interface: https://www.flukso.net/user/414/sensors
relate to the tokens of your app? Which token should be filled in first?

sherlock's picture

http://dl.dropbox.com/u/11717494/Capture.PNG

Sensor goes to sensor api key. and Token goes to sensor token.
You need to retype those to match your setup on the flukso website.
Also you need to corectly identify the IP of your flukso as if you are using the Wifi it is then not the standard 192.168.255.1 but some other IP that you have to check either in the Flukso itself or your Wifi router.

sherlock's picture

http://dl.dropbox.com/u/11717494/LoopExample.apk

NEW Release available:
- fixed sensor disabling. now the lower graph can be used with all settings, works well for 1,2 or 3 sensors. So you should be able to launch both treads even if you only have one sensor entered in the preferences.
- fixed formating for smart phones that report 240dpi and therefore use hdpi layout.I do welcome a screen shot from such a device.

Maciej

bazzle's picture

I need help finding the correct ip addy.
Ive plugged into the Flukso box with my laptop and in settings it gives the Network IPV4 as 192.168.255.1.
Sadly the phone says the http addy is incorrect.
Can anyone help please?

Thank you Bazzle

bazzle's picture

Mate :) that did it.
I was using that screen setting number before but it gave me the addy I had on the earlier post. Its now 192.68.0.102
(thinking, it may of changed when icarus remotely updated my software? )

Working with 1 sensor.
Added solar sensor (no 2) but it just added to mains use.
I can use the setting 'Run just local'.
'
It crashes with 'Run both threads'.
Happy so far though, thanks for your help.

Bazzle

sherlock's picture

If your first sensors works in the local, what is the status of the popup window?
Does the server token #1 tests well?

if it does not check the if your phone does have proper internet connection and if the token is well entered. you need to "see" internet and flukso device at the same time to be able to run both treads/graphs

bartvdg's picture

I have the same problem.
I installed the program on a samsung gio (android 2.3.4)

I use sensor 1(mains) and 2(solar).
If i enable both sensors the popup windows says :
sensor 1 local test ok
sensor 2 local test OK
sensor 2 disabled in prefs
sensor 1 remote server api OK
sensor 2 remote server api OK
sensor 3 disabled in prefs.

but Sensor 2 is NOT disabled in prefs

if i tap 'run just local' java.util.nosuch elementException comes on the screen left above 4321w but no powergraph
if i tap 'run both threats' the same message left above and the program crashes.

I i disable sensor 2 i see the powergraph working if i tap 'run just local' , if i tap 'run both threads' the program crashes after 3 seconds.

bazzle's picture

Network check results:
Local Flukso reachable
Sensor 2 disabled in prefs
Sensor 3 disabled in prefs

Sensor 1 local test ok
Sensor 1 Remote Server API OK

Run Just local ... works

Run both threads
Sorry!
The application Flukso Viz (process com.loopExample) has stopped unexpectedly. Please try again.

Im running WiFi at home as my Internet connection.
HTC Wildfire 'S'
Bazzle

buzzw's picture

Hi,

I reversed the keys again and rechecked them. I am back at the previous state where the app says:

Network check results:
Wifi or Networking enabled
Local Flukso 192.168.1.106 reachable
Sensor 1 local api key wrong
java.lang.NumberFormatException:
unable to parse 'realtime(1326055469' as integer

I did look in the flukso syslog (via the web interface). Indeed the webserver does http POST flukso data with result code 200, so this part (including the IP address setting) seems to be fine.

Why does the app need an api key? Is it contacting the www.flukso.net database (using the remote server token?). AFAIK the (local) realtime interface does not require the API token.

mitch2k's picture

When I choose "run both threads" at startup, the program just chrashes. This is on a Samsung Galaxy S2.

sherlock's picture

have you tried to check the language to english?

Even for a local access you need the sensor key as this the only way to identify the sensor, they are not named 1,2,3,4,5 they are identified by the sensor key that is that lonk pseudo random string.

For the access over the internet, from the flukso.net server you need both a sensor key and a token that is like a password to access your sensor data.

Can you post your sensor data here? i'll check if it they do not create some exception.

bazzle's picture

Power
Sensor1
2e14ad29c886465970ebf87dc897fd9e
Token1
5e776001ab637f3013a9b2744e774807

Solar
sensor2
432b9dcaf34fb98f0daf87d3b9307581
Token2
932230593233d910f7bae073d2977b66

Bazzle

WCG_SYD_GHD's picture

I still struggle to get it working on my system. Works ok at office with just one single phase and one Flukso.

At home, where I have 2 Fluksos, one that monitors 3-phase mains power (ie 3 inputs) but listed as ONE sensor only (plus a pulse input for rainwater), and the 2nd Flukso monitoring single phase solar, I have similar symptoms as described above.

I think for the app to be useful beyond the absolute nerds it must pick up the IP and sensor addresses automatically.

Sorry to possibly throw the cat amongst the pigeons: But should a completely different tag be taken by using the API interface to extract this data off the Flukso web server? Just requires login then with normal Flukso account credentials.

bazzle's picture

I like the 'local' app as I don't have active internet on my phone, only wifi to home network .

Bazzle

WCG_SYD_GHD's picture

Bazzle, forgive me if I am missing s.th., but if you have wifi to your home network wouldn't that automatically also give you internet access - and if you chose not to have internet access when outside your home wifi - you are no worse off as the local app would also not work?

bazzle's picture

I guess your right... dont know what I was thinking earlier :(

Bazzle

buzzw's picture

Yes I tried English, but that did not solve my problem..sorry..

My sensor key is e9e7273470214234fa865a045cb60362

But the app is complaining about an invalid API key (the token), which I cannot post on the forum.

sherlock's picture

Api key is sensor not a token!!!!! This might solve your problem. Check the screen shot i posted some few posts earlier how to match the setings properly.

And the second guess if your error is:

Sensor 1 local api key wrong
java.lang.NumberFormatException:
unable to parse 'realtime(1326055469' as integer

Does your sensor/token contains sucha a substring 132...... ?

buzzw's picture

Sherlock, the terminology is a bit confusing. I will refer to sections in the Flukso manual now to avoid confusion:
Section 3.2

.. For extracting information, you can use two types of tokens:
Sensor-level tokenA default token is generated for each sensor providing full read access to the sensor resource.

Account-level token A token is also made available to each account, which you can regard as an API key. This single token allows you to access data of all devices and sensors associated with your account.

The first token (sensor specific) is listed in the left column in the "my account" page on flukso.net, the account level token is listed in the right column.

Your picture: http://dl.dropbox.com/u/11717494/Capture.PNG shows that the first key (sensor level token) should be inserted in FluksoViz preference entry "Sensor #1 API key" and that the second key (account level token) should be inserted in the FluksoViz preference entry "Sensor #1 Token". So the error thrown by FluksoViz deals with the sensor specific token (API key) for the LOCAL JSON/REST api. Maybe the global thread works alright, but I cannot test that. I rechecked the key/token and also checked with English locale, without fixing my problmen. Since I have posted my "API key (i.e. the sensor level token), you can check that it indeed does not contain the string throwing the NumberFormat exception. As a matter of fact, I am using an HTC Desire HD, which has recently been upgraded to the Gingerbread release of Android.

sherlock's picture

yep 99% that is the problem. I coded the software for the stock fluxo v2 that does not return:

realtime(

before the array of actuall data, the way manual describes that.
my flukso returns just the data in the parantese nothing else. I'll try to patch that but it will take a lot of time to debug.

Can you revoke those changes?

buzzw's picture

I re-installed the stock v2 restful script and the app runs like a charm.

I hope you will make the code available at some point, I am interested to develop a plugin for a squeezebox touch, which is always on in our living room, to display real-time power consumption as a screen saver.

Also, would it be possible at some point to account for daytime and night time electricity rates?

sherlock's picture

New version released:
-large internal rewrite and new sensor list box in the preferences, this opens up frame work for new display modes, like 2 sensors separately or 2 sensors with difrence instead of sum. Sugestions needed from solar users.
-found a major uncatched exception when calling the flukso.net eliminated another sure crash at initial sensor checks.
-fixed a bug for a patched fluxos that on local api return results with the "realtime()" as in manual and not just results in [] brackets. Not tested at all.

http://dl.dropbox.com/u/11717494/LoopExample.apk

@buzzw
-Does the squeezebox run android? have not found that info anywhere. It might be cheaper to get a dedicated android tablet to display the data, you can have it for 80-100 USD for lowend and up to 160 for a quite decent one.

-Day and night rates would be quite difficult to do as for the last month data you would need to grab the data for last 2 month with hourly resolution to calculate exact fair. I dont even know if the api server allows that.