[RELEASE] Emporia Vue V2 driver for Hubitat

Reading through the above, I gather this integration still requires an additional piece of hardware in addition to the Emporia and the Hubitat.

Is there any hope for this ever becoming a HPM integration without additional hardware, or is there some technical limitation to that?

One way to handle arbitrary device nesting without hardcoding a large number of levels is to create a recursive device handler subroutine. The main loop calls the device handler for each device. In addition to processing the device's channels, the device handler recursively calls itself for each nested device.

2 Likes

Hi guys,
I just installed my Emporia Gen 2 device today and came across this post.
I am no developer but I think I was able to generate the Access Token using Hubitat groovy.
So, for now I have integrated my code into @ke7lvb code. This new version will allow the access token to be generated using the device page (turn debugging ON, click Generate Token and look at the logs. I will later work on a scheduled refresh to make sure it gets refreshed before it expires.
Do not forget to enter your mail and password (those you use to log into Emporia) in the device page
I did not have much time to debug my version but it would be nice if you could try and see that it works for you.
Changed version is here (I am not sure how to collaborate on github so for simplicity i just saved a copy on my repository for now):

Amit

2 Likes

This is exciting. I would be glad to include this in the main branch.

Quick question for you, does the token need to be refreshed periodically? I can write something in quickly if needed. I am testing it out now, so I guess I'll find out soon enough.

1 Like

A new version with refresh is here:

3 Likes

Assuming this issue with tokens and refresh is something we can deal with, I am thinking about what I really want from this integration. I mean, I understand that there are different data that we can retrieve using this API, but Hubitat's graphing is not great. We can basically monitor and trigger actions based on periodic data but isn't it the graphs that are more interesting?
So, I am thinking that it might be a good idea to send the data from Hubitat to InfluxDB and from there to Grafana so we can present nice graphs. I did this in a previous project and it works nice. I would be glad to hear other use cases and ideas.
Another thing is that some of us (as seen in posts above) have more than one device to monitor, so, it might be a better direction to use an App to create and maintain several devices. What do you think?

1 Like

That is exactly what I use it for. I push the data to InfluxDB, and then Grafana. You can then iframe the graphs back to Hubitat.
There is an integration for Hubitat and InfluxDB, but it is pretty resource intensive. It did not work well on a c4 hub. It might work OK on newer hubs, but I have not tried since I upgraded. The Home Assistant integration is less resource intensive, so I actually have the data syncing to Home Assistant, then push it to InfluxDB from there.

As for an App, I am not opposed to it, but I have not delved deep enough into Hubitat's developer documentation to figure out how it works. The current driver works well for my purposes, though I recognize it could be better.

1 Like

I am using the hubitat to influxDB app in one of my integration apps and i also implemented a driver that sends data to influxDB strait without it. They both run on a C7 hub with no issues. Sending the data strait to influxDB is not hard and I can send you the code i am using.
I would take some time to think about the App - Driver option.
Did you get the chance to check the refresh functionality?

It would require a bit of work for me to switch my graphs back to using the Hubitat data, so I'm happy with it running through Home Assistant for now.

The refresh appears to be working. I'll have to check again in about an hour to make sure the schedule is working, but the code looks right.

It looks like there may have been a change in the code to how it handles 'Balance' and 'Main' because those devices have stopped updating. Once I have that figured out I'll go ahead and update the code in Github.

Found the change. "Main" "Balance" and "TotalUsage" cannot be renamed in the Emporia app, so there is a naming collision if you have multiple devices. They need to be tagged in this driver somehow. I do that by appending the device ID to the name.

                    if(name == "Main" || name == "TotalUsage" || name == "Balance"){
                    	Gid = next_value.deviceGid
                    	name = name+"_"+Gid
                	}

I branched the old code in Github and have published the new driver in the main branch. I'll work on updating the descriptions. I am super excited you figured out how to do the auth in groovy.

2 Likes

This is really existing news that @amithalp figured out how to get the authentication done directly in Hubitat. Once everything is stable with @ke7lvb code I'll add that portion of the new authentication code to the [RELEASE] Emporia Vue Utility Connect Driver

1 Like

Looking forward to it also. I just got the Gen 3 version for Christmas and waiting for it not to be 24 degrees outside so I can shut power to install. I thought I was going to have to rely on Home Assistant.

For those of you following along, I have been running the new driver for 2 days and have not encountered any issues. I made a minor change to the logging this morning, but nothing critical. v2.4.2 is the most recent as of this post.

2 Likes

Thanks for this great driver. I’ve had a Vue since they first came out (now a Vue 3) and had resorted to various non-local hacks to get the data in.

I picked up yesterday’s version and installed it. It has worked fine. I did have to make one change to get monthly data, “1Mon” -> “1MON”, which seems to work. I made 2 other changes for my own use cases which are more problematic. I will PM them to you for your consideration.

Will this work in integrating data from 2 Vue systems together?
I have the Vue2 and the newer Vue3. Been so busy with the solar install and being almost at its prime..... still lots to go.

I am not certain if it is directly compatible with Vue3. I recall hearing it needs a minor adjustment to how it parses the device list from the API. If that is true, it would need to be enhanced to detect the device version and parse the JSON accordingly.

It works for my Vue 3 as is. If you want monthly data then the minor code typo fix I mentioned in my previous post is necessary. But... I'm not running two Vue's simultaneously. I can't comment on what the returned JSON might look like with two Vue's and how that would translate to the populated child devices.

the situation with nested devices still need coding adjustment as well for devices with a high nesting cout?

How do you like it? After you connected to network using the Ethernet connection?

I have one ready to install but 6 of my 25 circuits are unlabeled so I need to do some detective work. Also, I don't like thought of turning off power to entire house when it's less than 32 degrees outside.

I have it on Wi-Fi. Seems responsive enough. I really like them ( had earliest Vue first).

Many of my circuits weren’t labeled. It’s sensitive enough that a few minutes of turning things on/off makes everything obvious. And yes, first time I missed a circuit I wanted.