Homey Community Forum

Prometheus.io exporter

But wouldn’t that break all the dashboards?

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.

[quote=“Kyrcio, post:21, topic:7375, full:true”]

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.

Anyway … just my thoughts on having two homey

I was thinking about the shared ones on Grafana Dashboards. IIRC there are also a few posted on the old forum.

I never considered the case of multiple Homeys, but including the Homey name as a label could perhaps be a good idea.

The string “homey” in the metric name is actually the name of the exporter, not the name of the Homey.

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.

Nice app! Already had grafana running for systems and network devices at home.
This is a very nice addition.

Is it possible to export network interface information?

So far only done system information on the dashboard.

Hi all,

I’m new user on homey, before I play with homecenter 2 and jeedom/nextdom.
Thank you for your work for this app.

I have a question, when app running my home is overload, the cpu is beyond 100% all the time.
Same for all ?

Thank you

Hi @byackee and welcome to the community!

Jep, thats the case, nasty trade off for this nice app.
i dont know how an Homey pro will behave though

My CPU is not 100% all the time and I see this app.

image

Are you sure it’s the prometheus.io exporter?
Did you check the insights graphs on https://insights.homey.app/

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.

  1. 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.

  2. 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.

  3. 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, :innocent:

Thanks for the feedback. Some quick answers:

  1. This is not supported but seems like a reasonable new feature. Feel free to create an issue for it (https://github.com/rickardp/homey-prometheus-exporter/issues)

  2. 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).

  3. 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?

Thanks for the quick reply

  1. I will do just that.

  2. That’s awesome news, looking forward to that :blush:

  3. 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.

i can isolate it, if prometheus is on load of 1,7 - 2,6 and when off around 0,7

Can you please send a crash report? Also, how many devices do you have? How did you configure the target in Prometheus?

Thanks for looking in to this!
Log: cde6df39-d8aa-499f-ba42-a8d3865b70c5
Devices: 101
Prometheus config:
scrape_interval: 30s
scrape_timeout: 10s

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.

By the way, have you seen the Athom profiler? https://developer.athom.com/tools/app-profiling
How does the prometheus app look from there?

Thanks for the update.

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.

0.2.5 is now published to beta. Fixes api change regression with presence.

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 :slight_smile: