It would be not much worse than renaming a device I think, depending on which dashboard it is. But Prometheus was really designed to use labels for this purpose.
This document explains why having user-configurable or dynamic metrics names is usually not the best solution.
What dashboards?At first time setup there would be no dashboards?
I am thinking of the name of the device/system (homey), not the metrics names.
Like
homey_device_measure_tilt_relative{device="9babbd…
vs
homey-pro_device_measure_tilt_relative{device="9babbd…
or
homey-1_device_measure_tilt_relative{device="9babbd…
homey-2_device_measure_tilt_relative{device="9babbd…
Where the user may set a name after “homey-” to distingush them easier. And that the user could set it just once.
I thought that using a job name in the prometheus server should separate them, but it does not work. When using job=“homey” in grafana query it also captures job=“homey_pro” into the same graph. Using job=“homey_pro” uses only that one. I guess I could have more distingushed job names and it would work.
I have not tested to add label at the prometheus server.
Had to use instance=“192.x.xip:9114” to make it right.
This is definitely not normal. It will add some CPU load of course but it should be nowhere near a full core. Can you isolate the problem to the CPU load to the Prometheus app?
I recently stumbled across this wonderful app and fell in love with it.
However, I have a few questions.
I can’t seem to find a way to get homey’s own variables (the ones you can create yourself and are listed under logic inside Homey) using this app. Is there any way to get those in addition to the other system resources and device states? If not, could this be added in a future update? It would be very useful, as I use a lot of variables to count flow runs, which can’t really be done with virtual devices as far as I know.
The user presence and away/asleep detection doesn’t quite work like I imagined (maybe this is just a bug) as it only shows one user with an undefined Email field. (under <homey_ip>:9414/metrics) I would guess it should show multiple users with the corresponding Email in that field. I tried just rolling with it and getting all homey_user_present fields, but it still just gets the one. Same goes for the homey_user_asleep field.
The weather information found under insights doesn’t appear under <homey_ip>:9414/metrics, which isn’t a huge problem, but would help with setting up T-Deltas for temperature instead of absolute values (I think this would be practical to get some insight into the effectiveness of cooling and heating devices as well as for finding correlations between open windows and weather, etc.)
I would greatly appreciate some help on this, as it would finally complete my visualization needs,
I can confirm this has stopped working. I know this was working in the earlier 2.0 firmwares so there may have been an API change somewhere along the road. Definitely a bug.
EDIT: Just checked the API and they have removed the email field so there is no longer a possibility to get this info. Will need to use the name of the user instead.
EDIT 2: Now fixed on master, will publish to beta as soon as possible. The new labels are for athomId and name, so users can pick whichever they see fit (name can be changed which is breaking, but athomId is opaque and not human readable).
Not sure what weather information you are missing but all device state should be exported, so if you have say a Netatmo outdoor sensor it will show up (but external information in the Netatmo app will probably not as they are not true devices and that data is probably not available for use by any app). Personally I use a combination of Z-wave and cheaper ZigBee (Xiaomi) sensors to get weather info. If you want to get third party/crowdsourced data I am not sure you need (or should) go through the Homey, maybe there is a Grafana plugin readily available?
EDIT: Now I think I understand the question. Homey does have a “weather” API. I never even saw that before. If it is any good it may be exportable. What are the experiences vs other providers of weather data? Worth the effort?
I don’t know much about the Grafana ecosystem yet, just got into it because homey insights isn’t quite up to my expectations to be honest.
I do not own any weather sensors yet, and since I live in a (ground-floor) apartment, I think finding a suitable spot for something as expensive as a netatmo station would be a little difficult. This is why I rely on homeys weather data for flows for now.
Maybe there is a better Grafana datasource for weather, but I found homey readings pretty accurate so far. They also make sense to monitor from a consistency point of view, since they are the ones used in flows and for the weather “screensaver” mode. So if one wanted to find correlations between flows triggering based on weather and other aspects, it would be more “on point” than an external source, if that makes sense.
I don’t know what else is exposed in the API, I just know insights let’s you see the temperature, humidity and pressure, with pretty high update frequencies (at least for weather data) but the conditions must also be saved somewhere, since the screensaver does also react to things like rain or thunderstorms.
Did see an increase when i turned on Prometheus, but not the big increase that im used too, i deleted 6 devices from the Nest app and Lifx app yesterday, maybe there’s an connection there. will test that.
Thanks! Got the report, but everything looked pretty normal there. Also, your Prometheus config looks good. 101 devices is a bunch, but with just over 60 devices, I can hardly see the change in load average. Most of the CPU consumption is event driven (polling is only done for system metrics and should be fairly constant). I am thinking maybe some device is spamming the Homey with state updates? I will think about if I can add some more self-monitoring metrics such as time spent in event handlers etc. Should help track this down.
On master I now added exporting of basic self-timings by adding two metrics (one for time (user/sytem/real) and one for call count). Should help identify the reasons why any spikes in CPU usage happens and in correlation to what.
When i use the profiler i dont get any CPU usage had it running fot 5mins. The mem is constant: 27.1MB
i dont get any CPU usage for any app by the way.
Cant think of an device which is permanently spamming homey, have some on a 60sec. interval, is that al lot?
Will wait on the new master then for digging deeper.
It is checked in to master. If you’re familiar with athom CLI you can install it yourself. Otherwise PM me your email and I’ll send an alpha invite. Or you can just wait for beta