Error setting up broadlink with hostname instead of IP

Hello, there.

My new router doesnt have the option for static IP on LAN. I used to have this configuration for my Broadlink RM Mini:

switch:

  • platform: broadlink
    host: ‘192.168.0.XXX’
    mac: !secret broadlink_mac
    friendly_name: RM Mini
    type: rm_mini

But with the change of my router, there is no nome static IP for the broadlink device (the XXX above is no longer static).

On broadlink switch doc it states that “host” could be hostname or IP.
But when I use hostname I get the following error on Home Assistant startup:

2020-08-02 14:35:25 ERROR (MainThread) [homeassistant.components.switch] Error while setting up broadlink platform for switch
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 178, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/lib/python3.7/asyncio/tasks.py”, line 416, in wait_for
return fut.result()
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/broadlink/switch.py”, line 139, in async_setup_platform
connected = await broadlink_device.async_connect()
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/broadlink/device.py”, line 29, in async_connect
await self.hass.async_add_executor_job(self.api.auth)
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/broadlink/init.py”, line 224, in auth
response = self.send_packet(0x65, payload)
File “/srv/homeassistant/lib/python3.7/site-packages/broadlink/init.py”, line 296, in send_packet
cs.sendto(packet, self.host)

The new configuration is:

switch:

  • platform: broadlink
    host: ‘RMMINI-AA-BB-CC’
    mac: !secret broadlink_mac
    friendly_name: RM Mini
    type: rm_mini

(where AA-BB-CC are the last digits of the broadlink MAC. The hostname I got from the routers config page).

Any ideas on how to fix this? I really need to use the broadlink remote without the static IP feature.

Thanks.