Jump to content
C4 Forums | Control4

Prometheus Metric Logger driver


harper

Recommended Posts

Hello! I have another driver for you!

This is another alpha driver that should work great (it is working for me and is fun). 

It allows for the monitoring system Prometheus to grab metrics from your control4 system and graph them in Grafana or another dashboard system. 

Download, instructions and more info is here: http://c4drivers.com/prometheus-logger

Here are some example screenshots from my prometheus install and my grafana dashboard: 

prometheus-graph.png

grafana-lights.png

grafana-doors-alarm.png

grafana-motion.png

grafana-lights.png

Link to comment
Share on other sites


  • 4 weeks later...
On 8/24/2018 at 4:26 AM, lukas.polivka said:

By the way, any progress on the MQTT driver / integration?

I have a terrible implementation. However, I have had really good luck using my webhooks driver and nodered. Nodered will translate the incoming payload from control4 into a good mqtt payload. It works super well and is way more robust than my crappy implementation. 

The best route forward is for someone (hopefully not me) to actually port an MQTT client and server to C4 flavored lua. I have looked into it - but it is a PITA and i didn't want to get into the annoyances of actually writing a server. 

Link to comment
Share on other sites

  • 4 weeks later...
On 8/27/2018 at 12:08 AM, harper said:

I have a terrible implementation. However, I have had really good luck using my webhooks driver and nodered. Nodered will translate the incoming payload from control4 into a good mqtt payload. It works super well and is way more robust than my crappy implementation. 

The best route forward is for someone (hopefully not me) to actually port an MQTT client and server to C4 flavored lua. I have looked into it - but it is a PITA and i didn't want to get into the annoyances of actually writing a server. 

I suggested the idea to Control4, for them to provide (at least) some MQTT client & server library in DriverWorks SDK directly. I think it would open up a lot of new possibilities (without every driver developer having to reinvent the MQTT wheel).

Link to comment
Share on other sites

  • 1 month later...

Not that I know of, no. I don't know about any attempts, either.

Integrating through the WebHooks driver + NodeRED seems a bit awkward. I mostly wanted to integrate MQTT-enabled devices *to* Control4. For that, it would be nice to have some drivers hooked up to the UIs (proxies): 'light', 'relay', 'contact sensor', 'temperature sensor' and similar.

I got interested in it through HASS (which I was thinking of using as a universal gateway for everything Control4 does not support natively), Espurna and other projects. Seems like support for the protocol is pretty ubiquitous. Even some PLCs for which we now use Modbus, a terrible 70s-era industrial protocol, support it.

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 months later...

Hello Harper!

Finally got around to playing with this (so far only Prometheus). I'm not familiar with how this work at all so I may have some dumb/basic questions.

Prometheus itself seems to be working. For example when I query scrape_samples_scraped I get:

Element Value
scrape_samples_scraped{instance="10.66.0.210:9145",job="control4"} 8
scrape_samples_scraped{instance="localhost:9191",job="prometheus"} 692
  • Do the monitored devices first need to change their state to even show up in Prometheus? (I.e., your driver does not provide some kind of 'initial' state to the logger?)
  • Is every change logged, however short? Or is the data scraped in some periods? (The latter seems to be the case. E.g. I toggled a light a couple of times but it appears that Prometheus only logged the final On state, not each change).
  • Do I need to do anything when I rename rooms or devices? (E.g. re-register device events?)
  • Any reason why my simple ‘Temperature Display’ driver values wouldn’t show up even though the TEMPERATURE_C and TEMPERATURE_F variables do get updated? And another thermostatV2-based driver in the project (Weather Station by Control4) works?
  • Have you thought about creating some driver to allow arbitrary variable logging?

image.thumb.png.ea128830631804fee71433830bc03205.png

temperature_display.c4i

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.