magico13 / PyEmVue

Python Library for the Emporia Vue Energy Monitor
MIT License
185 stars 36 forks source link

Missing unit of AMPS #5

Closed aviadoffer closed 3 years ago

aviadoffer commented 3 years ago

Could you kindly add AMPS. I tried AMPS, AMP, CURRENT , CURRENTS and none seems to work. but their app does show amps so they are storing the data.

ikishk commented 3 years ago

API doesnt provide amps, only watts. take the usage (watts) divide by 120, multiply by multiplier.

amps = (usage/120)*channelMultiplier

GET /usage/time

{
  "start": "2020-09-10T05:30:00Z",
  "end": "2020-09-10T05:30:00Z",
  "type": "INSTANT",
  "scale": "15MIN",
  "unit": "WATTS",
  "deviceGid": 12345,
  "usage": [
    897.3855049782329
  ]
}
aviadoffer commented 3 years ago

Thank you. I'm am aware I can do the math but its not accurate without the exact voltage which they do not collect. The iPhone app does show AMP over time so they do collect it, I hope we are just missing the exact unit name. maybe someone can sniff the iphone communication somehow.

ikishk commented 3 years ago

possibly. you'd think they would detect that since they ask you to wire each leg for powering the unit. going through the exposed API calls, I didnt see voltage anywhere. If you have a UPS plugged in somewhere w/ a web/usb interface, you might be able to read exact voltage off that, maybe get a weekly avg and be slightly more accurate. this is one of mine: Input Voltage: 119.6 VAC

aviadoffer commented 3 years ago

I contacted support asking for voltage and they said they don't collect it. they did say they collect amp and I can derive it. voltage in my case changes by the second and for my application I need to monitor the amp.

ikishk commented 3 years ago

you got me thinking, so i snmp my ups's and take an avg now :)

($voltage1) = snmpUtils::get($snmp, $ifDescr); ($voltage2) = snmpUtils::get($snmp2, $ifDescr); $voltage = ($voltage1 + $voltage2)/2;

magico13 commented 3 years ago

Just a quick comment because I was looking into this via the Emporia app and even their amps usage is totally wrong. My house has 150 amp service and the app was saying I was using 170 amps because it doesn't properly account for 240v loads. My furnace is electric so when it was on and pulling 15kw it was adding 125 amps instead of the correct value of 62.5 amps. I have no idea why they don't upload the amps data because they obviously read it from the CT sensors and they could use that to calculate all the other units but they instead use watts as the base.

aviadoffer commented 3 years ago

Their reported AMP is related to 120v not 240v. No clue why they would do that. maybe the query only pulls amps from one leg.

magico13 commented 3 years ago

I mentioned this in #15 but with the amps calls I'm now seeing a Mains_1 and Mains_2 channel returned with the amps for each leg. It looks like this should be fully supported now, both by the Emporia API and by PyEmVue. If there's anything missing let me know but I'm gonna finally close this one out.