Hey Insteon users!

Thanks. I’m still getting a bunch of errors.

2022-07-05 13:55:22 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'attributes' when rendering '{% set scene_number = (state_attr('input_select.insteon_modem_groups','options')[repeat.index - 1]) %} {% set glist = states.sensor.insteon_group_names.attributes %} {% set gstring = namespace(grname=[]) %}  {% set gstring.grname = 'Insteon Group ' + scene_number %} {% for gname in glist %} {% if state_attr('sensor.insteon_group_names',gname) == scene_number %} {% set gstring.grname = gstring.grname + ' (' + (gname | replace('_',' ')) + ')' %} {% endif %} {% endfor %} {{ gstring.grname }}'
2022-07-05 14:32:11 WARNING (MainThread) [homeassistant.helpers.entity_component] Forced update failed. Entity sensor.insteon_group_names not found.
2022-07-05 14:32:14 ERROR (MainThread) [homeassistant.config] Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/template.yaml, line 10). 
2022-07-05 14:32:14 ERROR (MainThread) [homeassistant.config] Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/template.yaml, line 36). 

any ideas?

Might be timing issues. What do you see if you look at that entity in Developer Tools?

The image is mine with all the groups.

The new posting suggests you have an issue with what is inside template.yaml. Post that here.

and

##
## These are template sensors. 
##
## Given an insteon Scene Number, return a list of entities
## This requires two pieces of information, the target address as well as the group number for multi-button, multi-outlet devices.
## In the code for the sensor, first a list is created using the Insteon Address and the actual button (or outlet) number
## Then this list is parsed against the entities themsleves to get the entities in the given Insteon Scene
##
## sensor.insteon_scene_entities
##
  - name: insteon_scene_entities
    state: "{{ 'OK' }}"
    attributes:
        scene_entities: "
{% set glist = state_attr('sensor.insteon_groups','groups') %}
{% set devices = namespace(switch=[]) %}
{% for value in glist %}
{% if (value.group | int == states('input_select.insteon_modem_groups') | int)  %}
{% set devices.switch = devices.switch + [(value.device_address[0:2] + '.' + value.device_address[2:-2] + '.' + value.device_address[-2:] + '_' + value.button | string) | upper] %}
{% endif %}
{% endfor %}
{% set gp = namespace(groups=[]) %}
{% for ent in integration_entities('insteon') %} 
{% if state_attr(ent,'insteon_address') + '_' + state_attr(ent,'insteon_group') | string in devices.switch %} 
{% set gp.groups = gp.groups + [ent] %}
{% endif %} 
{% endfor %} 
{{ gp.groups | unique | sort }}"

##
## This sensor for scene names and numbers is created by hand based on my installation. There is no local storage in the ALDB or hub where the group names from the Insteon app are stored.
## Using the app or just based on experiements, you can create a map like below for scene names and scene number.
## This just helps you use some friendly names but can be used in automations/scripts for turning on an Insteon scene by using a friendly name.
##
## sensor.insteon_group_names
##
  - name: insteon_group_names
    state: "
    {% for gpname in states.sensor.insteon_group_names.attributes %}
    {% if state_attr('sensor.insteon_group_names',gpname) == states('input_select.insteon_modem_groups') %} 
    {{ gpname | replace('_', ' ') }}
    {% endif %}
    {% endfor %}"
    attributes:
        Dining_Room: 10
        Studio: 11

Is this because i’m trying to define groups my insteon doesn’t believe exist yet?

I never tried that, I only created the group names after I knew them all. I would at least put every known group into the list. Or if you do not know, just put in something like:

Unknown_Group_34: 34
Unknown_Group_36: 36

Until you figure out what you called it.

it definitely does not like my template file!

2022-07-05 20:30:12 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: list object has no element 1 when rendering '{{ states.input_select.insteon_devices.state.split('(')[1].split(')')[0] }}'
2022-07-05 20:30:12 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states.input_select.insteon_devices.state.split('(')[1].split(')')[0] }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1842, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "
  File "/usr/local/lib/python3.9/site-packages/jinja2/sandbox.py", line 326, in getattr
    value = getattr(obj, attribute)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1868, in _fail_with_undefined_error
    raise ex
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1859, in _fail_with_undefined_error
    return super()._fail_with_undefined_error(*args, **kwargs)
