Same dashboard different data on different devices

No this is not a bug but a question on how I can do this.

I have one dashboard for my ThinkSmart devices. I have two of these devices which show the dashboard. I use the same user login for both devices.

Is it possible to show different values on some cards depending which device I show it on?

For example: I want the living room device to show the temperature in the living room but I want the home office device to show the temperature in the home office room.

Or do I have to make two dashboards (and even two users?) to get this done?
I do not want to make changes to the dashboards twice.

Any ideas?

You will need two different views, one view for each room. It is not possible to render the same dashboard view differently on two different devices.

Even if you used an input select (“room name”) to adjust the visibility of cards in a view, changes made in one room will instantly appear in the other room showing the same view.

Alright, well it was a long shot. I thought maybe I could do something with a template. If device_id is 1 then value = something else if device_id is 2 then value = something_different

So different dashboards it is :slight_smile:

Even if it were possible, and it might be with browser-mod, that would still change the card visibility in the view for all devices. The one view is rendered the same everywhere. Os which ever device was active last would create the view for all devices.

You would need Browser Mod to be able to differentiate the devices. Then I would use different dashboards and have Browser Mod set the default dashboard for each device.

There could be some other ways with UIX Forge and event spark, but in the end, you need something to broker your device id which is what Browser Mod gives you, so might as well use its default dashboard setting as well.

You could use many methods for minimising the yaml duplication for cards include UIX orge and Foundries.

If they are going to make a dashboard (or just a view) for each room they don’t need any of that. Just select the view for the appropriate room manually and leave it at that.

tbh, isnt that what Lovelace_gen was made for

create a single structure for your dashboard/view, and fill it with appropriate / relevant entities?

no yaml duplication, just the vars for the specifics.

Lovelace_gen By Thomas Loven seems to be still working

Jinjaboard is new, (not sure if out of experimental phase), by Jerome

Is dont use either, so just have a look and see if it fits the needs?

If you allow code, you can use custom:button-card to create an “unbound” entity selector. Its value can be different for each display device/browser/window. The selected value will persist until you navigate to a different dashboard or refresh the page. You can then use this value in any other card embedded within that custom button.

In the example below, the selector will disapear after you select something, replaced by a tile card (example requires latest dev version of custom:button-card)

Example
type: custom:button-card
show_ripple: false
variables:
  selectedEntity: "[[[ return this['my_temperature_entity']; ]]]"
  temperatureSelector: |
    [[[
      return html`
        <ha-entity-picker
          .hass=${hass}
          .includeDeviceClasses=${['temperature']}
          .value=${variables.selectedEntity}
          placeholder="Select a temperature entity"
          @value-changed=${e => {
            const selected = e.detail.value;
            this['my_temperature_entity'] = selected;
            /* manual card update */
            this.update();
          }}
        >
        </ha-entity-picker>`;
    ]]]
  tileCard:
    force_recreate: true
    card:
      type: tile
      entity: "[[[ return variables.selectedEntity; ]]]"
custom_fields: |
  [[[
    const fields = {};
    if (variables.selectedEntity)
      fields.tile = variables.tileCard;
    else
      fields.selector = variables.temperatureSelector
    return fields;
  ]]]
styles:
  card:
    - cursor: default
    - pointer-events: auto
    - padding: 8px
  grid:
    - display: block

Edit: or skip the entity selector and use some properties like user agent or screen bounds to differentiate your devices :slight_smile: the view will then not be reset on page refresh.