New Hubitat to InfluxDB Bridge via MakerAPI+Node [beta]

@asj I have been checking the code, the Binary sensors are never reported as false because they are only evaluated in truth state, that does than the sensor last values it's keep as True and the poll repeats this value every 30 min.
Should be easy to fix I can try but I'm not developer and my dev skills are mainly on python.

There is a way to add the capabilty on the code for nonTruth states to be reported as false?

@dragner What is the binary sensor? This is a list of known/official types:

https://docs.hubitat.com/index.php?title=Driver_Capability_List

I see no binary sensor, and my hubitat has no binary sensor. So what is it, and where is the code from?

So Hubitat has a semi-offical list of devices and the capabilities and events they probably should conform too. But event calls are free form and anyone can do anything they want in a driver.

Sadly influxdb wants numbers, not true/false/etc. So there's 2 solutions:

  1. Make the node app conform to every single crazy thing a dev has done. :slight_smile: It tries to get a few of the major cases, and should get more.

  2. Fix the driver to send reasonable things. If the driver never sends a false, there's a problem.

To do #1 I need the event details, what is the driver sending. Best is to get the code for the driver then we can see what the driver is doing and see if it's inherently broken/fixable/have to do 1.

Sorry for the missunderstand, my English sucks :stuck_out_tongue: what I was trying to say with the binary sensor is contact/motion/... sensors, the bolean type sensors.

What I see when I deploy the app is than motion sensors and contact sensors in influxdb are registered only with a 1 as valueBinary, doesn't matter if the value es open or close, for example:

> SELECT * FROM "contact"                                                                                                              
name: contact                                                                                                                          

time                deviceId deviceName                    hubId hubName locationId locationName repeat unit    value  valueBinary     
----                -------- ----------                    ----- ------- ---------- ------------ ------ ----    -----  -----------
1584185346129000000 481      Puerta Terraza                0     home    0          Home         true   contact open   1               
1584208535469000000 262      Puerta Principal              0     home    0          Home         false  contact open   1               
1584208540706000000 262      Puerta Principal              0     home    0          Home         false  contact closed 1               
1584208910932000000 262      Puerta Principal              0     home    0          Home         false  contact open   1               
1584208912653000000 262      Puerta Principal              0     home    0          Home         false  contact closed 1
1584365984889000000 195      Sensor de Lluvia              0     home    0          Home         true   contact open   1               
1584373346317000000 262      Puerta Principal              0     home    0          Home         true   contact closed 1               
1584374656904000000 196      Sensor Apertura Ventana Techo 0     home    0          Home         true   contact closed 1               
1584376784915000000 195      Sensor de Lluvia              0     home    0          Home         true   contact open   1               
1584384146319000000 262      Puerta Principal              0     home    0          Home         true   contact closed 1

@dragner

There, fixed it properly. Try installing 0.1.9 and it should work.

You rock man! Working perfectly:

  time                deviceId deviceName                    hubId hubName locationId locationName repeat unit    value  valueBinary            
    ----                -------- ----------                    ----- ------- ---------- ------------ ------ ----    -----  -----------
    1584443826102000000 262      Puerta Principal              0     home    0          Home         false  contact open   1                        
    1584443839719000000 262      Puerta Principal              0     home    0          Home         false  contact closed 0                        
    1584444577797000000 513      Puerta Terraza                0     home    0          Home         false  contact closed 0                        
    1584444577928000000 513      Puerta Terraza                0     home    0          Home         false  contact open   1                        
    1584444578052000000 513      Puerta Terraza                0     home    0          Home         false  contact closed 0
    1584444685346000000 289      4en1 Despacho 0     home    0          Home         false  motion active   0                                       
    1584444792071000000 289      4en1 Despacho 0     home    0          Home         false  motion inactive 1                                       
    1584444795618000000 289      4en1 Despacho 0     home    0          Home         false  motion active   0                                       
    1584444806471000000 263      6en1 Comedor  0     home    0          Home         false  motion active   0                                       
    1584444867453000000 263      6en1 Comedor  0     home    0          Home         false  motion inactive 1

