Handling dimming for ISY scenes and devices

I have a large INSTEON installation controlled by an ISY controller. In the ISY setup, there are multiple 3- and 4-way switch setups combined into a scene (this is a default setup for INSTEON, where multiple light switches are configured to control the same load, they all also control each other, to keep the indicator lights on each switch in sync). The ISY component detects each device as a light, and each scene as a switch.

The problem I have is trying to leverage the scene setup to deal with dimming. In the ISY (and even without the ISY, just relying on the INSTEON mesh network), dimming one switch in a 3-or-more-way setup dims all the others, as well as the “scene” of which they are all a part.

In Home Assistant, since the scene is imported as a switch domain, there is no brightness attribute to the scene. I can hide the particular switch in Home Assistant that corresponds to the scene, and group the switches together as a group, and specify a brightness level that way, but this also requires quite a bit more INSTEON network traffic to accomplish the same thing (iteratively sending a dimming signal to each light in the group), rather than sending a single scene command.

Is there any way to force an ISY scene to be imported into HA as a light instead of as a switch? Is there a better method of handling INSTEON scenes I should know of?

1 Like

You can’t really DIM a scene on the ISY. I think you can issue the DIM/BRIGHTEN command which steps you 3% in each direction, but you can’t issue a set scene to 50% type of command.

I did the following because I wanted it to work with Alexa and be able to tell her to set a %.

On the ISY:
Create a scene and put only the responders in that scene. Say your real scene had switch 1 (with load) and switch 2, switch 3, then create a scene and only put switch 2 and switch 3 in it Then create a program. In that program, the IF statement will look and see if the status of the device is OFF. If it is off, then turn off the “fix” scene, otherwise, turn on the “fix” scene.

It is a hassle, and I’m not sure if it causes other issues, but it is the only way I can get full dimming ability on the ISY and use scenes.

There was a thread a while back where people asked and UDI said no because Insteon doesn’t support setting a dim level on a scene. People asked UDI to “fake” it and just set % on the devices inside a scene, but there was a lot of, what if this, what if that, how should it work this way, or that way, etc etc so I gave up on them ever doing anything like that.

Edit: I forgot to say, once you have the real scene, the fix it scene, and the fix it program, what you want to expose to Alexa or HA is the device (the one that is used in the program and typically has the real load). Forget the scene even exists.

Thanks for your reply! I think I understand what you’re proposing, but won’t the “fix it” scene cause the indicators on the non-load switches (responders 2 and 3) to be disconnected from the load switch when it’s dimmed? E.g., in the proposed logic, if HA tells switch one to dim to 50%, then the program goes to the ELSE statement and sets the “fix it” scene to “ON”, which pushes the dimming level of the responder switches to whatever the scene brightness was (default 100%). That’s not a catastrophe, but it is unfortunately not making good use of the INSTEON indicators. Is that what you see happening when you use this approach? As a fix, are you aware of any programmatic way in ISY to extract a brightness level from one device as a variable, to then apply to others?

Alternatively, perhaps some automation in HA? I’m not sure of the syntax for extracting the brightness and passing it to the other switches, but perhaps it would look like this:

automation:
  trigger:
    platform: state
    entity_id: light.landing_cans_1_by_gym
    to: 'OFF'
  action: 
    service: homeassistant.turn_off
    entity_id: 
      - light.landing_cans_2_rear_stairs
      - light.landing_cans_3_by_kaylee
      - light.landing_cans_4_by_babys
      - light.landing_cans_5_by_guest
      - light.landing_cans_6_front_stairs
      - switch.landing_cans

automation 2:
  trigger:
    platform: numeric_state
    entity_id: light.landing_cans_1_by_gym
    value_template: '{{ state.attributes.brightness }}'
    above: 1
  action: 
    service: homeassistant.turn_on
    entity_id:
      - light.landing_cans_2_rear_stairs
      - light.landing_cans_3_by_kaylee
      - light.landing_cans_4_by_babys
      - light.landing_cans_5_by_guest
      - light.landing_cans_6_front_stairs
    data_template:
      brightness: '{{ trigger.to_state.attributes.brightness }}'

The only disconnect I get is that the secondary switches do not correctly reflect the dim level on local leds. The main switch will have, say 50% of the lights lit up, but the secondary switches show all the lights lit.

I don’t know about a pure HA solution. I have only been running HA for a couple days. I would worry about if you can update the switches as responders, aka, for them to receive the level and for them to not try to broadcast the change out on the insteon network.

I might poke at the ISY rest ap and see if there is a way to just change the led status on the switches. No matter what, any fix is going to be ugly.

Well, if you like ugly fixes, here’s what I’ve got:

Two automations in HA for each ISY multi-switch scene, together with hiding both the switch and the non-load switches in a customization. To wit:

  customize:
