-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A way to retrieve the total ON/OFF time of an outlet? #34
Comments
This should be possible with Here is the JSON for the graph
```
{
"id": 19,
"gridPos": {
"x": 0,
"y": 0,
"w": 8,
"h": 8
},
"type": "gauge",
"title": "Panel Title",
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "3ad6c16d-4ef5-409b-a6dd-10ae8f486d7d"
},
"editorMode": "code",
"expr": "sum_over_time (homebridge_outlet_on[$__range])",
"legendFormat": "{{name}}",
"range": true
}
],
"options": {
"reduceOptions": {
"values": false,
"calcs": [
"lastNotNull"
],
"fields": ""
},
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": false
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "blue",
"value": null
},
{
"value": 50,
"color": "#EAB839"
}
]
},
"color": {
"mode": "thresholds"
},
"unit": "m"
},
"overrides": []
},
"datasource": {
"uid": "3ad6c16d-4ef5-409b-a6dd-10ae8f486d7d",
"type": "prometheus"
},
"pluginVersion": "9.2.5"
}
```
|
Thanks for the quick reply but... uh, I don't have the I'm using the last release: homebridge-prometheus-exporter v0.0.14 and my outlets are from Meross. Edit: here are all the metrics from your the exporter:
|
Well, same there, try |
Okay thanks, this worked: Anyway unfortunately for me it doesn't work in a very reliable way because almost all my outlets look like ON/1, because when the watt consumption is above 0, they appears like ON, also if they're in standby. For some appliances, like the microwave or TV, they figure alway ON because during the standby the power consumption is 3-4W. So I have to insert also a query that exclude the outlets with less than 3W of consumption. If you have any suggestion I would be thankful :) |
You could maybe do something like Closing this issue now as it’s more of a prometheus query question for which there are better resources. |
Hi and thanks a lot for this plugin. It's fabulous, I hope it will be keep alive and improved, I just built some of my stat panels (see screenshot), but I was wondering: is there a way to build a panel with the total time of an outlet when is ON?
Probably it would be just a workaround like divide the time by the number of entries etc... but I'm struggling to figure out the correct way, because the exporter use only the 1-0 status but not the timestamp, maybe is possible to implement it? Or any other way to retrieve the same result?
Thanks!
The text was updated successfully, but these errors were encountered: