Lovelace : Change Icon colour on main page on event state on another page

Hi,
I was wondering how to reference and change an icon colour of a card on the main page when a state changes on another page. I use hacs - Card-mod - button-card etc. I can change an icon colour on a button click for example as shown below on page 2
buthow do I change an icon colour of a card on another page when i click a button on this page.
So I need to point to a button on another page to change its icon colour for example.
Many Thanks for your assistance.


main page

page 2

Why not use template code on the custom button card that you want to change colour, such that the icon colour is moded on the state value (on/off) of the button you are clicking (on another view). There is a state moding option in custom button card,
Well there is on this one at least: https://github.com/custom-cards/button-card

Thanks for your suggestion.
In the end i used an input Boolean helper as the entity attached to the button card on the main page. Then I used several automations with OR condition to change the helper depending on the button card states on the second page. So the objective being that if any heating switches are activated on the second page the icon colour on the main page heating will change to a warm colour and if no heating is on it will remain an ice colour.
"
type: ‘custom:button-card’
layout: icon_label
icon: ‘mdi:radiator’
entity: input_boolean.heating_icon_colour_change_main_page
show_label: true
show_icon: true
show_state: false
show_name: false
label: Heating
size: 30px
styles:
card:
- box-shadow: 0px 0px 20px 8px
- border-radius: 15px
- margin: 0px 5px 0px 0px
label:
- padding: 5px
- font-size: 20px
- font-weight: bold
- font-family: Helvetica
state:

  • value: ‘on’
    color: ‘rgb(255, 150, 3)’
    icon: ‘mdi:radiator’
  • value: ‘off’
    color: ‘rgb(165, 242, 243)’
    icon: ‘mdi:radiator’
    tap_action:
    action: navigate
    navigation_path: /lovelace-agb/heating
    "
    #above is for Heating Card on main page.
    "
    type: ‘custom:button-card’
    layout: icon_label
    tap_action:
    action: toggle
    entity: input_boolean.bedroom_heat_boost_for_1hr
    show_label: true
    show_icon: true
    show_state: false
    show_name: false
    size: 60px
    styles:
    card:
    • box-shadow: 0px 0px 20px 8px
    • border-radius: 15px
    • margin: 0px 5px 0px 0px
      label:
    • padding: 5px
    • font-size: 15px
    • font-weight: bold
    • font-family: Helvetica
      state:
  • value: ‘on’
    color: ‘rgb(255, 150, 3)’
    icon: ‘mdi:bed’
    label: Bedroom Heat 1hr
  • value: ‘off’
    color: ‘rgb(142, 169, 250)’
    icon: ‘mdi:radiator-off’
    label: Bedroom Heat 1hr
    "
    #above is a sample button second page
    "
    alias: Setting Heating Icon Colour Toggle
    description: ‘’
    trigger:
  • platform: state
    entity_id: switch.heating_bedrooms
    from: ‘off’
    to: ‘on’
  • platform: state
    entity_id: switch.heating_kitchen
    from: ‘off’
    to: ‘on’
  • platform: state
    entity_id: switch.heating_sitting_room
    from: ‘off’
    to: ‘on’
    condition:
  • condition: state
    entity_id: input_boolean.heating_icon_colour_change_main_page
    state: ‘off’
    action:
  • service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.heating_icon_colour_change_main_page
    mode: single
    "
    #above is one of my automations
    it took 4 in total to achieve.

very long winded but works