sHedC / homeassistant-leakbot

Leakbot Integratio for Home Assistant
MIT License
6 stars 0 forks source link

Integration quite broken #98

Open lillborje71 opened 3 weeks ago

lillborje71 commented 3 weeks ago

System Health details

System Information

version core-2024.10.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.54-haos
arch x86_64
timezone Europe/Stockholm
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 5000 Installed Version | 2.0.1 Stage | running Available Repositories | 1520 Downloaded Repositories | 39
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 3 november 2024 kl. 01:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | true remote_server | eu-central-1-15.ui.nabu.casa certificate_status | ready instance_id | 52653e93bae7403393bf4199cf613b9f can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 13.2 -- | -- update_channel | beta supervisor_version | supervisor-2024.10.3 agent_version | 1.6.0 docker_version | 27.2.0 disk_total | 72.7 GB disk_used | 47.3 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Terminal & SSH (9.15.0), File editor (5.8.0), Node-RED (18.1.1), Samba share (12.3.2), Mosquitto broker (6.4.1), ESPHome (2024.10.2), Zigbee2MQTT (1.40.2-1), Studio Code Server (5.17.2), Home Assistant Google Drive Backup (0.112.1), Advanced SSH & Web Terminal (19.0.0), RPC Shutdown (2.5), Log Viewer (0.17.1), MQTT Explorer (browser-1.0.1), ESPHome (dev) (2024.11.0-dev20241017), Google Assistant SDK (2.5.0), Custom deps deployment (1.3.4), Whisper (2.2.0), Piper (1.5.2), openWakeWord (1.10.0), ESPHome (beta) (2024.10.0), Assist Microphone (2.2.3)
Dashboards dashboards | 2 -- | -- resources | 23 views | 12 mode | storage
Recorder oldest_recorder_run | 20 oktober 2024 kl. 07:45 -- | -- current_recorder_run | 27 oktober 2024 kl. 11:06 estimated_db_size | 272.70 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

leak free days is unavailable battery status shows null device status shows on_pipe in general , sensors not working so i file this as one issue as i'm guessing it's API related

Reproduction steps

1.fresh install of any version of leakbot reproduces this error 2. 3. ...

Debug logs

Logger: homeassistant.components.sensor
Källa: helpers/entity_platform.py:909
integration: Sensor (dokumentation, ärenden)
Inträffade först: 11:06:52 (1 händelser)
Senast loggade: 11:06:52

Error adding entity sensor.leakbot_9tbzcgm_leak_free_days for domain sensor with platform leakbot
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 909, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1366, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 542, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/leakbot/sensor.py", line 113, in native_value
    return_value = sub_data[self.entity_description.key]
                   ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'

Diagnostics dump

none

lillborje71 commented 3 weeks ago

please let me know if i'm bound to add something more

sHedC commented 3 weeks ago

Just started happening? I tried to connect to my own hass but my internet is down and I am away so can't tell.

At first glance looks like something changed in Hass that makes my code invalid. Soon as I can run up an instance I will check.

lillborje71 commented 3 weeks ago

i installed the integration 1st time yesterday and it never worked

sHedC commented 3 weeks ago

i installed the integration 1st time yesterday and it never worked

Are you using the beta one? Have to enable beta to update?

I will move the beta to full later today

lillborje71 commented 3 weeks ago

i've tried every release.

i could install any of the versions from HACS, including the beta ones

i'm currently on b1

or you mean beta HA ?

sHedC commented 3 weeks ago

Are you able to do debug, from the readme so I can see what data is pulled?

No meant b1 of my integration, working for me on 2024.10.3. Leak Free Days should be a number indeed in the api pull it is called leak_free_days in the API return.

lillborje71 commented 3 weeks ago

where are the debug logs stored ?

lillborje71 commented 3 weeks ago

home-assistant_leakbot_2024-10-27T15-37-02.435Z.log

sHedC commented 3 weeks ago

where are the debug logs stored ?

Yes it comes in those logs when enabled, you have to enable in the configuration.yaml, which you can get to using file system access or using an addon say the advanced ssh addon.

I have not managed to check my systems, the dev system is not building for some reason.

lillborje71 commented 3 weeks ago

well... the leak free days started working today. battery status started working today

device status still says on_pipe

][D][homeassistant.sensor:024]: 'sensor.leakbot_9tbzcgm_leak_free_days': Got state 1.00

sHedC commented 3 weeks ago

ok question, when did you get your leakbot? I wonder if there is a time it takes or maybe before 1 it gives a non numeric value?

sHedC commented 3 weeks ago

on_pipe probably I didn't put a translation yet its early stages will check

lillborje71 commented 3 weeks ago

maybe it was still calibrating and sensors aren't sharp until after calibration.

might be good to add that to your documentation