New Insteon version for beta testing - (Do not use since this is now in 0.111 and higher)

@teharris1 - thx for the update!

I get the following error:


2020-07-17 21:10:02 INFO (MainThread) [custom_components.insteon_teharris1_362ed75] Collecting https://github.com/teharris1/pyinsteon/tarball/patch6
  Using cached https://github.com/teharris1/pyinsteon/tarball/patch6
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied, skipping upgrade: async-generator in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (1.10)
Requirement already satisfied, skipping upgrade: pyserial in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (3.4)
Requirement already satisfied, skipping upgrade: aiohttp in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (3.6.1)
Requirement already satisfied, skipping upgrade: aiofiles in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (0.5.0)
Requirement already satisfied, skipping upgrade: pypubsub in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (4.0.3)
Requirement already satisfied, skipping upgrade: pyyaml in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (5.3.1)
Requirement already satisfied, skipping upgrade: pyserial-asyncio in /usr/local/lib/python3.7/site-packages (from pyinsteon==1.0.6) (0.4)
Requirement already satisfied, skipping upgrade: chardet<4.0,>=2.0 in /usr/local/lib/python3.7/site-packages (from aiohttp->pyinsteon==1.0.6) (3.0.4)
Requirement already satisfied, skipping upgrade: multidict<5.0,>=4.5 in /usr/local/lib/python3.7/site-packages (from aiohttp->pyinsteon==1.0.6) (4.7.6)
Requirement already satisfied, skipping upgrade: yarl<2.0,>=1.0 in /usr/local/lib/python3.7/site-packages (from aiohttp->pyinsteon==1.0.6) (1.4.2)
Requirement already satisfied, skipping upgrade: async-timeout<4.0,>=3.0 in /usr/local/lib/python3.7/site-packages (from aiohttp->pyinsteon==1.0.6) (3.0.1)
Requirement already satisfied, skipping upgrade: attrs>=17.3.0 in /usr/local/lib/python3.7/site-packages (from aiohttp->pyinsteon==1.0.6) (19.3.0)
Requirement already satisfied, skipping upgrade: idna>=2.0 in /usr/local/lib/python3.7/site-packages (from yarl<2.0,>=1.0->aiohttp->pyinsteon==1.0.6) (2.10)
Building wheels for collected packages: pyinsteon
  Building wheel for pyinsteon (PEP 517): started
  Building wheel for pyinsteon (PEP 517): finished with status 'done'
  Created wheel for pyinsteon: filename=pyinsteon-1.0.6-py3-none-any.whl size=217098 sha256=cbaa7ca3e2ff0e3971e5c0e05084e239d02b082d7dab069922dcd9061370cc29
  Stored in directory: /tmp/pip-ephem-wheel-cache-98abw1gb/wheels/21/a7/a0/f681303a8ca3e9d46cf25bfad4e69d52fa43e1b7705eef4b60
Successfully built pyinsteon
Installing collected packages: pyinsteon
  Attempting uninstall: pyinsteon
    Found existing installation: pyinsteon 1.0.6
    Uninstalling pyinsteon-1.0.6:
      Successfully uninstalled pyinsteon-1.0.6
Successfully installed pyinsteon-1.0.6

2020-07-17 21:10:02 INFO (MainThread) [homeassistant.setup] Setting up insteon
...
2020-07-17 21:10:10 ERROR (MainThread) [homeassistant.setup] Error during setup of component insteon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 193, in _async_setup_component
    result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/config/custom_components/insteon_teharris1_362ed75/__init__.py", line 105, in async_setup
    conf = config[DOMAIN]
KeyError: 'insteon2'
...

