SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
733 stars 112 forks source link

unable to setup binary_sensor platform #115

Closed TEfjLONjDON closed 3 years ago

TEfjLONjDON commented 3 years ago

This has been happening now for about a month. Not sure what the issue might be.

First Error Message.

Logger: homeassistant
Source: custom_components/wyzeapi/binary_sensor.py:198
First occurred: 10:11:40 AM (24 occurrences)
Last logged: 10:13:35 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 618, in _update_entity_states
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 283, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
    attr.update(self.device_state_attributes or {})
  File "/config/custom_components/wyzeapi/binary_sensor.py", line 187, in device_state_attributes
    ATTR_LAST_ACTION: self.epoch_to_utc()
  File "/config/custom_components/wyzeapi/binary_sensor.py", line 198, in epoch_to_utc
    last_update_time_3 = int(last_update_time_2)
ValueError: invalid literal for int() with base 10: ''

Second Error Message

Logger: homeassistant.components.binary_sensor
Source: custom_components/wyzeapi/binary_sensor.py:198
Integration: Binary sensor (documentation, issues)
First occurred: 10:11:34 AM (2 occurrences)
Last logged: 10:11:34 AM

Error adding entities for domain binary_sensor with platform wyzeapi
Error while setting up wyzeapi platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 315, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 506, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
    attr.update(self.device_state_attributes or {})
  File "/config/custom_components/wyzeapi/binary_sensor.py", line 187, in device_state_attributes
    ATTR_LAST_ACTION: self.epoch_to_utc()
  File "/config/custom_components/wyzeapi/binary_sensor.py", line 198, in epoch_to_utc
    last_update_time_3 = int(last_update_time_2)
ValueError: invalid literal for int() with base 10: '' 
SecKatie commented 3 years ago

@TEfjLONjDON are your sensors still working or does the error coincide with them no longer responding?

TEfjLONjDON commented 3 years ago

I sorry for the late reply, I could swear I checked back here several times. (Perhaps the page just never refreshed, My Sincerest Apologies).

I temporally solved this one, by just adding....

  sensors: false

to my config like so.

# Wyze API
wyzeapi:
  username: !secret wyze_username
  password: !secret wyze_password
  sensors: false

However, Should I decide to use anything that relies on the sensors domain or "binary_sensors"; Then I will just simply have to live with the errors (after I remove the before mentioned fix). Unless of course the mater solves its-self via an update.

Naturally I do believe the errors above prevented me from seeing my "door sensors" and "motion sensor" (because the HA was not able to finish setting up the "binary_sensor" platform associated with this integration as referenced by, File "/config/custom_components/wyzeapi/binary_sensor.py" ). The "door sensors" & "motion sensor" mentioned above are connected to the wyze account via the "wyze-sense" hub connected to the rear of the camera I'm using (wyze_cam_v2).

The Camera is somewhat unrelated, as I'm using the RTSP firmware to pull that feed into HA. I use this integration via hacs, mainly to control two switches/wall-plugs and several wyze-bulbs/lights.

Just for convenience I'll include my system details below..

I'm running HassOS vhdx. (ova) on "Windows 10 Pro x64" inside a Hyper-V VM.

System Health

version: core-2021.2.3
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
virtualenv: false
python_version: 3.8.7
os_name: Linux
os_version: 5.4.99
arch: x86_64
timezone: America/New_York

GitHub API: ok
Github API Calls Remaining: 4726
Installed Version: 1.11.3
Stage: running
Available Repositories: 749
Installed Repositories: 8

logged_in: true
subscription_expiration: March 23, 2021, 8:00 PM
relayer_connected: true
remote_enabled: true
remote_connected: true
alexa_enabled: true
google_enabled: true
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 5.12
update_channel: stable
supervisor_version: supervisor-2021.02.11
docker_version: 19.03.13
disk_total: 30.8 GB
disk_used: 6.6 GB
healthy: true
supported: true
board: ova
supervisor_api: ok
version_api: ok
installed_addons: Duck DNS (1.12.5), Mosquitto broker (5.1.1), Samba share (9.3.1), Terminal & SSH (9.0.2), File editor (5.2.0), ESPHome (1.16.2), RPC Shutdown (2.2), SSH & Web Terminal (8.0.3), Visual Studio Code (3.1.0), Portainer (1.4.0)

dashboards: 3
resources: 3
views: 23
mode: storage
TEfjLONjDON commented 3 years ago

Probably Not Related, But... I am also getting this error See Below, now after the last few updates regarding the vacuum(alpha).

Logger: homeassistant.util.async_
Source: util/async_.py:129
First occurred: 10:57:45 AM (1 occurrences)
Last logged: 10:57:45 AM

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for wyzeapi doing I/O at custom_components/wyzeapi/smartbridge/providers/wyze/client.py, line 245: response = session.send(request, **settings)

I'm Not sure why hacs prompted me to install these builds. As I had only intended to install from the "master" branch. But I digress. I'm certain it prompted me about the update and I the responsible party; am the one who Clicked install.

SecKatie commented 3 years ago

This is from an alpha build. Can you install the latest stable and see what happens? I know there are some major issues with the v1 sensors that have caused some issues with this integration

SecKatie commented 3 years ago

@TEfjLONjDON I am closing this due to inactivity. Please feel free to reopen if this is still an issue