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?