Insteon scene control - automations

My HA skills are less than my ISY and nodered skills so I am sure there is a more elegant way to do it in HA the what follows.

Just using HA you could create a binary sensor based on the scene. You could use a Template Switch - Home Assistant that reflects the status of the scene.

Then follow this to have a switch in lovelace that shows the status:

Would you be willing to buy a used ISY on ebay? The ISY natively out of the box presents scenes as switches in HA. Probably $100. If you have many insteon devices the ISY will blow you away compared to the insteon hub.

Are you able to run nodered? You could have a flow where the scene creates a switch entity. You could have that switch entity in lovelace. That switch would then toggle the automation (scene).

I’m lazy and would go the ISY route for all of its other benefits.

Certainly you can execute the scene, but it likely will not update in a two way fashion the status of your scene controllers. That should be expected though. Say I have a 6 button and use it to turn on three lights. If I go to those switches individually and turn them on, the scene button is out of sync and does not light. Pushing it will light the button an send the on, but they are already on. Introducing a third way to control them is not going to change that.

To the poster above me- I tested this and it does work. The behavior you describe means the devices are not cross-linked with each other. You can have any light in any scene control the keypad button or the entire scene.

This may not be worth it to you but this works for me. I use an ISY which can but purchased on ebay with a PLM serial modem (~$100). You may not be willing to do that but it works.

In HA my Insteon scenes are switch entities. I can control the scene off and on. If I control the scene in HA, the keypad button reflects the change. If I control it at the keypad, HA shows the correct status.

I doubt you can do this with the Insteon hub. If you use the ISY this will work. It directly integrates in HA.

That could be true. I use to have an ISY but it went bad and I did not want to shell out money for another. That said, I use HA most exclusively now. No desire to try and make them all play together and rarely touch 6 button controllers.

If you want some … I have a box full.

Sorry to revive this moderately zombie thread, but wanted to see how folks get the Scene ID number. I found an unanswered reddit question, but did find any answers. The insteon iOS app seems to allow you to find the Device ids by navigating to advanced settings of the device, but no such advanced setting seems to exist for Scenes.

Do you have access to an Android device? The old app shows the group number. If you don’t you could create a temporary login and use someone else’s device. I would do it if you want.

I could not find the group number in the “new” app.

Yes! That totally worked. I installed the Android app on an old tablet (I think it was an old version as I got a warning to update it) and it showed the scene id under “edit this” on the scenes tab. Thanks so much

Well I guess I celebrated too early. I was able to get the scene IDs. But calling it from the developer tools Service call or adding to an automation doesn’t trigger the scene. The latest UI has this nice interface where you just put the slider on the group number, so I don’t imagine it’s a syntax error. Here’s the Automation yaml entry

  • id: ‘1606013374243’
    alias: Turn On Lights at Dusk
    description: ‘’
    trigger:
    • platform: sun
      event: sunset
      offset: -01:00:00
      condition: []
      action:
    • service: insteon.scene_on
      data:
      group: 20
      mode: single

Any ideas how to debug this? The scene triggers both via the app and via Alexa.

The indenting looks wrong. Action is certainly not inside trigger

Yeah, sorry, I think the formatting got squashed based on how I posted it. Let me try again.

Does this still look wrong. That would be ideal if it was!


- id: '1606013374243'
  alias: Turn On Lights at Dusk
  description: ''
  trigger:
  - platform: sun
    event: sunset
    offset: -01:00:00
  condition: []
  action:
  - service: insteon.scene_on
    data:
      group: 20
  mode: single

did you ever get an answer for this?

I was too was trying to run scenes from Alexa and I have it working using switch.

My steps:
First I go to configuration and select devices. then I tab to entities to get the address of a switch in the scene I want.

Then I select Developer tools >> services >> insteon.print_im_all_link_database to list all my devices.

Find the switch by it’s address from what you found in the first step. Once found note the group number. It’s the scene and has been in all my cases.

In your configuration.yaml make the switch