jinja2.exceptions.UndefinedError: list object has no element 1
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 525, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 411, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: list object has no element 1
2022-07-05 20:30:12 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: list object has no element 1') while processing template 'Template("{{ states.input_select.insteon_devices.state.split('(')[1].split(')')[0] }}")' for attribute '_attr_native_value' in entity 'sensor.selected_insteon_device'
2022-07-05 20:30:12 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states('input_number.target_insteon_group')|int }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1842, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1634, in forgiving_int_filter
    raise_no_default("int", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1331, in raise_no_default
    raise ValueError(
ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ states('input_number.target_insteon_group')|int }}' but no default was specified
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 525, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 411, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ states('input_number.target_insteon_group')|int }}' but no default was specified
2022-07-05 20:30:12 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: int got invalid input 'unknown' when rendering template '{{ states('input_number.target_insteon_group')|int }}' but no default was specified') while processing template 'Template("{{ states('input_number.target_insteon_group')|int }}")' for attribute '_attr_native_value' in entity 'sensor.targeted_insteon_group'

this is my template file:

##
## These are template sensors. 
##
## Given an insteon Scene Number, return a list of entities
## This requires two pieces of information, the target address as well as the group number for multi-button, multi-outlet devices.
## In the code for the sensor, first a list is created using the Insteon Address and the actual button (or outlet) number
## Then this list is parsed against the entities themsleves to get the entities in the given Insteon Scene
##
## sensor.insteon_scene_entities
##
  - name: insteon_scene_entities
    state: "{{ 'OK' }}"
    attributes:
        scene_entities: "
{% set glist = state_attr('sensor.insteon_groups','groups') %}
{% set devices = namespace(switch=[]) %}
{% for value in glist %}
{% if (value.group | int == states('input_select.insteon_modem_groups') | int)  %}
{% set devices.switch = devices.switch + [(value.device_address[0:2] + '.' + value.device_address[2:-2] + '.' + value.device_address[-2:] + '_' + value.button | string) | upper] %}
{% endif %}
{% endfor %}
{% set gp = namespace(groups=[]) %}
{% for ent in integration_entities('insteon') %} 
{% if state_attr(ent,'insteon_address') + '_' + state_attr(ent,'insteon_group') | string in devices.switch %} 
{% set gp.groups = gp.groups + [ent] %}
{% endif %} 
{% endfor %} 
{{ gp.groups | unique | sort }}"

##
## This sensor for scene names and numbers is created by hand based on my installation. There is no local storage in the ALDB or hub where the group names from the Insteon app are stored.
## Using the app or just based on experiements, you can create a map like below for scene names and scene number.
## This just helps you use some friendly names but can be used in automations/scripts for turning on an Insteon scene by using a friendly name.
##
## sensor.insteon_group_names
##
  - name: insteon_group_names
    state: "
    {% for gpname in states.sensor.insteon_group_names.attributes %}
    {% if state_attr('sensor.insteon_group_names',gpname) == states('input_select.insteon_modem_groups') %} 
    {{ gpname | replace('_', ' ') }}
    {% endif %}
    {% endfor %}"
    attributes:
        Unknown_Group_34: 34
        Unknown_Group_36: 36
        Unknown_Group_105: 105
        Unknown_Group_254: 254

and when i try to change the select item i get this:

2022-07-05 20:39:30 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities input_number.target_insteon_group or it is/they are currently not available
2022-07-05 20:39:30 WARNING (MainThread) [homeassistant.helpers.entity_component] Forced update failed. Entity sensor.insteon_group_names not found.
2022-07-05 20:39:32 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'None' has no attribute 'attributes' when rendering '{% set scene_number = (state_attr('input_select.insteon_modem_groups','options')[repeat.index - 1]) %} {% set glist = states.sensor.insteon_group_names.attributes %} {% set gstring = namespace(grname=[]) %}  {% set gstring.grname = 'Insteon Group ' + scene_number %} {% for gname in glist %} {% if state_attr('sensor.insteon_group_names',gname) == scene_number %} {% set gstring.grname = gstring.grname + ' (' + (gname | replace('_',' ')) + ')' %} {% endif %} {% endfor %} {{ gstring.grname }}'

i’ll try to find out how to nuke these groups from any devices and then try this all again. In both Indigo & Insteon-MQTT we could remove links but it doesn’t appear we can from the native integration.

@kbrown01 Thanks for all the hard work on this dashboard. I’ve been following it for a few weeks, but only get a few hours here and there to work on it.

This is the first work I’ve done with Home Assistant, but your explorer was a great starting point!

I figured out a few new things including the use of “packages” in HA and have created a pull request against your repo @ https://github.com/kbrown01/insteon-scene-explorer/pull/3

@jkmaxwell - I saw that you created a pull request as well. Since you are using the code too, It’d be great if you could be a second set of eyes on the code or even try out the package version for some feedback.

1 Like

Thanks guys! Looks like some great changes here. I will go back and revisit them in a while. I am a little stuck right now not because of this … much of this exists for us to control things at our winery. And the most important thing is “da music”. The latest updates in HA broke the monoprice installation and I modified that for the Dayton Audio DAX88 … so I am caught without being able to change anything right now during high season for wine tasting.

