b0mbays / continuously_casting_dashboards

HACS Integration for continuously casting a Home Assistant dashboard to your Google Chromecast Displays
MIT License
215 stars 11 forks source link

Seems to start casting but asks login #2

Closed Tokn59 closed 1 year ago

Tokn59 commented 1 year ago

Hi, thanks for sharing this very interesting integration. Everything seems to work but I seem to be needing to login to HA on my Google Nest Hub ? Did I miss something in the setup ? Thanks for your help !!!

PS: Logfile only entry :

2023-03-25 10:28:41.901 ERROR (MainThread) [custom_components.ha-continuous-casting-dashboard.dashboard_caster] Timeout casting dashboard to Kitchen Display:

My code :

`homeassistant: auth_mfa_modules:

image

Tokn59 commented 1 year ago

homeassistant: auth_mfa_modules:

b0mbays commented 1 year ago

Hey @Tokn59 , it looks like you are missing the /32 after the IP inside the trusted_networks for the device. For example, one of my devices looks like this:

192.168.12.217/32

Tokn59 commented 1 year ago

Thank you for the quick reply !!!

Have googled but no specific answer, do you know if this is also the correct port number for a Google Nest Hub ? Not at home this weekend so can’t test …

Sent from my iPhone

On 25 Mar 2023, at 10:52, b0mbays @.***> wrote:



Hey @Tokn59https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTokn59&data=05%7C01%7C%7C59e8053c69d04d0dd3c508db2d16a633%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153347518817396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=bCW4KbMxLPwNl7MpuErUJ13B%2FBLqA4Vquy%2BUrnFyvak%3D&reserved=0 , it looks like you are missing the port number inside the trusted_users for the device. You need to open port number 32. For example, one of my devices looks like this:

192.168.12.217/32

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fb0mbays%2Fha-continuously-casting-dashboard%2Fissues%2F2%23issuecomment-1483781536&data=05%7C01%7C%7C59e8053c69d04d0dd3c508db2d16a633%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153347518817396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=nPysZfLK1dmsk0970glrAjCvO8QWZG80Gr%2FgvABBY78%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACGJZ72VPWLBITGJMLWBNN3W52553ANCNFSM6AAAAAAWHMT4BM&data=05%7C01%7C%7C59e8053c69d04d0dd3c508db2d16a633%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153347518817396%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=xcXPFJKRYlnEC6WX698MJSwsvdZAw9NIGJQd23QP7Hg%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

b0mbays commented 1 year ago

Hey @Tokn59, yes you are required to provide this number for any device, not specifically the Google Nest Hub. Inside the guide I linked in the readme, it has the following:

Captures

Hope this helps! Let me know if this fixes it and i'll close this issue.

Tokn59 commented 1 year ago

Why the IP address entries ? To cast on 3 devices simultaneously ?

From: b0mbays @.> Sent: Saturday, 25 March 2023 13:44 To: b0mbays/ha-continuously-casting-dashboard @.> Cc: Tokn59 @.>; Mention @.> Subject: Re: [b0mbays/ha-continuously-casting-dashboard] Seems to start casting but asks login (Issue #2)

Hey @Tokn59https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTokn59&data=05%7C01%7C%7C1f052dd0abd9466d2d0708db2d2ea222%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153450533720849%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Aq7oUlK%2BoJGWpi%2FWR3%2Fayo8FE6VOVZ%2F701BVyvGfTu4%3D&reserved=0, yes you are required to provide this port number for any device, not specifically the Google Nest Hub. Inside the guide I linked in the readme, it has the following:

[Captures]https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F55556007%2F227717941-d9a9595b-8f1a-4241-98b3-0dd7efaca8a3.PNG&data=05%7C01%7C%7C1f052dd0abd9466d2d0708db2d2ea222%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153450533720849%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oiKNtNE1WoKjGne5GrUbZcHu2OQPDGqhQx%2BupNzSGbo%3D&reserved=0

Hope this helps! Let me know if this fixes it and i'll close this issue.

- Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fb0mbays%2Fha-continuously-casting-dashboard%2Fissues%2F2%23issuecomment-1483815092&data=05%7C01%7C%7C1f052dd0abd9466d2d0708db2d2ea222%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153450533720849%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uNY8ie8APAY4aexepgvwElMLXXbAcNslVHErmC2tNwM%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACGJZ76SPYUEZRFRUJVWHKDW53SBVANCNFSM6AAAAAAWHMT4BM&data=05%7C01%7C%7C1f052dd0abd9466d2d0708db2d2ea222%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153450533720849%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ILaPx9ZQemXAuPt2VQaBlApyBuI19oURwgNiGU7%2FS5o%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

b0mbays commented 1 year ago

Yeah, I am using it for 3 different devices simultaneously. However, for your setup you just need to add the /32 after your display IP address and it shouldn't ask you to login anymore 👍

Tokn59 commented 1 year ago

Super, Thanks !!! I will check again on Monday when I get home. Have a nice weekend !

From: b0mbays @.> Sent: Saturday, 25 March 2023 15:59 To: b0mbays/ha-continuously-casting-dashboard @.> Cc: Tokn59 @.>; Mention @.> Subject: Re: [b0mbays/ha-continuously-casting-dashboard] Seems to start casting but asks login (Issue #2)

Yeah, I am using it for 3 different devices simultaneously. However, for your setup you just need to add the /32 after your display IP address and it shouldn't ask you to login anymore 👍

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fb0mbays%2Fha-continuously-casting-dashboard%2Fissues%2F2%23issuecomment-1483844971&data=05%7C01%7C%7Cac0527e799cb4d30eb9c08db2d417d45%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153531509016385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2Bp3ZsKCnVd%2BVcTW5PByUa1SH2nUrQcNIjqE2RTKSrbU%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACGJZ77TY4EUI26DR6JMQZLW54B33ANCNFSM6AAAAAAWHMT4BM&data=05%7C01%7C%7Cac0527e799cb4d30eb9c08db2d417d45%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638153531509016385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LKNnuxtvH%2Fqe5ogw78WzWnTtNrP21SQyijLGbhtPCEM%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

Tokn59 commented 1 year ago

Sorry, still not working (still asks for login and password) ... this is my current code :

192.168.1.254 = my Nest Hub on which appears the login screen 192.168.1.15:8443 = my home assistant 192.168.1.69 = the pc on which I am testing

image

b0mbays commented 1 year ago

That is odd. Do you have a admin user setup specifically to be the "Casting user"? Here is my setup for 3 dashboards using the same user. It might not make a difference but maybe only have one "trusted_user" for your display? user

config

b0mbays commented 1 year ago

Change the format to just be:

trusted_users: 192.168.1.254: admin-user-id

Don't include the '-'

Tokn59 commented 1 year ago

I removed one user from the list as per your suggestion. Same result. To be clear ...

in your example, 192.168.1.236: xxxxxxxxxxxx is the IP address of a casting device and the ID is the ID of a user who has rights in Ha for the specific dashboard you are showing, right ?

The IP address 192.168.1.12 is the IP address of your HA, right ?

Does the fact that the IURL for my HA is 192.3168.1.15:8443 (not 8123) makes any difference ?

Your comment : trusted_users: 192.168.1.254: admin-user-id --- you mean without a SPACE ?

Tokn59 commented 1 year ago

image

b0mbays commented 1 year ago

That looks good now. For testing, could you remove the the other 3 IP's from the trusted_networks section and only keep the 192.168.1.254/32? Then do a full Home Assistant restart and try again. (Also, maybe update to the latest integration version 1.1.0!)

Regarding your comments, yes you are correct. 192.168.1.236 is my casting device and the ID is the one who has admin rights.

192.168.1.12 is not my Home Assistant IP address, no. It's not listed on my configuration screenshot. However my HA IP is: http://192.168.12.104:8123

It shouldn't make any difference what your home assistant URL is as long as you can access it on your local network it should be fine.

Tokn59 commented 1 year ago

Oops ... when I change trusted_users: to trustedusers: then my HA instance goes into SAFE mode ?

b0mbays commented 1 year ago

:D Oops! Well at least you're in safe mode. Just change the config back and restart 👍

Tokn59 commented 1 year ago

image

Tokn59 commented 1 year ago

Damn ... still asks for username and password with the above config ?

b0mbays commented 1 year ago

Strange! OK, let's make sure this trusted_users functionality works for your Home Assitant instance. You said your PC IP address was: 192.168.1.69

Can you add that to the trusted_networks, then the same with trusted_users with the same user ID that you used in the screenshot. Restart home assistant.

Then on your PC open an incognito window and try to access your home assistant instance with the LOCAL IP address: 192.3168.1.15:8443 - You should bypass the login and go straight to your dashboard. Can you confirm?

(also, I'm wandering why your IP address for your HA has a '3168' as usually it's '168' 🤔 Probably not an issue though!)

Tokn59 commented 1 year ago

Sorry 192.3168.1.15:8443 is a typo ... the correct address is 192.168.1.15:8443

Tokn59 commented 1 year ago

Ok, adapted with your suggestiosn. When I try this from the incognito browser I get this:

image

When I click on "Trusted Networks" it logs me in correctly ...

b0mbays commented 1 year ago

Okay, that means the trusted_networks functionality is not working. It should log you in straight away! That's better news than just your Nest Hub not working with it.

Can you 100% confirm that is your IP address for that PC? Can you post a screenshot of your IP address for the PC either using a terminal or going into your network settings

Tokn59 commented 1 year ago

image

b0mbays commented 1 year ago

OK, can you post the configuration file?

Tokn59 commented 1 year ago

The full HA configuration.yaml ?

b0mbays commented 1 year ago

Just the relavent trusted_users/networks section :)

Tokn59 commented 1 year ago

image

image

b0mbays commented 1 year ago

Maybe the MFA you have setup is causing issues? Can you try removing:

auth_mfa_modules:

Tokn59 commented 1 year ago

Unfortunately not .. tested on the Nest hub as well as on Pc .. same behaviour ...

PS: Have to go out for about an hour so won't be responding quickly. THANK YOU so much for all your efforts !!!!

image

b0mbays commented 1 year ago

When you login normally do you have to use 2FA? Do you have to send a text or notification to your phone?

Tokn59 commented 1 year ago

No, it has been deactivated for now, certainly for the user I am testing with there's no 2FA ...

image

b0mbays commented 1 year ago

I don't even have that option in my settings, unless I have that section inside my configuration. Can you remove it completely, then restart home assistant? Then try again accessing home assistant using that URL on your PC.

Tokn59 commented 1 year ago

That option cannot be removed AFAIK ... It can be changed to ënabled"when you click on the currently logged in user :

image

So in this case "recovery"who is an admin user has 2FA disabled .... This is the user which's ID I am using in the Trusted users section

b0mbays commented 1 year ago

So have you removed the 'auth_mfa_modules' from the configuration and done a full restart? From reading the documentation the option to enable 2FA in settings should only be there if you have this inside your yaml...

b0mbays commented 1 year ago

Actually. I could be wrong as it's not going away now after removing it from my yaml file!

Tokn59 commented 1 year ago

Yes, just to be sure I just did a full system SHUTDOWN. As you can see in my CURRENT configuration.yaml file it is disabled (commented out). Maybe it's still there as an option because I used to make use of 2FA.

If we can't get it working I can easily set up a brand new HA instance on my Proxmox server from scratch and test with it. Should be a "virgin" configuration.yaml then ....

image

b0mbays commented 1 year ago

Screenshot_20230327_132028_Home Assistant

b0mbays commented 1 year ago

What does your users screen look like?

Tokn59 commented 1 year ago

Yes, just to be sure I just did a full system SHUTDOWN. As you can see in my CURRENT configuration.yaml file it is disabled (commented out). Maybe it's still there as an option because I used to make use of 2FA.

If we can't get it working I can easily set up a brand new HA instance on my Proxmox server from scratch and test with it. Should be a "virgin" configuration.yaml then ....

image

b0mbays commented 1 year ago

Within the trusted users, can you try adding /32 after your device IP's? Just like you have in trusted_networks

Tokn59 commented 1 year ago

What does your users screen look like?

image

Tokn59 commented 1 year ago

Done … but doesn’t change the behaviour either …

Complicated ! 😊

From: b0mbays @.> Sent: Monday, 27 March 2023 14:30 To: b0mbays/ha-continuously-casting-dashboard @.> Cc: Tokn59 @.>; Mention @.> Subject: Re: [b0mbays/ha-continuously-casting-dashboard] Seems to start casting but asks login (Issue #2)

Within the trusted users, can you try adding /32 after your device IP's? Just like you have in trusted_networks

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fb0mbays%2Fha-continuously-casting-dashboard%2Fissues%2F2%23issuecomment-1485049653&data=05%7C01%7C%7C70dc18398471436c0c8208db2ebef82d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155169967707926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JBBpKqRvsFp82FX1B%2FZnCFclt28MIDnv%2BFABNio9A1k%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACGJZ72YUTYXF2GJ5V3HCPDW6GB4DANCNFSM6AAAAAAWHMT4BM&data=05%7C01%7C%7C70dc18398471436c0c8208db2ebef82d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155169967707926%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ep3JDJXZZkbkdZDLisriIqj2jfgkKo8k9C7TaRsYmcs%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

b0mbays commented 1 year ago

I'm determined to sort this! Can you post your full configuration.yaml file. Maybe there's something else intefering.

Tokn59 commented 1 year ago

-----------------------------------------------------------------------------------------------------

HASS Configuration File

-----------------------------------------------------------------------------------------------------

http: server_port: 8443 # Use your chosen port use_x_forwarded_for: true trusted_proxies:

b0mbays commented 1 year ago

The only real difference I can see is you have manually set that port to 8443 within the http section:

This is mine:

http:
  use_x_forwarded_for: true
  trusted_proxies: 
   - 172.30.33.0/24

Could you remove that, restart home assistant and see if you can access Home assistant with the default port?

So it would be:

http://192.168.1.15:8123

Tokn59 commented 1 year ago

I will quickly change to the default 8123 and re-test ..

From: b0mbays @.> Sent: Monday, 27 March 2023 14:47 To: b0mbays/ha-continuously-casting-dashboard @.> Cc: Tokn59 @.>; Mention @.> Subject: Re: [b0mbays/ha-continuously-casting-dashboard] Seems to start casting but asks login (Issue #2)

The only real difference I can see is you have manually set that port to 8443 within the http section:

This is mine:

http:

use_x_forwarded_for: true

trusted_proxies:

Could you remove that, restart home assistant and see if you can access Home assistant with the default port?

So it would be:

http://192.168.1.15:8123https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2F192.168.1.15%3A8123%2F&data=05%7C01%7C%7C026b4ef1375643a0754208db2ec16c95%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155180574870017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5Bxtwu7kUBqDzel88B5uJDKGsHrWjVvsZkE%2Btq7RR0s%3D&reserved=0

- Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fb0mbays%2Fha-continuously-casting-dashboard%2Fissues%2F2%23issuecomment-1485060605&data=05%7C01%7C%7C026b4ef1375643a0754208db2ec16c95%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155180574870017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OnWmHQxltiptg%2BvYrlBSdGBq6WXI%2BJgaSeDs6l40iV0%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACGJZ7545FPQBEYIADR64GTW6GD6BANCNFSM6AAAAAAWHMT4BM&data=05%7C01%7C%7C026b4ef1375643a0754208db2ec16c95%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155180574870017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FFcnza8OlpU%2B0WvBlxAC0pZN8j1z%2B0gq9VS%2FlRxg1fE%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

b0mbays commented 1 year ago

You can just remove the line entirely 👍

Tokn59 commented 1 year ago

Ok, we van rule out this as well ... still the same ...

Tokn59 commented 1 year ago

Meanwhile I am building a new HA instance from scratch ....

b0mbays commented 1 year ago

I have just noticed you have"type: homeassistant" above "trusted_networks".. Maybe that was causing an issue?

Try moving that below so yours would look like this:

auth_providers:
    - type: trusted_networks:
      trusted_networks:
         - 192.168.1.254/32
         - 192.168.1.69/32
      trusted_users:
         192.168.1.254: <the user id>
         192.168.1.69: <the user id>
      allow_bypass_login: true
    - type: homeassistant

If that doesn't work, let's open up your Wifi network so that Home Assistant can be accesed from any device (as long as they are connected to your Wifi).

I can see in the terminal screenshot you sent earlier, your default gateway is:

192.168.1.1

image

Change the config to this:

auth_providers:
    - type: trusted_networks:
      trusted_networks:
         - 192.168.1.1/24
      allow_bypass_login: true
    - type: homeassistant

Delete the "trusted_users" section.

I'm hoping one of these solutions fixes things.. 🙏 🙏

b0mbays commented 1 year ago

I just moved mine above like yours on my config and it's asking me to login! I think that is the fix!!