Grouping switch and light

Hi,

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

light:
  - 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"


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


  spalnica:
name: Spalnica
icon: mdi:bed-empty
view: true
entities:
  - 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.