Set this up in an afternoon, very quickly started to see my temperature and humidity readings come through on grafana dashboard on my new Pi. Nice work @asj. Only major sticking point was to work out how to pick out the device name using a $tag in the alias by section, possibly covered in a previous post on this topic.

Simon

Yay! glad you got it working :slight_smile:

Thanks @asj.

One question, for you or anyone else who may know... What's the best way to setup a variable on a Grafana dashboard to allow a user to select one or more sensors?

I do know this can be done on an individual chart in the legend, but wanted to learn a bit more about the variables feature. Trying to achieve this lead to me trying to get Tag Values for the deviceName tag on the temperature measurement in InfluxDB, which does not return when I try to show tag values in the influx CLI. I can see this is a tag "column", but cannot return a distinct list of values. Any advice?

Thanks,
Simon

Here’s a good video to help get you started.

1 Like

Thanks @Vettester! I was like “man it’s a pain to find I’ll need to make a video for @sburke781

2 Likes

Wow, there's a lot to digest there. I might need to slow it down to try and absorb everything :slight_smile: Thanks for providing the link @Vettester.

I think I may have got side-tracked with trying to access the tags through InfluxDB, when, if I can access them in Grafana, would become a mute point, utlimately Grafana is where I want to use them.

You might might want to try just creating specific charts without using variables. I’m using average temperatures for the areas I am interested in and have found it makes a lot cleaner dashboard.

Here’s what I’m using for temperature:

Note: The flat red line at 70 degrees is an alert I have set for my main floor thermostat.

1 Like

Nice chart.

I recently started to play with averaging multiple sensors in HE to look at indoor and outdoor temperature, using @Cobra 's driver: Average All. I still need to send these through via the maker API. Even though I could do this calc in Influx / Grafana I feel the driver gives me more flexibility with HE dashboards, etc.

I also like the focus of the dashboard, I'm still toying with how best to lay mine out. Will try and post some pics in the next day or two.

1 Like

@sburke781 I use these sometimes, I use grafana in a pretty basic way, but maybe this will help for you? This adds an ah-hoc filter on any dashboard so you can have 15 sensors, then just pick 1:

https://youtu.be/EJrq4qFrdWg

1 Like

Thanks, I'll take a look and let you know how it goes.

I did end up getting a variable to work, just can't remember what source of information provided I used... I'm terrible at looping back with outcomes... :slight_smile:

I setup a variable with a comma separate list of values (would have preferred to have a dynamic list, but this was easy enough and they won't change too often):

I then added this to the WHERE clause of the two queries I have, one for Temperature and one for Humidity (only Temperature shown below).

I then added the variable as a selector in the dashboard, which filters all the charts where those queries are used:

I also posted some details of a modified version of these charts I have added to my Hubitat dashboard, details are here and here.

Thanks again for all your help,
Simon

Has any tried or been able to setup a stacked bar chart based on two separate metrics? I have read and experienced how influx db does not support unions across measurements. My only options I can see may be a continuous query (I think that's what it was called) or setting up dummy devices with the same attributes (metrics) so they appear in the same measurement "table" in influx.

The situation I have is a HE device for my Solar panels that has a number of readings, including how much energy the panels produced in total (a), how much of that production was consumed by the house (b), and how much was fed back into the grid (c). a = b + c. There is a similar situation with overall consumption, solar power consumed and power drawn from the grid.

In both cases I want to show a stacked bar showing the percentage breakup between self consumption and the grid related metric, i.e. metric b vs metric c.

Any ideas?

I keep getting an echo of the example, can you guide me what I may be doing wrong? I looked for the errant commas, couldn't find any.

What error are you getting @karnik.abhijeet?

@asj it does not throw me an error, it echos the example config.json file. Do you want to see my config file?