switch:
  - platform: template
    switches:
      ktichen_lights:
        friendly_name: "Kitchen" #this is the name of the switch for your alexa command
        turn_on:
          service: script.device_kitchen_on
        turn_off:
          service: script.device_kitchen_off
  - platform: template  #next switch
    switches:
      game_room_lights:
        friendly_name: "Game room" #this is the name of the switch for your alexa command
        turn_on:
          service: script.device_game_room_on
        turn_off:
          service: script.device_game_room_off

Now in the scripts.yaml

device_kitchen_on:
  alias: Kitchen lights on
  sequence:
    - service: insteon.scene_on
      data:
        group: {the group number you found}
  mode: single
device_kitchen_off:
  alias: Kitchen lights off
  sequence:
    - service: insteon.scene_off
      data:
        group: {the group number you found}
  mode: single

device_game_room_on:
  alias: Game room lights on
  sequence:
    - service: insteon.scene_on
      data:
        group: {the group number you found}
  mode: single
device_game_room_off:
  alias: Game room lights off
  sequence:
    - service: insteon.scene_off
      data:
        group: {the group number you found}
  mode: single

If you have the the insteon switch named the same change it from kitchen to kitchen switch or something else.

Once you have restated HA and made sure all is running and you have ran Home Assistant Core Integration: Check configuration in the developer tools, ask Alexa to discover new devices. Once found you should be good to go.

One note here. I have found that the GUI will not update sometimes at all if you use a scene in the hub/plm and this method. If you can live with slower activation of the scene then I would recreate them in HA and not call scene_on. It is bypassing turning on individual lights and therefore if you have parts on the gui showing these lights, the state can get out of sync.

Opcode, thanks for this example it is working for me. However, how do you add the template switches to a dashboard?

rlfromm, Once I wrote the code for switch in the configuration.yaml and restart HA they should list under switch in overview. I’m running a Windows HA version found here GitHub - AlexxIT/HassWP: Portable version of Home Assistant for Windows (no need to install)

Being new to HA and being inste-pwned I did not want to spend a lot of time setting up a virtual machine when I plan to get a pi when available and that’s being if all works out with HA. Which so far so good.

So you are not seeing the Switch in Overview. Have you restarted? Have you ran the Home Assistant Core Integration: Check configuration to make sure it’s all running correctly?

kbrown01, I have tested both ways and I’m not a fan of each light coming on one after the other with at least a 4 sec delay when I used HA to control the lights not the scene. I have not had any issues yet running scene_on but I guess if I done I’ll go back. I had setup all the lights in the kitchen at my mother’s for her to turn all the light to a set level or all off. All lights are on separate circuits and it was so slow to change all of them unless using scene_on. For me, the scenes I run are 2-way and 3-way circuits. I have one 2-way set in HA as an automation because the scene was not setup after replacing a insteon switch.

I another note: When I added all my 70+ swtches to the hub years ago I had to make scenes for every circuit because with a scene in insteon I can set an on value for brightness. I also used scene to control the fan controller to voice the speed I wanted with Alexa. The dimmer switch I had turning on the fan on medium and if I doubled tapped the switch to full bright the fan would run on high.

Much of what I had programmed is offline until I can spend more time trying to get it working in HA. Having other issues like the ramp rate on one my switches go hosed to a very slow rate. I couldn’t get it reset at the switch so I had to reset it. Now it will not communicate wit the hub correctly so I have no HA control. I fear doing something bad a bricking my hub so I have not bothered trying to fix it.

@Opcode, I noted that I was (sort of) incorrect in my statements. I had the Insteon app hooked to my Alexa and when you used that (“Alexa, turn on Kitchen”) the GUI did not show the lights.

Since the demise of Insteon as a web app, I switched to HA (Nabu Casa) and updating in the HA interface is no longer an issue.

as for the rest, the guys at HA are working towards a complete GUI for managing things. You should look into Insteon control panel

I found the switch entities and added them to the dashboard and I run them from Alexa. So that’s good. However, I cannot find them as a device anywhere in Alexa. But they work great if you speak to Alexa.

I see you can create the scripts with the GUI, but what about the Swtiches you built in configuration.yaml? Is there a way to use the GUI instead of editing the yaml file?

Is there a way to make these switches appear in named “areas” instead of under “Switches” on the dashboard?