2020-07-17 21:10:10 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following integrations and platforms could not be set up:

 - [insteon](https://www.home-assistant.io/integrations/insteon)

Please check your config., notification_id=invalid_config>
...
2020-07-17 21:10:13 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following integrations and platforms could not be set up:

 - [insteon](https://www.home-assistant.io/integrations/insteon)

Please check your config. @ 2020-07-17T21:10:13.926031-05:00>>
...
2020-07-17 21:11:25 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=dismiss, service_data=notification_id=invalid_config>
2020-07-17 21:11:25 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following integrations and platforms could not be set up:

 - [insteon](https://www.home-assistant.io/integrations/insteon)

Please check your config. @ 2020-07-17T21:10:13.926031-05:00>, new_state=None>

Any ideas?

I did make the same change you did in my fork of pyinsteon, setting the timeout to 300. As a part of that, I versioned my fork to 1.0.6, the same as your patch6 - not sure if I created a conflict.

edit: Nevermind. I versioned my fork of pyinsteon to 1.0.5.1

@teharris1 - It looks like const.py refers to insteon2 and I set my domain to insteon. I won’t be able to make any changes or test for a day or so. As soon as I have more info, I’ll let you know.

@teharris1 I am still unable to figure out my 3 way switches. Any advice on what I am missing and where to look?

Slight change of plans. The pull request that was recently posted was rejected because it would have significantly delayed all HA integrations from loading., However, a new PR was approved that addresses the timeout issue which I believe will address much of the problem. This should be in the next patch release, which I believe will be either 0.112.6 or 0.113.0.

Also, the PR that introduces the config flow (i.e. configure Insteon using the UI rather than configuration.yaml) has been approved. I believe this will be brought into 0.114. This pull request also has a retry capability that will address any issue with the modem not being available at startup. The system will automatically retry to connect.

1 Like

@teharris1 - Thanks so much for the work!

It might be a little late, but I did get your previous insteon2 with pyinsteon 1.0.6 working. I just had to actually reference insteon2. Then I saw 0.113.0 was released with the new timeout setting! I am on 0.113.0 and all is working. Thanks again!

I think 113 doesn’t have the timeout changes, was rejected due conflicts with core component.

Re: the config flow… Will HA devices be created for existing entities automatically?

the time out issue has disappeared in 0.113 for me

@Alfonsolsl - 113 uses pyinsteon 1.0.7 which does have the new timeout of 300 (was 5).

@kressir is correct. 0.113.0 has the increased timeout. It does not have the connection retry however.

Yes, all existing entities will automatically get devices associated with them.

Is there a way to change a SwitchLinc’s LED brightness from HA? setLEDBrightness is the Insteon command, but I don’t believe there is a service call that lets me send arbitrary commands?

With the managed install and a USB PLM, could I shell out somehow to the CLI tools?

Thank you so much for this! Today I set up my first Raspberry Pi with the intent of migrating my home automation from a 2007 Mac Mini running an old version of Indigo. My house has about 20 Insteon devices throughout. I was so excited until I got to creating scenes and automation, and discovered I’d need to learn how to manually define and automate everything using yaml. What a pain.

@teich not yet. A few more releases it will be possible. I am working on a full UI to configure all device settings. Development is underway but I don’t expect it to be for at least 6 weeks or so.

@waltercoots I am not sure of your concern. All you should need is to define the connection to the modem (PLM or Hub) and the Insteon component will discover all of the devices connected to it. So if you are using a PLM all you need in a YAML file is

insteon:
  port: /dev/ttyUSB0

or whatever port your device is connected to.

1 Like

Sorry, I should have been more clear: I’ve not yet installed the beta Insteon component you’ve been working on. That said, Home Assistant discovered my devices, but because they’re “entities” and not “devices” I can’t add them to scenes or automations. Although I haven’t figured out how (and don’t expect to resolve it in this thread), I suspect there’s a workaround. It sounds like with this new component, I wouldn’t need one!

If you are using insteon from the core Home Assistant, then you are using the correct component. The beta was a refactoring of the old code prior to 0.111. So there is no reason to load a custom component to get the new code. The current code is built into all versions above 0.111.

As for automations and scenes, I see what you are saying but you should be able to create automations and scenes against entities rather than devices. This does not require editing YAML. The UI works for this. In either 0.115 or 0.116 (depending on when it gets through code review), the Insteon component will have devices associated with the entities so additional capabilities will be available then. So that is about 2 - 4 weeks away I believe.

I’m on 0.113.3. And I figured out my issue! For posterity: no entities were showing up within Configuration > Scenes > New Scene. After reading about the Scenes Editor, I discovered entities only show up when advanced mode is enabled for your user profile.

Good news. The pull request to introduce Insteon devices just go approved. It will be in 0.115 almost for sure. I am still working on the UI but I think I am going to put in an intermediate release with a set of services that allow users to add a device to an Insteon scene and to modify properties like LED on/off or Celsius / Fahrenheit. I need these for the UI anyway so it makes sense to release it sooner for those who want to automate turning the LED on/off at night (which seems to be a more common request than I would have thought :slight_smile: )

2 Likes

Hello!
Thanks a lot for implementing this @teharris1!! It’s definitely a lot more responsive (especially on scene triggers) than the previous library!

I do have a quick question that I was hoping someone might be able to help me with. I just added a Fanlinc module (to my setup. It appears to be linked correctly when I view it in Houselinc and I can trigger it in HA via scenes I’ve created in Houselinc, but for some reason it’s not auto-discovering when I start. Can someone help me troubleshoot this? I have debug logs enabled for the component but I don’t see it pop up in the discovered devices. I’m connected via a plm. Are devices auto-added via the PLM’s ALDB or is some other method used?

Thanks!
-Peter

Hi gang!

An update to what I wrote yesterday. I used a device_override entry (with correct cat/subcat) in configuration.yaml and the Fanlinc was successfully discovered with the correct entities created.

However, I do have an issue that is still confusing me. I’m using a Keypadlinc to control the fan from the wall, so to keep them synchronized, I created scenes corresponding to each state that include both the fanlinc and the keypadlinc. When I trigger the scenes via the insteon.scene_on service call, I do get an update from the Fanlinc reporting the current state as shown in the log entry:

2020-08-17 09:20:43 DEBUG (MainThread) [homeassistant.components.insteon.insteon_entity] Received update for device 51ceb6 group 2 value 85

but the entity state doesn’t appear to be updated:

speed: off
insteon_address: XX.XX.XX
insteon_group: 2
friendly_name: Living Room Ceiling Fan
supported_features: 1

Edit: this is also the case when I trigger directly from the keypadlinc buttons The Insteon component recieves a message with the updated state of the fanlinc, but doesn’t seem to correctly update the state of the entity.

Is this an issue with the integration?
Your help is definitely appreciated.
Thanks!