nidble / inim_alarm

Home Assistant's Inim Alarm Integration
GNU General Public License v3.0
3 stars 2 forks source link

Error initialising #5

Closed thekoma closed 3 months ago

thekoma commented 4 months ago

Hi! First of all, thank you I was trying to build a component myself but I lack the know how, and it's a hot mess at the moment ( https://github.com/thekoma/inim_mqtt_bridge )

I'm trying your custom_component but something goes wrong in the str_to_devices or somethwhere around resolver.py .

Can I get you more details somehow? Also I'm more than happy to give you support if not as a lousy developer at least as a tester.

home-assistant.log:

2024-07-13 22:34:44.420 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration inim 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
2024-07-13 22:34:48.857 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'zwave_js', 'application_credentials', 'intent', 'pyscript', 'proximity', 'diagnostics', 'upnp', 'lovelace', 'owntracks', 'rest_command', 'stream', 'input_select', 'conversation', 'dlna_dms', 'scene', 'intent_script', 'additional_ca', 'binary_sensor', 'shelly', 'config', 'wyoming', 'ping', 'sun', 'airvisual', 'input_boolean', 'wake_on_lan', 'otbr', 'fontawesome', 'wake_word', 'rainbird', 'sonos', 'ffmpeg', 'media_source', 'webrtc', 'zone', 'switch', 'my', 'timer', 'version', 'device_automation', 'spook', 'blueprint', 'smartthings', 'energy', 'google_generative_ai_conversation', 'telegram_bot', 'python_script', 'netatmo', 'mqtt', 'number', 'analytics', 'default_config', 'mikrotik_router', 'history', 'androidtv_remote', 'foscam', 'homeassistant', 'co2signal', 'schedule', 'simpleicons', 'logbook', 'device_tracker', 'homeassistant_hardware', 'airvisual_pro', 'uptimerobot', 'image_upload', 'esphome', 'hpprinter', 'mass', 'tts', 'matter', 'person', 'mjpeg', 'light', 'inim', 'homeassistant_yellow', 'script', 'webostv', 'select', 'automation', 'bluetooth_adapters', 'ibeacon', 'backup', 'google_tasks', 'map', 'system_health', 'thread', 'spotify_plus', 'trace', 'switch_as_x', 'assist_pipeline', 'input_button', 'file_upload', 'panel_custom', 'template', 'counter', 'nuki', 'homekit_controller', 'homeassistant_alerts', 'onboarding', 'speedtestdotnet', 'rest', 'sensor', 'browser_mod', 'persistent_notification', 'holidays', 'switch_manager', 'samsungtv', 'moonraker', 'local_ip', 'input_text', 'circadian_lighting', 'hardware', 'spotify', 'stt', 'github', 'group', 'open_meteo', 'notify', 'google', 'unifi', 'ifttt', 'shopping_list', 'search', 'tesla_custom', 'mobile_app', 'prometheus', 'cast', 'hacs', 'blink', 'google_home', 'tag', 'input_number', 'input_datetime', 'transmission'}
2024-07-13 22:34:58.639 DEBUG (SyncWorker_3) [homeassistant.util.yaml.loader] Secret inim_alarm_password retrieved from secrets.yaml in folder /config
2024-07-13 22:34:58.639 DEBUG (SyncWorker_3) [homeassistant.util.yaml.loader] Secret inim_alarm_username retrieved from secrets.yaml in folder /config
2024-07-13 22:34:58.640 DEBUG (SyncWorker_3) [homeassistant.util.yaml.loader] Secret inim_alarm_client_id retrieved from secrets.yaml in folder /config
2024-07-13 22:34:58.640 DEBUG (SyncWorker_3) [homeassistant.util.yaml.loader] Secret inim_alarm_device_id retrieved from secrets.yaml in folder /config
2024-07-13 22:35:07.520 INFO (MainThread) [homeassistant.setup] Setting up inim
2024-07-13 22:35:09.069 ERROR (MainThread) [custom_components.inim] Unexpected error fetching inim data
  File "/config/custom_components/inim/__init__.py", line 94, in async_fetch_inim
    _, _, res = await inim.get_devices_extended(device_id)
  File "/usr/local/lib/python3.12/site-packages/pyinim/cloud/abc.py", line 51, in get_devices_extended
  File "/usr/local/lib/python3.12/site-packages/pyinim/cloud/resolver.py", line 57, in str_to_devices
2024-07-13 22:35:09.087 INFO (MainThread) [homeassistant.setup] Setup of domain inim took 1.57 seconds
2024-07-13 22:35:18.441 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform 'inim.alarm_control_panel': Platform not found (No module named 'config.inim_alarm').
2024-07-13 22:35:18.446 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up inim.binary_sensor
2024-07-13 22:35:21.731 ERROR (MainThread) [custom_components.inim] Unexpected error fetching inim data
  File "/config/custom_components/inim/__init__.py", line 94, in async_fetch_inim
    _, _, res = await inim.get_devices_extended(device_id)
  File "/usr/local/lib/python3.12/site-packages/pyinim/cloud/abc.py", line 51, in get_devices_extended
  File "/usr/local/lib/python3.12/site-packages/pyinim/cloud/resolver.py", line 57, in str_to_devices

secret.yaml:

inim_alarm_client_id: "02be452b-4cea-439d-b3c0-123451123"
inim_alarm_device_id: "homeassistant"
inim_alarm_password: myverylongpassword
inim_alarm_username: myusername

configuration.yaml:

inim:
  password: !secret inim_alarm_password
  username: !secret inim_alarm_username
  client_id: !secret inim_alarm_client_id
  device_id: !secret inim_alarm_device_id

# alarm_control_panel:
#   - platform: inim
#     password: !secret inim_alarm_password
#     username: !secret inim_alarm_username
#     client_id: !secret inim_alarm_client_id
#     device_id: !secret inim_alarm_device_id
nidble commented 4 months ago

Hello @thekoma, thank you for your interest on this project.

From the information you posted, seems that the current issue is during the "startup/setup" phase. Going deeper, when the Inim API library fetches the devices you have available onto your cloud services.

In that case, my2cents if we can move this discussion to https://github.com/nidble/pyinim/tree/master. Please, feel free to follow the attached Readme.md and reproduce the issue you have by executing the running example.

Don't esitate to open a Issue if still needed.

Thank you.