ha-emporia-vue icon indicating copy to clipboard operation
ha-emporia-vue copied to clipboard

Intermittent error - 500 Server Error: Internal Server Error

Open dbaron92 opened this issue 2 years ago • 11 comments

I'm constantly getting errors in logs and they are about fetching sensor data Error fetching sensor data: Error communicating with Emporia API: 500 Server Error: Internal Server Error for url: https://api.emporiaenergy.com/AppAPI?apiMethod=getDeviceListUsages..............

Is there way to stop intermittent errors? I got like 5-10 errors per day. I am not sure if the issue caused by my end or API's end.

dbaron92 avatar Feb 23 '22 20:02 dbaron92

Unfortunately there's not much that can be done about it, they're issues on the API side. I have logic in place that should cause it to retry the request but if that falls too then the sensor goes unavailable until the next successful request (hopefully one minute later)

magico13 avatar Feb 23 '22 20:02 magico13

Ah ok that makes sense now. I asked because I used automations to identify when my dryer and dishwasher completes the cycle and trigger the notifications. When sensors get "disconnected" due to a server error then I will get notifications that the dryer and dishwasher are completed but they haven't run yet. I might have to tweak the automations but im not sure how.

dbaron92 avatar Feb 23 '22 20:02 dbaron92

I have similar automations for my washer and dryer. They trigger based on the power usage going above some set value and then it waits until the power draw drops to zero and stays there for 5 minutes. Then it continues and does all of the notifications (phone, change light color, announce via Alexa). There's a bit of a delay because of the requirement for it to be zero for a few minutes but not enough for it to matter to us.

magico13 avatar Feb 23 '22 21:02 magico13

capture

Yeah I have similar config but I set it as 10mins not 5 mins. I attached a picture with arrows and you can see that they are gapped because the sensors were lost contact with server. In 10 mins after gapped, I got notification that the dryer is completed which is false alert. For automation, Im not sure how to ignore the gapped to avoid false notifications

dbaron92 avatar Feb 23 '22 21:02 dbaron92

What is the trigger that starts your automation? Is it just that the value was zero for X minutes?

What I do is have the start of the automation be the value is above some threshold (say 100 watts) and then I use a "Wait for Trigger" with the power going to zero for several minutes as the end of the wait. Something like that should greatly reduce the false positives.

magico13 avatar Feb 23 '22 21:02 magico13

Here's my trigger trigger

Then this is the wait action that pauses the automation until the dryer is done running wait_action

And then after that are the notifications remaining_actions

magico13 avatar Feb 23 '22 21:02 magico13

Ah makes sense now. I didn't use wait for trigger feature. I will try it. Many thanks :D

dbaron92 avatar Feb 23 '22 21:02 dbaron92

Anyone else still having issues? I was getting same errors. I decided to delete it from home assistant, and now even after a restart I can't reconnect with my credentials. I validated my credentials work by going to their site

bughattiveyron avatar Feb 25 '22 21:02 bughattiveyron

The geniuses at Emporia changed their API

ACiDGRiM avatar Feb 27 '22 01:02 ACiDGRiM

so what does that mean for this addon?

parsecdata avatar Feb 28 '22 17:02 parsecdata

The integration was already updated to account for any recent API changes so you shouldn't see any problems due to that if you're on the latest version. They recently removed the old API I was using to get the state of the smart plugs so those were spewing out error messages for a little while.

magico13 avatar Feb 28 '22 17:02 magico13