domoticz / domoticz-android

Domoticz Client Application for Android Devices
104 stars 71 forks source link

Graph for Utility Sensors is not works #425

Closed szczukot closed 6 years ago

szczukot commented 7 years ago

I have many utility sensor (Type General, Subtype Alert). In application, when I click graph (day, etc) is nothing happend.

F43RY commented 7 years ago

Same here.

JoostvdB94 commented 7 years ago

I have this same problem. I think this is the primary reason not to buy the premium version for me.

F43RY commented 7 years ago

For me 2. I installed lite versione for test but after these issues I don't thing to buy pro version... :-/

F43RY commented 7 years ago

For me 2. I installed lite versione for test but after these issues I don't thing to buy pro version... :-/

galadril commented 7 years ago

What utility is not working?? Can you give the full json spec of the device? and what json url does the web ui do to get the graph data?

F43RY commented 7 years ago

Specs of jsons are here: https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s Swnsors I cant get working are Voltage (7.18) and Alert (7.20). Both not working graph from android app and correct work from web interface.

szczukot commented 7 years ago

I have this same problem :) With Alerts and Voltage.

JoostvdB94 commented 7 years ago

I have this issue with a custom device I created that displays my internet information (up,down, ping)

F43RY commented 7 years ago

Custom device doesn't work for me neither. I created an autonomy battery discharging time with minutes in Y.

galadril commented 7 years ago

Sorry graphs are not that easy for me...

Please give me the next information:

Open Firefox with firebug opened (f12 on firefox), open the Console tab 1) Login to your domoticz web system 2) Go to >http://domoticzurl:port/json.htm?type=devices&filter=utility&used=true&order=[Order]&plan=0 3) Give me the json part of the device that's not working (see example below) 4) Go to the graph page that's not working, and check the Console tab of firebug.. 5) I need the json url that that page is using, like: http://domoticzurl:port/json.htm?type=graph&sensor=counter&method=1&idx=58&range=day (i need to know what sensor type it's using to get the graph data) 6) I then need the json result on that graph url, (see example below) http://domoticzurl:port/json.htm?type=graph&sensor=counter&method=1&idx=58&range=day

Example device json

{ "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "CustomImage" : 0, "Data" : "21.0", "Description" : "", "Favorite" : 0, "HardwareID" : 10, "HardwareName" : "Dummy", "HardwareType" : "Dummy (Does nothing, use for virtual switches only)", "HardwareTypeVal" : 15, "HaveTimeout" : true, "ID" : "001411B", "LastUpdate" : "2017-08-12 18:38:07", "Name" : "ThermostaatTest", "Notifications" : "false", "PlanID" : "0", "PlanIDs" : [ 0 ], "Protected" : false, "SetPoint" : "21.0", "ShowNotifications" : true, "SignalLevel" : "-", "SubType" : "SetPoint", "Timers" : "false", "Type" : "Thermostat", "TypeImg" : "override_mini", "Unit" : 1, "Used" : 1, "XOffset" : "0", "YOffset" : "0", "idx" : "204" }

Example graph data

{ "ValueQuantity" : "", "ValueUnits" : "", "counter" : "14192.000", "result" : [ { "c" : "4918.000", "d" : "2016-11-08", "v" : "2.000" }, { "c" : "4920.000", "d" : "2016-11-09", "v" : "1.000" }, { "c" : "4921.000", "d" : "2016-11-10", "v" : "0.000" }, { "c" : "4921.000", "d" : "2016-11-11", "v" : "7.000" }, { "c" : "4928.000", "d" : "2016-11-12", "v" : "3.000" },

galadril commented 7 years ago

https://github.com/domoticz/domoticz-android/wiki/Graph-information

F43RY commented 7 years ago

Ok, now I'm away for a couple of days (only android app available). I'll send you such details as soon as I'm going back home.

szczukot commented 7 years ago

Ad 2. for Alert type { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "CustomImage" : 0, "Data" : "1", "Description" : "", "Favorite" : 0, "HardwareID" : 3, "HardwareName" : "Integra", "HardwareType" : "Satel Integra via LAN interface", "HardwareTypeVal" : 58, "HaveTimeout" : false, "ID" : "41", "LastUpdate" : "2017-08-31 10:53:49", "Level" : 1, "Name" : "Zone:Altanka", "Notifications" : "false", "PlanID" : "7", "PlanIDs" : [ 7 ], "Protected" : false, "ShowNotifications" : true, "SignalLevel" : "-", "SubType" : "Alert", "Timers" : "false", "Type" : "General", "TypeImg" : "Alert", "Unit" : 1, "Used" : 1, "XOffset" : "51", "YOffset" : "0", "idx" : "85" },

And this is not graph on www. I see list of alerts only. Ad 5 /json.htm?type=textlog&idx=85

Ad 6 { "result" : [ { "Data" : "1", "Date" : "2017-08-16 10:28:01", "idx" : "669649" }, ........... { "Data" : "3", "Date" : "2017-06-03 13:25:29", "idx" : "512128" } ], "status" : "OK", "title" : "TextLog" }

szczukot commented 7 years ago

Ad 2. For Voltage type { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "CustomImage" : 0, "Data" : "1174 mV", "Description" : "", "Favorite" : 0, "HardwareID" : 2, "HardwareName" : "1wire", "HardwareType" : "1-Wire (System)", "HardwareTypeVal" : 12, "HaveTimeout" : false, "ID" : "0001", "LastUpdate" : "2017-09-01 10:08:44", "Name" : "nasłonecznienie", "Notifications" : "false", "PlanID" : "0", "PlanIDs" : [ 0 ], "Protected" : false, "ShowNotifications" : true, "SignalLevel" : "-", "SubType" : "Voltage", "Timers" : "false", "Type" : "RFXSensor", "TypeImg" : "current", "Unit" : 0, "Used" : 1, "XOffset" : "0", "YOffset" : "0", "idx" : "128" },

Ad 5 /json.htm?type=graph&sensor=counter&idx=128&range=day

Ad 6 { "result" : [ { "d" : "2017-08-31 10:15", "v" : "1174" }, ......................., { "d" : "2017-09-01 10:15", "v" : "1250" } ], "status" : "OK", "title" : "Graph counter day" }

galadril commented 7 years ago

@szczukot
Think i've fixed the graph for Voltage in the next beta... (can't test it ..)

galadril commented 7 years ago

Also Lux graphs (value, min, max and avg) are added in the next version

szczukot commented 7 years ago

Ok. I will test it. What with Alert Devices ?

F43RY commented 7 years ago

Hi, I'd like to test latest changes. When the update will became available in google paly store?

galadril commented 7 years ago

I've fixed the voltage and lux graph, that should already be in the store

szczukot commented 7 years ago

I don't have new version.

F43RY commented 7 years ago

Me neither. Istill have the same version 0.1.413(3272)

galadril commented 7 years ago

sry.. new version coming today

szczukot commented 7 years ago

In the newest version Voltage graph works. Alert still not.

galadril commented 7 years ago

that's not that easy.. because i assume there there are graph data.. not log texts..

szczukot commented 7 years ago

Is it not this same type of log, as on switches ?

F43RY commented 7 years ago

Updated. Thanx. Percentage is now working but "alert" and "custom sensor" still not. I set custom sensor as battery discharging time of my UPS battery. I'd see minutes of battery life when AC mains miss.

galadril commented 6 years ago

i fixed the graph for barometers in the next release

szczukot commented 6 years ago

But "Alert" still not works :(

galadril commented 6 years ago

I added the log button for Alerts in the next release