thomasloven / lovelace-state-switch

🔹Dynamically replace lovelace cards depending on occasion
MIT License
403 stars 27 forks source link

How deviceID / browserID is working with state-switch? #123

Open pickonedev opened 3 weeks ago

pickonedev commented 3 weeks ago

Hi!

I am trying to show a card, based of the device/browser ID, but it is not working... Any help, please?

I tested with the deviceID from fully kiosk device, but also from browser mod device integration... I don't understand what to use as deviceID, but even so, with what I have tested, it is not working...

type: custom:state-switch
entity: deviceID (tested with browserID as well)
states:
  e7e9f6b5-56c2c14a:
    type: markdown
    content: |
      Computer
  e7e5f6b5-56c2ffaa:
    type: markdown
    content: |
      Tablet

What I am missinng?

cuongpl commented 1 week ago

@pickonedev Find your correct deviceID, it's not browserID. You can find your deviceID by typing localStorage["lovelace-player-device-id"] into your browsers console.