Different subnet

Hello
On my router, I created a special subnet for smart devices and made routing on the router to raspberry from my personal network. And everything was fine. Until I bought a chromecast ultra and google nest mini device. These devices must be on your personal network to be able to manage them from your phone, but then they are not visible in the smart device subnet. How to make HA search for devices in a different subnet. Because I can ping both devices from raspberry, as I have prescribed static routing.

I was advised to do routing in Docker, but I couldn’t figure it out, maybe someone already did it and can help me with it.

1 Like

You can put them in the ‘smart devices’ subnet, they require functioning mDNS, you need to get an mDNS repeater setup between the networks.

I switched to handling chromecast notifications and other stuff in node-red since HA does not work anymore with chromecast if it is located in a different subnet. Node red does not complain about cast devices located on other subnets

In my case HA is located behind a ipsec vpn as it is located in a datacenter.

I actually found a more simple solution, than suffering from additional mDNS traffic which is generated when setting avahi in reflector mode.

You just basically need to configure avahi to announce your Cast device service.

Instructions

Install avahi:

apt install avahi-daemon

Example avahi config in /etc/avahi/avahi-daemon.conf:

[server]
use-ipv4=yes
use-ipv6=yes
check-response-ttl=no
use-iff-running=no
allow-interfaces=ens18

[publish]
publish-addresses=yes
publish-hinfo=yes
publish-workstation=no
publish-domain=yes

Then you need to place your Cast device service in /etc/avahi/services/cast-demo.service` :

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name>cast-demo</name>
  <service>
    <type>_googlecast._tcp</type>
    <port>8009</port>
    <host-name>cast-demo.local</host-name>
    <txt-record>fn=TV Demo</txt-record>
    <txt-record>md=SHIELD Android TV</txt-record>
    <txt-record>id=94fb2132-0ce6-11eb-adc1-0242ac120002</txt-record>
  </service>
</service-group>

service-name - can be anything
id - UUID, you can get one from here - https://www.uuidgenerator.net/version1
md - Model, can be anything
fn - Friendly name in Home assistant
host-name - can be anything, should end in .local or other domain specified in avahi config.

Then you need to place an IP of the device in /etc/avahi/hosts:

192.168.12.XX cast-demo.local

After that, restart avahi and Home assistant.