Vesync was working and now its not

When I first got home assistant going, Vesync was working for my plugs, but after a few days, the devices started to drop off. Now, when I restart home assistant, my vesync plugs are missing usually. Every once in awhile, the plugs will be listed in home assistant, but they may or may not function correctly. In the logs, I get:
2018-11-19 05:06:48 ERROR (SyncWorker_11) [pyvesync.vesync] HTTPSConnectionPool(host=‘smartapi.vesync.com’, port=443): Max retries exceeded with url: /vold/user/login (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7f7fec2da0>: Failed to establish a new connection: [Errno -3] Try again’,))

I can still control the plugs via google home/alexa and from the app on my phone, so I don’t believe it to be a connectivity error.

switch:

  • platform: vesync
    username: r********@******m
    password: *****

Hassio version:
Version 139
Home Assistant
0.82.1

Anyone else seeing something like this or have a thought for a workaround?

Thanks,
Shawn

I suddenly got the same problem.
Did you find a fix?

I submitted a PR to HA that should fix the problem. Until it is merged you can use the custom component here:

@homefire
I’m running Hassio 0.96.5 on a Intel-Nuc on Debian.

Just bought a couple of Etekcity Voltson Smart WiFi Outlets (7A model ESW01-USA). I have added one to the VeSync app and it works fine there.

Added your custom_component files to /custom_components/vesync. and added vesync: and user name and password to my configuration.yaml file.
On reboot (several times) I get the following error:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 270, in _async_add_entity
if entity.unique_id is not None:
File “/config/custom_components/vesync/switch.py”, line 54, in unique_id
return self.smartplug.cid
AttributeError: ‘list’ object has no attribute ‘cid’

Any ideas on what to try?

Ok, I just tried the custom component with the HA dev branch 0.96 and it is working fine for me (except for a minor change for getting the unique ID which won’t impact you unless you have the outdoor outlet). Can you set your logger level to debug and send any output from the vesync component or pyvesync library? Also, can you post the exact format of the vesync entry in your config (Minus the PW of course)?

You can try the custom component with the minor updates:
https://github.com/markperdue/pyvesync/tree/fix-custom-component/home_assistant/custom_components

Was the custom component working in any other version?

Please remove the custom_component and the vesync entry from config.yaml and reboot. Add the new custom_component vesync folder and the config.yaml entry and reboot again.

Quick question… DO I need to do anything other than adding the files to custom_components, etc like I explained? Or do I need to install anything else?

I did not have it running in any other version, just got the plugs yesterday.

I will do the remove, reboot, re add the new, reboot .

There’s no special requirements, there is an existing legacy vesync component builtin that might interfere so you need to make sure you remove the entry from your configuration.yaml file and reboot just in case. The general process is:

  1. add custom_components/vesync folder to your config directory
  2. Add the vesync entry to the configuration.yaml:
vesync:
  username: email
  password: password
  1. Reboot and it should recognize your devices

Your getting a weird error, it’s as if the add_entity function is passing the whole list through instead of iterating through each device. I need to see more debug info to see where it might be going wrong

I updated the builtin component to use HA’s async architecture and config flow so it can be configured via the interface that should be included in the next release, the PR has already been merged. It is a more robust version that should definitely work.

OK, I will let you know the outcome after the wash/rinse/cycle…

Thanks

I am running HA on pi4 and I tried to install vesync and pyvesync with no success. I am trying to get my Levoit 400s air purifier show in HA.
I did lot of research but unfortunately I am not sure that I am following the correct installation process.
This is what I did:
Step A.Installed pyvesync using the "pip install pyvesync’ command in the terminal.
Step B. Installed the VeSync Integration directly from HA. (Integration shows but doesn’t show my Levoit 400S air purifier. (Note: After all the above still no vesync directory in the custom_components folder).
Step C. I created a “vesync” folder in custom_components and I transferred all files from “https://github.com/webdjoe/pyvesync” in the specific folder using Filezilla.
Step D. edited configuration.yalm and added the vesync username and password (I tried via secrets! as well as directly). I also tried adding “discovery” in configuration.yalm
I rebooted several times but nothing.
Am I following the wrong installation process? Am I missing a step?
Can somebody help me out with the step-by-step installation process please?

Thanking you in advance.

Did you had any luck, after that?