Buttons Linked? (they should not be)

Hi everyone :slight_smile:

I come here with a rather odd behavior on my dashboard.

I have 2 buttons, one control 1 entity in the living room, the other controls 2 entities in the bedroom. So far so good right?

Now, the idea is the buttons should have the same type of animation if the lights are ON, or OFF.

For some reason, when i click on the living room button, both buttons animate, but only the living room light turn on, and when i click on the bedroom button, there is no animation on the dashboard, but the bedroom lights turn on.

Im not sure what im missing here.

Code for bedroom lights:

type: custom:button-card
entity: sensor.master_bedroom_lights_status
name: Master Bedroom Lights
icon: mdi:lightbulb-group
size: 50px
styles:
  card:
    - height: 80px
    - width: 200px
  name:
    - font-size: 14px
    - font-weight: bold
  icon:
    - color: black
    - animation: none 1s ease infinite
state:
  - value: "on"
    styles:
      card:
        - background-color: cyan
      name:
        - color: black
        - font-weight: bold
      icon:
        - color: white
        - animation: blink 1s ease infinite
  - value: "off"
    styles:
      card:
        - background-color: grey
      name:
        - color: black
      icon:
        - color: black
        - animation: none
animations:
  rotate:
    0%:
      transform: rotate(0deg)
    100%:
      transform: rotate(360deg)
tap_action:
  action: call-service
  service: script.master_bedroom_lights

Script to call action on bedroom lights

alias: Master Bedroom lights
sequence:
  - target:
      entity_id:
        - light.bed_mk
        - light.bed_sk
    action: light.toggle
    data: {}
description: ""
icon: mdi:coach-lamp-variant

Code for the living room lights:

type: custom:button-card
entity: light.halo_living_room
name: Living Room Lights
icon: mdi:wall-sconce-flat
size: 50px
styles:
  card:
    - height: 80px
    - width: 200px
  name:
    - font-size: 14px
    - font-weight: bold
  icon:
    - color: white
    - animation: none 1s ease infinite
state:
  - value: "on"
    styles:
      card:
        - background-color: cyan
      name:
        - color: black
        - font-weight: bold
      icon:
        - color: white
        - animation: blink 1s ease infinite
  - value: "off"
    styles:
      card:
        - background-color: grey
      name:
        - color: black
      icon:
        - color: black
        - animation: none
animations:
  blink:
    0%:
      opacity: 1
    50%:
      opacity: 0
    100%:
      opacity: 1
tap_action:
  action: toggle

Odd behaviors detail:
in5ctoed

Can anyone help me understand this actions?
(ps i did already clear cache, reload yaml code, restart…)

Can you provide the details on sensor.master_bedroom_lights_status?

Dear @atlflyer you solved my issue.

# Template Sensor for tracking light states
template:
  - sensor:
      - name: "Master Bedroom Lights Status"
        unique_id: "master_bedroom_lights_status"
        state: >
          {% if is_state('light.bed_sk', 'on') or is_state('light.bed_mk', 'on') %}
            on
          {% else %}
            off
          {% endif %}

(already fixed it, tested and works :smiley: )

The template code, was calling up the lights in the living room, that was the issue.
I googled so much i forgot the first ever thing i made.

By the way, is this template still necessary if i want to control only 1 light/entity? would it be recomendable?

Many thanks