# Landing Can Group
    light.landing_cans_2_rear_stairs:
      hidden: true
    light.landing_cans_3_by_kaylee:
      hidden: true
    light.landing_cans_4_by_babys:
      hidden: true
    light.landing_cans_5_by_guest:
      hidden: true
    light.landing_cans_6_front_stairs:
      hidden: true
    switch.landing_cans:
      hidden: true

automation:
  trigger:
    platform: state
    entity_id: light.landing_cans_1_by_gym
    to: 'off'
  action: 
    service: homeassistant.turn_off
    entity_id: 
      - light.landing_cans_2_rear_stairs
      - light.landing_cans_3_by_kaylee
      - light.landing_cans_4_by_babys
      - light.landing_cans_5_by_guest
      - light.landing_cans_6_front_stairs

automation 2:
  trigger:
    platform: state
    entity_id: light.landing_cans_1_by_gym
    to: 'on'
  action: 
    service: homeassistant.turn_on
    entity_id:
      - light.landing_cans_2_rear_stairs
      - light.landing_cans_3_by_kaylee
      - light.landing_cans_4_by_babys
      - light.landing_cans_5_by_guest
      - light.landing_cans_6_front_stairs
    data_template:
      brightness: '{{ trigger.to_state.attributes.brightness }}'

It’s not necessary to specify the switch domain element imported from ISY in either automation – once all the devices are off, the switch is updated to off (as you can confirm if you don’t hide it with a customization), and once even one device is turned on, the switch element (corresponding to the ISY scene) is set to state “on”.

Actually, it only takes one automation per group of switches - you can use the homeassistant.turn_on service to set brightness to 0, which updates the state to off:

automation
  - alias: 'Dimmer Fix Master Bath Cans'
    trigger:
      platform: state
      entity_id: light.master_bath_cans_1
    action: 
      service: homeassistant.turn_on
      entity_id:
        - light.master_bath_cans_2
      data_template:
        brightness: '{{ trigger.to_state.attributes.brightness }}'

Is the brightness reflected on the secondary switches? I use the paddle switches and there is a vertical row of LEDS that light up that reflect the current on level. That is the one thing that is out of sync on my ISY only approach.

Yup! It works like a charm. For dimmer switches, anyways. For switchlinc devices, I use two programs, since you can’t pass brightness data to a switch.

Just to clarify, for dimmer switches, like the “2477d” you use one program, and for the toggle only switches, the “2477s” is what you use a 2 program solution for?

I would really, really like to duplicate this over on the ISY itself, but until they get their 5.0 release stable, I don’t think you can, in a program, set the brightness or on level of one device to that of another. 5.0 is not stable at the moment and at the rate they are going, it’ll be another year before it is stable.

I might have to implement this solution. And then, start looking at zwave alternatives so I can ditch the ISY.

Correct. If you have multiple 2477D and 2477DH dimmer switches in a scene where they are all controllers, a single HA automation entry like this one:

  - alias: 'Dimmer Fix Kitchen Cans'
    trigger:
      platform: state
      entity_id: light.kitchen_cans_1_by_mudroom
    action: 
      service: homeassistant.turn_on
      entity_id:
        - light.kitchen_cans_2_by_thermostat
        - light.kitchen_cans_3_by_nook
        - light.kitchen_cans_4_in_mudroom
      data_template:
        brightness: '{{ trigger.to_state.attributes.brightness }}'

works to detect when the first switch (the only one that you would leave un-hidden in HA) changes state, and adjusts the brightness of all the other switches (and therefore their indicator pips) in the same scene. I have multiple n-way INSTEON dimmer setups in my home, and this has worked great to keep all their indicators in sync. In HA, I simply hide all the non-load-bearing switches in the scene, together with the switch that’s imported from ISY to represent the scene, and the only remaining switch that it visible works to control the whole scene.

For Switchlinc 2477S devices, where dimming is not possible, they show up in HA as switches instead of as lights. Therefore, the automation programs that I wrote for the multiple-dimmer-scene won’t work (since you can’t pass brightness data to a switch in HA). For those, I use this pair of automations:

  - alias: 'Indicator Fix Garage On'
    trigger:
      platform: state
      entity_id: switch.garage_lights_1_by_side_yard
      to: 'on'
    action: 
      service: homeassistant.turn_on
      entity_id:
        - switch.garage_lights

  - alias: 'Indicator Fix Garage Off'
    trigger:
      platform: state
      entity_id: switch.garage_lights_1_by_side_yard
      to: 'off'
    action: 
      service: homeassistant.turn_off
      entity_id:
        - switch.garage_lights

And then I hide the non-load bearing switch (in this case, switch.garage_lights) and the scene-representing switch imported from ISY.

Good information and clearly written, thanks!

I’m guessing it would work with the keypads as the non-load bearing devices such as the 2334-222 (8 button) and the 2334-232 (6 button). It looks like I’ll be busy this weekend writing a bunch of automations.

