CJNE / ha-myenergi

Home Assistant integration for MyEnergi devices
MIT License
143 stars 32 forks source link

Myenergi server request problem - Integration down #208

Open Zaphod360 opened 2 years ago

Zaphod360 commented 2 years ago

Version of the custom_component - ****

0.0.20 (latest)

Home Assistant Supervisor Version - 2022.08.3 Home Assistant Core Version - 2022.08.4

Configuration


# Loads default set of integrations. Do not remove.
default_config:

frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include custom_sensors.yaml

lovelace:
  resources:
    - url: /local/power-wheel-card.js?v=2
      type: module

Describe the bug

The inegration is not starting, can't get any output from any sensors. I'm running in Home assistant supervisor in a debian docker. All was working previously.

Debug log

This error originated from a custom integration.

Logger: pymyenergi.connection
Source: custom_components/myenergi/__init__.py:90
Integration: myenergi (documentation, issues)
First occurred: 22:38:21 (11 occurrences)
Last logged: 22:46:31

Myenergi server request problem
Logger: homeassistant.config_entries
Source: config_entries.py:1067
First occurred: 22:42:15 (1 occurrences)
Last logged: 22:42:15

Config entry 'My Home' for myenergi integration not ready yet; Retrying in background
2022-08-12 22:36:21.211 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration kia_uvo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.213 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration eufy_security which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.214 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration luxpower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.215 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration govee which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.216 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration myenergi which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.217 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.218 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dwains_dashboard which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.219 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.222 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration garbage_collection which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.222 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration philips_ambilight_hue which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.717 WARNING (MainThread) [homeassistant.components.lovelace] Lovelace is running in storage mode. Define resources via user interface
2022-08-12 22:37:12.252 WARNING (MainThread) [custom_components.govee] API is back online.
2022-08-12 22:37:22.572 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: alexa_media, hive, forecast_solar
2022-08-12 22:38:21.221 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:38:21.225 WARNING (MainThread) [homeassistant.config_entries] Config entry 'My Home' for myenergi integration not ready yet; Retrying in background
2022-08-12 22:38:43.360 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:39:13.901 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:39:54.266 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:40:54.330 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:42:15.801 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:42:15.810 WARNING (MainThread) [homeassistant.config_entries] Config entry 'My Home' for myenergi integration not ready yet; Retrying in background
2022-08-12 22:42:40.872 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
newbuilder22 commented 2 years ago

I believe from other forums the link to myenergi (director.myenergi.net) is down and s18.myenergi.net has to be used but I can't find the config to do this

axlback commented 2 years ago

I have the same issue

olesj33 commented 2 years ago

Same issue after update to Core update 2022.08.4

HypeLaser commented 2 years ago

Down for me also, on Core 2022.08.4.

And I cannot find any config file to either update the server (as above) or to change the API if that was ever required.

Deleting the integration and re-adding gives users an "unknown error" at the Add Integration stage.

Cybersloth commented 2 years ago

Same here :-(

allanmcnair commented 2 years ago

Same issue for me too.

MikeShipp commented 2 years ago

Same issue

newbuilder22 commented 2 years ago

Me too.

think I also had a power trip switch as when I put it back on the myenergi app not connecting. Sounds like a server issue.

piet1951 commented 2 years ago

Same problem :) image

Zaphod360 commented 2 years ago

Me too.

think I also had a power trip switch as when I put it back on the myenergi app not connecting. Sounds like a server issue.

Just to note, my app is functioning correctly.

G6EJD commented 2 years ago

What makes you think it’s an integration error especially with a log reporting as above?

newbuilder22 commented 2 years ago

This is happening over a few forums.

  1. so apps are working fine
  2. The authentication if reinstalled in HA does not happen between the serial no and the api
  3. I received a 500 error
HypeLaser commented 2 years ago

I think its an integration error because the log specifies "this error originated from a custom integration", and "server request problem". It may be semantics, but that's what it says.

Screenshot 2022-08-13 at 11 03 36

The add-on cannot be re-installed due to some sort of communication error between the integration and the MyEnergi servers.

HypeLaser commented 2 years ago

In PyMyEnergi python script, which is a requirement for this to work, there is a reference to:

https://director.myenergi.net

Some folks have suggested changing the server to s18.myenergi.net in the connection.py file for pymyenergi python script.

Does pymyenergi require a change to this file?

G6EJD commented 2 years ago

Are you using the API key

HypeLaser commented 2 years ago

I was using an API key, the integration was working fine up until the core update yesterday.

I have since removed the integration, because I thought a new API key may be required. And the only way to update the API currently is to re-install.

However, the integration now cannot be re-installed as it cannot communicate with the MyEnergi servers.

On 13 Aug 2022, at 11:14, G6EJD @.***> wrote:

Are you using the API key

