I have this monitor running now in my house and was looking for a way to get the data into Homeseer. The company says an API will be out sometime this year .
Announcement
Collapse
No announcement yet.
Emporia Vue Energy Monitor and mqtt and Homeseer
Collapse
X
-
When I did my energy monitoring many years ago I ran the wires from the clamps through the panel using the same technique as all other wires going into the panel. I mounted an Orbit irrigation box above the panel that received these wires. This box then was integrated with HS. It was my understanding in my jurisdiction that the panel was very limited as to the connections and electronics that could be placed inside the panel.
- Likes 1
Comment
-
I have added support for Emporia in 5.23.7.0. The files are at the bottom of the change log at https://forums.homeseer.com/forum/hs...ge-log-hs4-hs3. The complete description and step-by-step process is contain in http://mcsSprinkler.com/mcsMQTT.pdf Section 12.7.3
I had difficulty trying to reverse engineer the AWS login so elected to use the Python code that was able to perform this function. When Emporia releases an official API then a direct login from the plugin should be able to be accomplished. The only additional burden with using the Python code is the package needs to be installed. It is described at https://pypi.org/project/pyemvue/. From the command line/terminal windows the command "pip install pyemvue" is used to install the package.
There is also a Python glue program AWSlogin that is attached where version 5.23.7.0 is located. Unzip into the same location as pyemvue was installed. In my case it is C:\Python37-32\site-packages
Comment
-
Since the Emporia support at this time needs Python the install process is more involved. Confirmation that the install is correct can be done with the following test procedure. The need to confirm the correct install will be indicated as a 401 unauthorized error reported when trying to access Emporia cloud server.
1. Confirm keys.json in the HS subfolder \data\mcsMQTT exists and updated with your account login info
2. Open a command window and issue the following two commands. The first to navigate to where keys.json is located. The second to execute the pyemvue Python module.
cd c:\Program Files (x86)\Homeseer HS4\data\mcsMQTT
Python -m pyemvue keys.json
There should be no errors reported on the command window and some positive feedback obtained such as
3. If failure then revisit the install of pyemvue
4. If success then do the same thing, but use the AWSLogin rather than pyemvue. This is what mcsMQTT is trying to execute.
5. If failure then revisit the download and expansion of AWSlogin.zip
6. If success then confirm the path to python.exe is known by mcsMQTT. The default is C:\Python37-32\python.exe. Other locations are made know to mcsMQTT via \config\mcsMQTT.ini in the [General] section with key PythonPath=X:\Y\Z\python.exe where X, Y, Z and any other subfolder structure is specified. For Linux it will use the Linux file path convention.
This interim method to login to the Emporia server is expected to be replaced in the future when the official API is released and the methodology for login is documented.
Comment
-
I do still get an error with the pyemvue keys.son command
You should be aware that the AWS tokens are valid for about an hour. The test procedure generates valid tokens that will be good for the first hour. mcsMQTT will need to regenerate them so pay attention after an hour to confirm that the integration is complete. If 401 returns then the most likely cause is the mcsMQTT.ini need for the path to python.exe (test step 6 above).
Let me know if there is something else you would like in the integration. I was on the fence for reporting KwH, KW or W. During testing I found the 10 second update of the 1 Minute bucket to be the most useful, but others may want to use the data to show long term consumption of a circuit rather than a real time measure. I found the scale=1S to be too small for what I would use. If something is only ON for a few seconds then it cannot consume that much energy, but if one was going to trigger on some unusual condition then I can see where scale=1S would be appropriate.
There are other types of information that is available from Emporia server such as their smart plugs. The full set of reverse-engineered API is at https://github.com/magico13/PyEmVue/...er/api_docs.md. Additional features can be added by the user by using a publist for the endpoint rather than the actual endpoint in the Local Page, URL endpoint setup. This would allow multiple endpoints to be queried at each polling interval. The user would then need to select specific items of interest from the MQTT Page, Association Tab with the "A"ssociate column checkbox. With Emporia's use of JSON array notation there will be redundant entries in the Association table, but only one is needed to associate with HS Device Feature.
Comment
-
The 401 error did not return even though the pyemvue keys.json error remains and the devices are updating just like the phone app.
This is a great system. Much better than Sense and much cheaper than Brultech. I will purchase another unit for my other panel at this house and probably add it
with a different email address as the user. Thanks again for your hard work.
Comment
-
You will want to keep the same account for both installations since only one unique URL is used to access data for all Emporia customers and installations. The endpoint will need to be edited to include two deviceGid. I will also need to provide an update to the plugin where the deviceGid becomes part of the identification of the HS Device so each deviceGid will be a Device and the circuit names the Features of the Device.
The endpoint format for multiple deviceGid is ...deviceGids={deviceGid1}+{deviceGid2} ... while the template you have been using is ...deviceGids={deviceGid1} ...
Comment
-
I imagine that Emporia has an App and that App likely shows multiple grids on the same login. This is based upon the reverse-engineered "deviceGids={deviceGid1}+{deviceGid2}" that I see. This would seem more natural for a user rather than having multiple logins. It may be appropriate to contact Emporia to clear this up.
From the plugin perspective, the URL is the method by which unique access is managed. It does not now have provisions with the same URL and different login credentials. I can accommodate whatever Emporia uses, but a single login is preferred.
Comment
-
keys.json will change every hour or so as the access token expires and needs to be refreshed.
The KwH reading provided by Emporia can be viewed on the MQTT Page, Association tab. It will update every 10 seconds if 10000 is the URL page setting for polling rate. It is converted to Watts based upon the scale which by default is 1MIN so the conversion is 60,000 Watts/KwH (60 minutes/hour * 1000 Watts/KiloWatt). If the towel warmer is being shown in HS as 4 watts then the KwH reading from Emporia should be 6.667E-5.
The scale=1MIN is part of the URL tab Endpoint. The 60,000 conversion is on the Edit tab of the device in the Expression text box (click on the Ref for the device on the Association tab to view the Edit tab)
If the towel warmer should be around 240 watts then Emporia should be showing over the past 1 minute a KwH value of 240 watts / 60 minutes / 1000 W/KW = 0.04 KwH on the MQTT Association table.
What are you seeing on the Association Table for the towel warmer?
Comment
Comment