RogerSelwyn / Home_Assistant_SkyQ_MediaPlayer

Home Assistant SkyQ Media player component
MIT License
101 stars 17 forks source link

Ip Address of sky box #139

Closed EHTiger66 closed 1 year ago

EHTiger66 commented 1 year ago

Sky Mini's because they are moved around the House , some times get Different IP Addresses , one box I can assign a static IP Address, the other for logistical reasons I can't. is it possible to add a feature to input IP Address to a Box already set up in the integration ?

RogerSelwyn commented 1 year ago

Is the box resolvable by name? If it is being assigned an IP by DHCP from your router and your HA instance can pick up name resolution from the router, then this should work.Alternatively, if the Mini is remote across the internet, then dynamic DNS would be able to hand out a static name.

EHTiger66 commented 1 year ago

Sorry Roger that is bit beyond my capabilities. i do know it is being given an IP by DHCP from the router

RogerSelwyn commented 1 year ago

Then use the name it registers as in the router instead of the IP address. In theory HA should be able to resolve that.

beardymarrow commented 1 year ago

Hi Roger, Sorry to comment on a closed issue, but specifying a hostname or FQDN for my Sky box doesn't allow it to be added, but it is resolvable. Adding it by IP works perfectly.

# nslookup SkyQ-Lounge
Server:         192.168.0.14
Address:        192.168.0.14:53

Name:   SkyQ-Lounge
Address: 192.168.0.134

Non-authoritative answer:

Can you help?

RogerSelwyn commented 1 year ago

That depends on where you resolving from. If it resolves from your pc that is not likely to be the route that HA uses. Supervised and HAOS have their own dns server in one of the containers they spin up. So have you tried resolving from within the HA container, typically using the Terminal/SSH addon?

beardymarrow commented 1 year ago

Thank you for such a quick response. That resolution was from the OS on HA (SSH to port 22222). You're right, the DNS resolution doesn't work from the container (Terminal/SSH addon). Any idea how I can get that to work (I run my own DNS server on my home network)?

RogerSelwyn commented 1 year ago

I never use it because I found getting ha to point to my Adguard server (addon) was a pain. But you can check your dns setup in the Terminal (I forget the the exact command) and check what ha is using as a forwarder. Looks like tours is non standard since it is at .14 rather than .1 or .254 The usual router IPs. So maybe ha is looking at the default gateway rather than your dns for local resolution.

beardymarrow commented 1 year ago

Yes, I don't run DNS on my router, it's on a separate dnsmasq server. Anyway, you've pointed me in the right direction (that DNS needs to resolve from the HA container, not just the OS), so I'll keep playing, and if not just resort to a static DHCP reservation and using IP. Thank you.

RogerSelwyn commented 1 year ago

You are best having a static ip, otherwise you may get it discovering twice as the ip changes, not sure I’ve tested that scenario in the new SSDP discovery functionally I added recently.

beardymarrow commented 1 year ago

Solved. I had to do this in the HA container via SSH/Terminal

ha dns options --servers dns://192.168.0.14
ha dns restart

and now it resolves against my internal DNS and I can add my Sky boxes by DNS name. Thanks a lot for your help. Putting this here in case anyone else needs/wants to do this.