Skip to content

Instantly share code, notes, and snippets.

@jhenkens
Last active May 6, 2022 15:53
Show Gist options
  • Save jhenkens/ba085ccdd80e6653cb09de794fbd0fa0 to your computer and use it in GitHub Desktop.
Save jhenkens/ba085ccdd80e6653cb09de794fbd0fa0 to your computer and use it in GitHub Desktop.
insteon_scene_creator_reload:
alias: Insteon Scene Creator - Reload
sequence:
- service: input_select.set_options
data:
entity_id: input_select.insteon_scene_creator_insteon_devices
options: "{% set entities = integration_entities(\"insteon\") %} {% set data\
\ = namespace(devices=[]) %} {% for i in entities %}\n {% set data.devices\
\ = data.devices + [device_attr(i, \"name_by_user\")] %}\n{% endfor %} {{\
\ data.devices | unique | sort }}"
mode: single
insteon_scene_creator_add_link:
alias: Insteon Scene Creator - Add Link
sequence:
- service: insteon.add_all_link
data:
group: "{{ states('input_number.insteon_scene_creator_scene_number') | int }}"
mode: controller
mode: single
icon: mdi:home-group-plus
insteon_scene_creator_add_link_2:
alias: Insteon Scene Creator - Remove Link
sequence:
- service: insteon.delete_all_link
data:
group: "{{ states('input_number.insteon_scene_creator_scene_number') | int }}"
mode: single
icon: mdi:home-group-minus
insteon_scene_creator_scene_on:
alias: Insteon Scene Creator - Scene On
sequence:
- service: insteon.scene_on
data:
group: "{{ states('input_number.insteon_scene_creator_scene_number') | int }}"
mode: single
icon: mdi:lightbulb-multiple
insteon_scene_creator_scene_off:
alias: Insteon Scene Creator - Scene Off
sequence:
- service: insteon.scene_off
data:
group: "{{ states('input_number.insteon_scene_creator_scene_number') | int }}"
mode: single
icon: mdi:lightbulb-multiple-off
- theme: Mushroom
title: Insteon Scene Creator
path: scene_creator
icon: mdi:movie
badges: []
cards:
- square: false
columns: 1
type: grid
cards:
- type: custom:mushroom-title-card
title: Insteon Scene Creator
- type: entities
entities:
- entity: input_select.insteon_scene_creator_insteon_devices
name: Target Insteon Device
title: Select Insteon Device
- type: custom:auto-entities
filter:
template: >-
{{
device_entities(device_id(states('input_select.insteon_scene_creator_insteon_devices')))
| list }}
card:
type: entities
title: Set Device Properties
show_header_toggle: false
- type: entities
entities:
- entity: input_number.insteon_scene_creator_scene_number
name: Target Insteon Scene
title: Select Insteon Scene
- type: custom:mushroom-title-card
title: >-
Use the above settings to choose a device, set its desired state,
and then choose a scene #.
Then, press add to put the hub into add-link mode for the given
scene. After you press the button, you will have to hit the
SET/link button on the corresponding device.
Finally, use the On/Off buttons to call on/off on the scene to
test it.
- square: false
columns: 2
type: grid
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: script.insteon_scene_creator_add_link
name: Add
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: script.insteon_scene_creator_remove_link
name: Remove
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: script.insteon_scene_creator_scene_on
name: Test On
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: script.insteon_scene_creator_scene_off
name: Test Off
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: script.insteon_scene_creator_reload
name: Reload Devices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment