Grouping switch and light


I one room i have shelly as light and twinkly. I now want to have both items in one group (now it seperated). Does anybody have some advice how to do?Zajeta%20slika

This is how i have set items now

  - platform: mqtt
name: "Spalnica"
state_topic: "shellies/shelly1-12BD8E/relay/0"
command_topic: "shellies/shelly1-12BD8E/relay/0/command"
qos: 2
payload_on: "on"
payload_off: "off"

  - platform: command_line
name: Twinkly
    command_on: "python3 /config/python_scripts/ on"
    command_off: "python3 /config/python_scripts/ off" 
    command_state: "python3 /config/python_scripts/ state"
    value_template: "{{ value == \"1\" }}"
    friendly_name: Twinkly

name: Spalnica
icon: mdi:bed-empty
view: true
  - light.spalnica
  - switch.twinkly
  - media_player.spalnica_tv
  - media_player.kodispalnica

For situations like this, I like to create a new Light Switch entity, that will let you treat your switch as a light. Then you can combine that and your existing lights in a Light Group, for easier control of the entire group.

I have solved this using a Template Switch that controls the switch and the light.