— Reply to this email directly, view it on GitHub https://github.com/CJNE/ha-myenergi/issues/208#issuecomment-1214132401, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2OM3NG357WFUISGYPEB7TDVY5YPBANCNFSM56M7KDTQ. You are receiving this because you commented.

G6EJD commented 2 years ago

I’m on the updated core 2022.8.4 (applied yesterday) and mine continues to function as does the ME App and Webportal. It seems more likely that some customers are on different servers hence the director prefix in the ME address, so not every instance is the same.

newbuilder22 commented 2 years ago

This would be temporary as I think by doing this on the actual program in HA we would overload one server

On 13 Aug 2022, at 11:10, alexmercerscott @.***> wrote:

 In PyMyEnergi, which is a requirement for this to work, there is a reference to:

https://director.myenergi.net

Some folks have suggested changing the server to

s18.myenergi.net

Does pymyenergi require a change to this file?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

Zaphod360 commented 2 years ago

In PyMyEnergi, which is a requirement for this to work, there is a reference to:

https://director.myenergi.net

Some folks have suggested changing the server to

s18.myenergi.net

Does pymyenergi require a change to this file?

Where is this file, I can't find it anywhere?

HypeLaser commented 2 years ago

In the readme for “ha-myenergi" it states “Talking to the MyEnergi API using the PYMYENERGI python library”.

This is added when the integration is installed during the HACS installation (I assume?!).

The server which may need changed is in the file called “connection.py” at the GitHub for pymyenergi, which is located here: https://github.com/CJNE/pymyenergi/tree/main/pymyenergi

Note: I'm talking about pymyenergi and NOT ha-myenergi. The former is required for the latter to work, according to the readme.

On 13 Aug 2022, at 11:46, Zaphod360 @.***> wrote:

In PyMyEnergi, which is a requirement for this to work, there is a reference to:

https://director.myenergi.net https://director.myenergi.net/ Some folks have suggested changing the server to

s18.myenergi.net

Does pymyenergi require a change to this file?

Where is this file, I can't find it anywhere?

— Reply to this email directly, view it on GitHub https://github.com/CJNE/ha-myenergi/issues/208#issuecomment-1214136516, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2OM3NB6BKOQ5DUWIBUWVRDVY54HDANCNFSM56M7KDTQ. You are receiving this because you commented.

Zaphod360 commented 2 years ago

In the readme for “ha-myenergi" it states “Talking to the MyEnergi API using the PYMYENERGI python library”. This is added when the integration is installed during the HACS installation (I assume?!). The server which may need changed is in the file called “connection.py” at the GitHub for pymyenergi, which is located here: https://github.com/CJNE/pymyenergi/tree/main/pymyenergi Note: I'm talking about pymyenergi and NOT ha-myenergi. The former is required for the latter to work, according to the readme. On 13 Aug 2022, at 11:46, Zaphod360 @.***> wrote: In PyMyEnergi, which is a requirement for this to work, there is a reference to: https://director.myenergi.net https://director.myenergi.net/ Some folks have suggested changing the server to s18.myenergi.net Does pymyenergi require a change to this file? Where is this file, I can't find it anywhere? — Reply to this email directly, view it on GitHub <#208 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2OM3NB6BKOQ5DUWIBUWVRDVY54HDANCNFSM56M7KDTQ. You are receiving this because you commented.

Thanks, I thought it was something I could have a play with, doesn't look like it though.

G6EJD commented 2 years ago

At the end of the day this is not a guaranteed MyEnergi service, it’s more of a grace and favour, so if they have changed anything, it will take some time for changes to be implemented.

Cybersloth commented 2 years ago

I'm no expert, but here what i've tested and my conclusions.

If I poll s18.myenergi.net/cgi-status-* using json and supply the hub SN and Key I get a full response as we would expect. I don't think anything has changed at the Myenergi end. I have always used s18.myenergi.net BTW director.myenergi.net does not (and never has) allowed me to access it, although it dow through a login dialogue.

If I remove the automation (which does not work since the HA update) and try to re-configure it, I get 'Unknown Error occured" when i submit the credential dialogue, this message does not look like a response from the server, nor does it look like someones (a coders) interpretation of a server message. Therfor I don't think the requests are being sent to s18 myenergi.net anymore

As above, i'm no expert

godfreym29 commented 2 years ago

Using REST i've been able to retieve data from s18.myenergi.net but the errors in the intergration seem to suggest that it's trying to access https://s111.myenergi.net and that's failing.

the core 2022.8.4 update yesterday included a change to "anyio" or "aiohttp", I think. Could that bw related?

Error log message: 2022-08-13 15:35:53.594 INFO (MainThread) [pymyenergi.connection] Updated myenergi active server to https://s111.myenergi.net 2022-08-13 15:35:53.667 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 186, in connect_tcp addr_obj = ip_address(remote_host) File "/usr/local/lib/python3.10/ipaddress.py", line 54, in ip_address raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address') ValueError: 's111.myenergi.net' does not appear to be an IPv4 or IPv6 address

