Disane87 / spoolman-homeassistant

Spoolman home assistant integration 🏠
MIT License
57 stars 4 forks source link

Can't get intergration to work #44

Closed Marshalldog closed 1 year ago

Marshalldog commented 1 year ago

System Health details

System Information

version core-2023.10.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 6.1.21-v8
arch aarch64
timezone *censored
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.33.0 Stage | running Available Repositories | 1402 Downloaded Repositories | 42 HACS Data | ok
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | ****Censored** relayer_connected | true relayer_region | ap-southeast-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | true remote_server | ap-southeast-1-0.ui.nabu.casa certificate_status | ready can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 11.1 -- | -- update_channel | stable supervisor_version | supervisor-2023.10.1 agent_version | 1.6.0 docker_version | 24.0.6 disk_total | 458.4 GB disk_used | 248.7 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | ESPHome (2022.3.1), Mosquitto broker (6.3.1), File editor (5.6.0), Grafana (9.1.1), ModbusTCP2MQTT (0.3.8), Studio Code Server (5.13.0), Home Assistant Google Drive Backup (0.111.1), Check Home Assistant configuration (3.11.0), Hey Ada! (1.2.0), Ring Livestream (1.35), Terminal & SSH (9.7.1), AirCast (3.6.1), Home Panel (2.7.0), Google Assistant SDK (2.5.0), Spotify Connect (0.12.6), Traccar (0.21.1), Samba share (10.0.2), Samba NAS (10.0.2-nas4), Plex Media Server with NAS (2.4.2-dht3), snapcast-server (0.25), Advanced SSH & Web Terminal (15.1.0), CEC Scanner (3.0), librespot (v0.3.1.2), snapcast-client (beta), AppDaemon (0.14.0), AirSonos (3.6.1), Hass.io Community Store (1.30.1), ESPHome (2023.10.5), Home Assistant Google Drive Backup (0.110.4)
Dashboards dashboards | 3 -- | -- resources | 14 views | 3 mode | storage
Recorder oldest_recorder_run | 21 October 2023 at 12:50 pm -- | -- current_recorder_run | 1 November 2023 at 4:19 pm estimated_db_size | 501.68 MiB database_engine | sqlite database_version | 3.41.2
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

Can't get the install to work: I get to Screenshot 2023-11-01 162759 and press submit. then it just stays as the following, showing no device found Screenshot 2023-11-01 162927 checked logs and found the following:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:359
Integration: Sensor (documentation, issues)
First occurred: 4:19:42 pm (5 occurrences)
Last logged: 4:30:26 pm

Error while setting up spoolman platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/spoolman/sensor.py", line 46, in async_setup_entry
    spool_device = Spool(hass, coordinator, spool_data, idx, config_entry)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spoolman/sensor.py", line 75, in __init__
    self._spool["location"] if spool_data["archived"] is False else "Archived"
    ~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'location'

Note: I have the correct IP address cause I'm also using a klipper install that feeds data to HASS on the same IP

Reproduction steps

1.added :https://github.com/Disane87/spoolman-homeassistant to custom repositories under HACS 2.Installed spoolman integration and did the above 3. ...

Debug logs

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:359
Integration: Sensor (documentation, issues)
First occurred: 4:19:42 pm (5 occurrences)
Last logged: 4:30:26 pm

Error while setting up spoolman platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/spoolman/sensor.py", line 46, in async_setup_entry
    spool_device = Spool(hass, coordinator, spool_data, idx, config_entry)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spoolman/sensor.py", line 75, in __init__
    self._spool["location"] if spool_data["archived"] is False else "Archived"
    ~~~~~~~~~~~^^^^^^^^^^^^
KeyError:

Diagnostics dump

No response

Disane87 commented 1 year ago

Thank you for this issue @Marshalldog! It looks like the location field is not present in the spool object. What version of spoolman do you use?

Is it possible that you send me the return of your api for the spools? Just open this url in a browser:

http://your-spoolman/api/v1/spool

the-cyberspace commented 1 year ago

I had the same problem and after filling up the location the integration in Home Assistant is working now!

Got the latests version from spoolman itself and the integration for HA

Disane87 commented 1 year ago

I had the same problem and after filling up the location the integration in Home Assistant is working now!

Got the latests version from spoolman itself and the integration for HA

Thank you for this hint @the-cyberspace! Will consider that the location can be unset in the next version.

If the location is unset I would suggest an unknown location, so the spools can be grouped.

But yeah, this is a bug which didn't occurred on my end since I have the locations filled 🫣

the-cyberspace commented 1 year ago

No problem and glad i could help! Didn't had the location setup because i don't use that option and now there all just "home" ...

But i like the idea to group them!

Disane87 commented 1 year ago

:tada: This issue has been resolved in version 0.2.1-dev.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

Disane87 commented 1 year ago

@the-cyberspace @Marshalldog I've created a dev release for this issue where this problem should be fixed. Would be nice if you can test this on your end. You should get this version when you enter HACS, search this integration and click on "download again" (or something else). You must enable beta version for this:

image

It should work over Settings -> Updates too, when you enabled beta versions.

Marshalldog commented 1 year ago

it worked! thx. cleanly works, no issues. I'll continue testing it (as I daily drive it). If anything pops up, I will notify. Anything specifically you'd like to test?

Disane87 commented 1 year ago

If it's working now, it's totally enough for me. Will consider this as resolved by now. If you find more, just open another issue.

Thank you for contributing!

Disane87 commented 1 year ago

:tada: This issue has been resolved in version 0.2.2-dev.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

Disane87 commented 1 year ago

:tada: This issue has been resolved in version 0.2.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: