thomasloven / lovelace-state-switch

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

Issue with deviceID #99

Open nghiaphan31 opened 1 year ago

nghiaphan31 commented 1 year ago

Hello,

I'm trying to use state-switch to display different cards depending on the deviceID, generated by browser-mod. It seems that none of the deviceID ever matches and it's always goes to the default case. See attached screenshot.

Capture d’écran 2022-12-05 à 11 31 03

I don't see where I could have missed something.

Can anyone help?

Thanks! Nghia

My code is as follows:

The registered browsers are:

Registered Browsers b0b2c8d6-27a5d050 (MacBookProNghia via http://homeassistant.local:8123/) Last connected: 28 seconds ago 11fafea3-91279fee (iPad Mini 4 de Nghia) Last connected: 2 weeks ago c01d517b-b7a0ee24 (Galaxy S10 Nghia) Last connected: 10 minutes ago 6ed3fec2-d0982924 (MacBookProNghia via https://*******.duckdns.org) Last connected: 38 seconds ago da878644-8a7a78a9 (MacBookPro Nghia via 192.168..) Last connected: 36 seconds ago

I have the following errors in my logs:

Logger: frontend.js.latest.202211080 Source: components/system_log/init.py:256 First occurred: December 4, 2022 at 10:35:11 PM (75 occurrences) Last logged: 11:29:11 AM

https://******.duckdns.org/browser-mod:0:0 Uncaught http://192.168.*.*:8123/lovelace/0:0:0 Uncaught https://******.duckdns.org/lovelace-yaml/0:0:0 Uncaught http://homeassistant.local:8123/browser-mod:0:0 Uncaught http://192.168.*.*:8123/config/logs:0:0 Uncaught

nghiaphan31 commented 1 year ago

I forgot to mention that calling the "Browser mod: popup" service from the Developper Tools, I can target each of the registered browsers without any issue. So I really don't understand where the problem could be.

Hello,

I'm trying to use state-switch to display different cards depending on the deviceID, generated by browser-mod. It seems that none of the deviceID ever matches and it's always goes to the default case. See attached screenshot. Capture d’écran 2022-12-05 à 11 31 03 I don't see where I could have missed something.

Can anyone help?

Thanks! Nghia

My code is as follows:

  • type: vertical-stack cards:

    • type: custom:state-switch entity: deviceID default: default states: "c01d517b-b7a0ee24": type : markdown content: > Mobile "b0b2c8d6-27a5d050": type : markdown content: > Desktop via homeassistant.local "da878644-8a7a78a9": type : markdown content: > Desktop via 192.168.. "6ed3fec2-d0982924": type : markdown content: > Desktop via ****.duckdns.org default: type : markdown content: > DEFAULT

    • type: horizontal-stack cards:

    • type : markdown content: > Standard mark down

The registered browsers are:

Registered Browsers b0b2c8d6-27a5d050 (MacBookProNghia via http://homeassistant.local:8123/) Last connected: 28 seconds ago 11fafea3-91279fee (iPad Mini 4 de Nghia) Last connected: 2 weeks ago c01d517b-b7a0ee24 (Galaxy S10 Nghia) Last connected: 10 minutes ago 6ed3fec2-d0982924 (MacBookProNghia via https://*****__.duckdns.org) Last connected: 38 seconds ago da878644-8a7a78a9 (MacBookPro Nghia via 192.168..) Last connected: 36 seconds ago

I have the following errors in my logs:

Logger: frontend.js.latest.202211080 Source: components/system_log/init.py:256 First occurred: December 4, 2022 at 10:35:11 PM (75 occurrences) Last logged: 11:29:11 AM

https://******.duckdns.org/browser-mod:0:0 Uncaught http://192.168.*.*:8123/lovelace/0:0:0 Uncaught https://******.duckdns.org/lovelace-yaml/0:0:0 Uncaught http://homeassistant.local:8123/browser-mod:0:0 Uncaught http://192.168.*.*:8123/config/logs:0:0 Uncaught

z06Drew commented 1 year ago

Have you made any progress on this, I'm having the exact same issue,

kaizersoje commented 1 year ago

I'm having the same issue as well.

burnsy180 commented 1 year ago

Same issue here

madasus commented 1 year ago

anyone ever fix? same issue here.

gapsna commented 4 months ago

same issue here. Anyone got a fix?