When I get finished with that I will post to Github the update to support the audio.
Then I have a full Vizio Television and DirecTV remote system that kicks and have been working with folks on that one.
And then the iBBQ-4T meat thermometers.

Because as stated, once Insteon is up and running I am not adding many more devices (I do have maybe 10 more switches/dimmers/outlets to put in. At that time I will revisit this and get back to it.

All I can say is this is so fun, especially with help from folks like you.

1 Like

In the native integration you mark them as not in use. This is what is really happening in the other solutions as well in reality. I chose to have them still show up (but hidden by default) because I find that I sometimes want to activate and deactivate links on occasion. By making them available to view it makes it easier to reactivate an old link if you want to vs recreating the link from scratch.

I have ans on/off insteon switch . Has worked fine for years . I just moved it to a different room. For a different ceiling light. Every half hour or so it keeps turning on by itself. Anyone ever have this problem ?

Hello,

I have an insteon on/off switch that has been working for years. and soon as insteon went down and i got home assistant it continued on working just fine. I moved that outlet to a different room/circuit in the house, (well within range of HUB), and now it just shows that the light is on all the time in home assistant. Works fine if i hit the switch manually. But I tried deletingi the card and adding the entity back and same results.

I reset it manually at the switch, and it still shows up on the HA insteon tab, just wondering if you had any ideas

I read from someone that adding it back in the app(assuming its still back up with new owners) can fix poblem. But when i tried this the app says my HUB is off line, and under info it shows the wrong xx:xx:xx So Im out of ideas

Also, I have 4 dimmers that work fine. It’s just he switch I moved to another room

Do you pay for Nabu Casa for Alexa insteon integration? Or is it no longer necessary now that my insteon HUB is green again?

I use Nabu Casa. This is because I can control everything (not just Insteon) through it. Also Insteon service is a paid for subscription. I have no reason to buy it because I use Nabu Casa subscription.

So regarding Nabu Casa. I just switched over and paid for the year. My account is active. Is there anything I need to do to get Alexa to work with my insteon lights now? Long story short - I had my own coding in AWS, working perfectly so I didn’t need to bother with subscription. Account got hacked and I temporarily lost 7000 dollars from my bank. After a month dealing with amazon(the worst customer service in history) i got money back and my account it PERMANANTLY closed. But soon as I closed account, HA works fine, but alexa say s"Ok" as if its working but it wont turn insteon stuff on or off. Anything I need to do that you can think of? Sorry for the run on question.

Even the routines I have set up with script. If I click the button in home assistant it works fine. If I click the same button in Alexa app(or ask alexa verbally) says ok but NADA.

Do you have the Insteon Alexa app installed? If yes you need to remove it. Sounds to me like it is going through that or someother path. All I did was remove Alexa Insteon integration, then add Alexa Home Assistant/Nabu integration and then you can see everything in the HA GUI under:

Cloud → Alexa → Manage Entities

Does anyone know if, or have ApplianceLinc 2456S3 running in the HA Insteon integration?

Thank you

It would be fantastic if the dashboard @kbrown01 did became part of the official integration. I’m going to play around with the groups tonight so I can fix my theater control.

Good news. I just posted an update to the Insteon Panel that will now allow for the creation and editing of Insteon scenes. It does not have everything that @kbrown01 did but it at least makes it a lot easier to manage your Insteon scenes without doing the nitty-gritty work in the All-Link Database.

4 Likes

Question for this thread: I’m just now bringing my legacy Insteon devices (a few switches and KPLs) into my HA setup. The Insteons are configured the way I want them to be, for the most part - no scenes, primarily just responders/controllers so that if I press a certain KPL button, multiple Insteon switches will turn on/off. It all works just fine…

In integration Insteon into HA, I’m trying to figure out whether it makes more sense to leave the responder/controller settings the way I have them, or whether I should blow them all out and just use HA automations to drive the actions (so if you press button H on a given KPL, it’s an HA automation that then turns the switches on).

Is there a best practice here? It feels like using responders/controllers is the “right” way for the switches to talk to one another, but it also feels like I should be consistent for my overall smart home, and have all actions being driven from one source - ie, HA.

Thanks in advance for any thoughts!
jtf

I still have an ISY994 running my insteon because I haven’t had time to move everything over yet, but I’m hoping to be able to in a few months. So I’m a little behind you, but have thought about how to do it already.
The main reason I would NOT use home assistant automations is because you don’t need to!
If you leave your insteon the way it is it will work regardless of what happens with home assistant, but if you wipe everything and something happens to home assistant then hitting that H button will only turn the light on for the H button. I would say let home assistant be a supplemental thing…not the basket where you place all of your eggs. Just my opinion.

I would do a test using one set of KPL+lights to see whether the responsiveness of a HA automation compares favorably to the perfectly synchronized experience of native Insteon links. If it has a popcorn effect then you just made your decision easier.