I guess there's probably a number of people here using Prometheus + Grafana to display various metrics for their homes.
Now Prometheus can easily go and grab JSON for metrics, and Domoticz does expose its metrics through the API.
So in theory this should be possible, but has anyone tried it yet? What is the easiest way to do this?
Personally I am particularly interested in energy usage and temperature metrics. And when I try to get the current usage this is what I get.
/json.htm?type=devices&rid=34
Code: Select all
{
"ActTime" : 1517263547,
"ServerTime" : "2018-01-29 22:05:47",
"Sunrise" : "08:01",
"Sunset" : "16:45",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "894.0 Watt",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 7,
"HardwareName" : "CurrentCost",
"HardwareType" : "CurrentCost Meter USB",
"HardwareTypeVal" : 65,
"HaveTimeout" : false,
"ID" : "0000002",
"LastUpdate" : "2018-01-29 22:05:37",
"Name" : "House Power",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Electric",
"Timers" : "false",
"Type" : "Usage",
"TypeImg" : "current",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "34"
}
],
"status" : "OK",
"title" : "Devices"
}
Thanks.