Now to figure out the best way to get my fans with the fanlinc (2475f) working correctly in HA with the 2334-232 as the controller.

I can confirm it does work with the keypads – the example I posted for my garage lights uses one 2477S (switch.garage_lights_1_by_side_yard) and one 2334-232, where the top and bottom buttons are, collectively, one switch (switch.garage_lights). I believe that there are some additional switches associated with the keypad (in HA, each of the four middle buttons of the 2334-232 is imported as a switch, and each scene that separately controls the illumination of each of those four keypad buttons is also imported, as a different switch), but I think the principle of the automation should be applicable across those devices.

Ah, well, I’ll have to play around because my 2334-222 buttons are also a controller for scenes with a 2477D (dimming). I need to verify I entered everything correctly, but my first shot worked at updating the secondary non-load 2477D but it didn’t turn on the button for the 2334-222. It might be I didn’t enter the entity correctly or something.

I’ll post back when I figure it out.

See post #5

Ok, so it looks like only the main button on a KPL can be controlled with a direct command. I will have to put all the secondary buttons in their own scene and send an on/off to that scene to get the secondary KPL buttons to stay in sync…

Edit: So what I did was go back to what I was doing earlier, but only for KPL secondary buttons. Those are all handled in ISY with a program and scenes. I used your program for my 2 different 3 ways to keep the dim levels in sync with the primary.

I think, with 5.0, if it is ever stabilized would allow us to put all this logic in the ISY. I’ll revisit when it is released.

With a little sober reflection, I realized that two-program automation solution for switches is unnecessary – instead of exposing the load-bearing switch and hiding both the non-load-bearing switches and the scene of which they are all controllers, I hide all the switches and expose the scene. Since there’s no lights involved, there never can be a brightness level sent (my keypad is the switch-style, not the dimmer-style), so just using the ISY scene is the simplest and fastest solution for that n-way arrangement.

This seems to have stopped working since my update to v37 (maybe v36 or earlier?). Hmm.

Did it start working for you with v38? I am having some issues after upgrading to v38. I see this in my log:

17-02-21 13:07:57 ERROR (MainThread) [homeassistant.core] Invalid service data for light.turn_on: expected int for dictionary value @ data[‘brightness’]. Got ‘’

It used to work, but after the update, nope.

- alias: Fix Kitchen Lights
  hide_entity: True
  trigger:
    platform: state
    entity_id: light.kitchen_lights
  action:
    service: homeassistant.turn_on
    entity_id:
        - light.kitchen_cabinet_lights
    data_template:
        brightness: '{{ trigger.to_state.attributes.brightness }}'

I confirmed I still have an entity ‘light.kitchen_lights’ and it has a brightness attribute. Is the attributes not making it across in the to_state property of the trigger?

Sorry to Necro this old thread but was wondering if anyone got this all dialed in.

The issue I’m having is that if I control the ISY scene in Home Assistant, everything works fine BUT I can’t dim. If I control the load, that also had a KPL button in it and try to send turn the lights on to say 50%, when Home Assistant turns on the KPL button to match the states, it also turns the load on to 100%.

It seems that this code works well if you only have switches OR lights but not a mix. Has anyone gotten this figured out?

This is what is working for me (0.92b3):

- alias: Fix Downstairs Staircase
  hide_entity: True
  trigger:
    platform: state
    entity_id: light.downstairs_staircase
  action:
    service: homeassistant.turn_on
    entity_id:
        - light.downstairs_s
    data_template:
        brightness: >
          {% if is_state('light.downstairs_staircase','off') %}
            0
          {%- else -%}
            {{ trigger.to_state.attributes.brightness | int }}
          {%- endif -%}

So – playing around with this some more, I decided I didn’t like HA sending a second command every time I controlled that light (via HA, ISY, Alexa, or–dun, dun, dun–the physical switches. I decided to move things back to the ISY (using 5.0.13 beta):

Using some inspiration from this post:

For this sample scene, I have a light controlled physically controlled by a 6-button keypad’s main output, a slave “paddle” dimmer as a 3-way switch, and a button on an 8-button keypad upstairs that also controls the scene and shows the status.

To keep things in sync across the ISY, HA, Alexa, and the physical switches:

  1. State variable to hold the brightness value. In this example it’s s.First_Floor_Hall_Dim_Level.

  2. A program that follows the switch with the load and keeps the variable up to date:

  3. A program that watches the variable compared to the slave device–if it doesn’t match, it waits 2 seconds in case the scene was controlled (if the scene was controlled, then it should sync up in a moment and cancel the program). If after 2 seconds, the scene hasn’t updated–update the slave devices.

  4. Since I’m using one of the non-“controllable” buttons on a 3rd keypadlinc, I have a scene with just the button as a responder. When this is called by the program with a %, it will either go on or off.
    scene