G6EJD commented 2 years ago

The integration is using director.myenergi.net which is being redirected to s111.myenergi.net and indeed that address has no server monitoring any connection requests. Not sure what is going on with ME systems today. Maybe they don’t want to support users who make incessant API requests every second, who knows.

pickeringar commented 2 years ago

My HA now accessing myenergi data again (under 2022.08.3)

G6EJD commented 2 years ago

Same here, just invoked the backup restore and working again. Now checking the 8.4 release notes I'm using s18.

Cybersloth commented 2 years ago

Restoring has not worked for me unfortuneatly

Cybersloth commented 2 years ago

Same here, just invoked the backup restore and working again. Now checking the 8.4 release notes I'm using s18.

Is the server configuarable somewhere ?

pickeringar commented 2 years ago

Not sure how the HA link to myenergi works, but I know the app uses different servers based on the last digit of the hub. My hub ends in 4.

Cybersloth commented 2 years ago

Restoring has not worked for me unfortuneatly

Please ignore the post above, working after a restore, then a physical reboot, a restart did not do the trick for me

G6EJD commented 2 years ago

So it seems this has been a MyEnergi issue all along, if only they had published on their site using a single line statement that there is a problem…

axlback commented 2 years ago

I changed nothing and am still on 8.4. Can also confirm it’s working again

G6EJD commented 2 years ago

The director address reads your supplied serial number and uses the last digit to select the server but MyEnergi have changed it now as they accept any MyEnergi device for the username then all you do is vary the call for the required information, that changed with the new products with inbuilt hubs.

allanmcnair commented 2 years ago

Workiing again for me in .4 had to request another API key and this time the integration reloaded and is producing data.

olesj33 commented 2 years ago

Mine is working again. Haven't done anything.

G6EJD commented 2 years ago

Now working again on 8.4 but had to get a new API key after deleting integration and re-Installing

HLFCode commented 2 years ago

Confirm integration stopped 13th August. Upgraded to HA 2022.8.4 and myenergi 0.0.20 and it's working again Thanks for keeping pace with MyEnergi!

G6EJD commented 2 years ago

Version of the custom_component - ****

0.0.20 (latest)

Home Assistant Supervisor Version - 2022.08.3 Home Assistant Core Version - 2022.08.4

Configuration

# Loads default set of integrations. Do not remove.
default_config:

frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include custom_sensors.yaml

lovelace:
  resources:
    - url: /local/power-wheel-card.js?v=2
      type: module

Describe the bug

The inegration is not starting, can't get any output from any sensors. I'm running in Home assistant supervisor in a debian docker. All was working previously.

Debug log

This error originated from a custom integration.

Logger: pymyenergi.connection
Source: custom_components/myenergi/__init__.py:90
Integration: myenergi (documentation, issues)
First occurred: 22:38:21 (11 occurrences)
Last logged: 22:46:31

Myenergi server request problem
Logger: homeassistant.config_entries
Source: config_entries.py:1067
First occurred: 22:42:15 (1 occurrences)
Last logged: 22:42:15

Config entry 'My Home' for myenergi integration not ready yet; Retrying in background
2022-08-12 22:36:21.211 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration kia_uvo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.213 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration eufy_security which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.214 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration luxpower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.215 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration govee which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.216 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration myenergi which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.217 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration alexa_media which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.218 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dwains_dashboard which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.219 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.222 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration garbage_collection which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.222 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration philips_ambilight_hue which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-12 22:36:21.717 WARNING (MainThread) [homeassistant.components.lovelace] Lovelace is running in storage mode. Define resources via user interface
2022-08-12 22:37:12.252 WARNING (MainThread) [custom_components.govee] API is back online.
2022-08-12 22:37:22.572 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: alexa_media, hive, forecast_solar
2022-08-12 22:38:21.221 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:38:21.225 WARNING (MainThread) [homeassistant.config_entries] Config entry 'My Home' for myenergi integration not ready yet; Retrying in background
2022-08-12 22:38:43.360 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:39:13.901 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:39:54.266 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:40:54.330 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:42:15.801 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem
2022-08-12 22:42:15.810 WARNING (MainThread) [homeassistant.config_entries] Config entry 'My Home' for myenergi integration not ready yet; Retrying in background
2022-08-12 22:42:40.872 ERROR (MainThread) [pymyenergi.connection] Myenergi server request problem

This needs to be closed now, it never was an integration error is was a MyEnergi server faulty.

G6EJD commented 1 year ago

This should be closed as it’s not an integration issue and never has been!

Drarok commented 1 year ago

I think it would be worth updating the error from "Myenergi server request problem" to something more actionable. What was the problem? What address was used in the request?

As is it now, the error message leaves people (like me) googling and finding nothing useful.