Bug on insteon setup?

If I setup the insteon component on my configuration.yaml and the login info is incorrect the configuration will pass the verification but when restart the server the frontend doesn’t start, the log via ssh says retry connection with insteon in xx seconds, if you’re quick you can restart the pc via webterminal, next, the ssh and webterminal breaks too.

Only exit it’s manually restart the machine.

Should be a time limit to connection in this case or not?

In addition, if somebody decide to unplug my insteon hub that will cause all my frontend and configurator don’t load.

Curious.

Thanks for bringing this to my attention. All indications are that the startup process for insteon should be non-blocking but I tested the same situation and you are right. i am not sure why the startup hangs. I will look into it. Hopefully it is not a common situation that the password is wrong or the Hub is unplugged at startup :wink:

Thanks for look it, my issues starts when in the insteon app change my login and passw, the app said success but i never be able to ingress, plus this bug, was not a easy debug process, finally I discover the app never changed the default user and password and when I finally wrote the original on my configuration, works.

So, the insteon app itself has other bug changing login data apparently.

Hey men! This is pretty alive isn’t it?

Mine blocked right now for changing the port number to the PLM.

I thought the safe mode of HA will catch it, but no. Put on his knees the server.

Hi @Alfonsolsl, I am sorry but your note above is a bit hard to follow. Can I suggest you post in your native language and I will use Google translate to interpret it?

Excuse me, I’m using it right now (Gtranslate). the startup bug when Insteon is misconfigured is still present. I thought that with HA safe mode it would not happen.I changed the TTY port of my PLM and it blocked the whole system on reboot.

Ah, OK, yes it is still there but there should be a fix in version 0.110 or 0.111. I have made a massive overhaul of the Insteon solution that will show great improvements in a number of areas. If you want to preview the release you can download it here:

Hey thanks! I will try it ASAP.

i got this:

Error during setup of component insteon2
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in _async_setup_component
    hass, processed_config
  File "/config/custom_components/insteon2/__init__.py", line 136, in async_setup
    workdir=hass.config.config_dir, id_devices=0, load_modem_aldb=0
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/device_manager.py", line 148, in async_load
    devices = await saved_devices_manager.async_load()
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/saved_devices_manager.py", line 222, in async_load
    device = _dict_to_device(saved_device)
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/saved_devices_manager.py", line 48, in _dict_to_device
    device = create_device(device_id)
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/utils.py", line 19, in create_device
    product.model,
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/window_coverings.py", line 32, in __init__
    address, cat, subcat, firmware, description, model, state_name=COVER
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/open_close_controller_base.py", line 33, in __init__
    super().__init__(address, cat, subcat, firmware, description, model)
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/device_base.py", line 69, in __init__
    self._subscribe_to_handelers_and_managers()
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/open_close_responder_base.py", line 97, in _subscribe_to_handelers_and_managers
    super()._subscribe_to_handelers_and_managers()
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/open_close_controller_base.py", line 84, in _subscribe_to_handelers_and_managers
    self._managers[1].subscribe_off(self._events[self._open_event_name].trigger)
KeyError: 'open_event'

ok, found this https://github.com/teharris1/insteon2/issues/8#issuecomment-615544072

May help add it to the readme.

updated manually and get the same i think.

Source: custom_components/insteon2/__init__.py:136 
First occurred: 3:36:32 PM (1 occurrences) 
Last logged: 3:36:32 PM

Error during setup of component insteon2
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in _async_setup_component
    hass, processed_config
  File "/config/custom_components/insteon2/__init__.py", line 136, in async_setup
    workdir=hass.config.config_dir, id_devices=0, load_modem_aldb=0
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/device_manager.py", line 148, in async_load
    devices = await saved_devices_manager.async_load()
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/saved_devices_manager.py", line 222, in async_load
    device = _dict_to_device(saved_device)
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/saved_devices_manager.py", line 48, in _dict_to_device
    device = create_device(device_id)
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/managers/utils.py", line 19, in create_device
    product.model,
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/window_coverings.py", line 32, in __init__
    address, cat, subcat, firmware, description, model, state_name=COVER
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/open_close_controller_base.py", line 33, in __init__
    super().__init__(address, cat, subcat, firmware, description, model)
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/device_base.py", line 69, in __init__
    self._subscribe_to_handelers_and_managers()
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/open_close_responder_base.py", line 97, in _subscribe_to_handelers_and_managers
    super()._subscribe_to_handelers_and_managers()
  File "/usr/local/lib/python3.7/site-packages/pyinsteon/device_types/open_close_controller_base.py", line 84, in _subscribe_to_handelers_and_managers
    self._managers[1].subscribe_off(self._events[self._open_event_name].trigger)
KeyError: 'open_event'

You must be the first person to have a window covering device. These are your Micro Open/Close devices we discussed in a different thread I assume. Let me get right on that.

I see where the issue is. Are you able to edit python files?

let’s try, shoot me.

I have visual studio code and cloned your repo already.

What is your system (HassIO, vitualenv, etc.)? Do you know how to fine your python site-packages directory?

i use HassIO on a RP3+.

And no, maybe i did it before but not knowing what exactly what i’m was doing.

If you have any instructions i’ll be glad to help.

Can’t really edit site-packages in HassIO. I will have to post an update to fix this. Sorry. I should have that done tonight however.

Don’t worry! thank you.

Should be good now. Reinstall insteon2 from the repository and the Micro Open/Close devices should work.

sorry men but: i can now use the other switches but don’t recognize the open/close.

For me it doesn’t matter cos i’m using it like a repeater only, but should work.

Logger: homeassistant.components.cover
Source: custom_components/insteon2/cover.py:35 
Integration: Cover (documentation, issues) 
First occurred: 11:30:18 PM (1 occurrences) 
Last logged: 11:30:18 PM

Error while setting up insteon2 platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 445, in _async_add_entity
    entity.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 181, in state
    closed = self.is_closed
  File "/config/custom_components/insteon2/cover.py", line 45, in is_closed
    return bool(self.current_cover_position)
  File "/config/custom_components/insteon2/cover.py", line 35, in current_cover_position
    return int(math.ceil(self._insteon_device_group.value * 100 / 255))
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'