Hi!
That config only creates Wi-Fi AP. Devices need IP address to work properly. IP address could be assigned manually on device, but not all devices support it, so we need a DHCP server to make things easy. DHCP server doesn’t have to be on Raspberry Pi itself, but it’s easier to have it on Pi. There is an addon for HASSio, called “DHCP Server”, so just install it (connect RPi via Ethernet to get access to it while Wi-Fi network is not configured yet).
Here is my config for that addon (all addons configuration available via Hass.io tab at Homeassistant webgui):
{
"default_lease": 86400,
"max_lease": 172800,
"domain": "local",
"dns": [
"8.8.8.8",
"8.8.4.4"
],
"networks": [
{
"subnet": "10.0.1.0",
"netmask": "255.255.255.0",
"range_start": "10.0.1.20", #This range is for automatic DHCP
"range_end": "10.0.1.40",
"broadcast": "255.255.255.255", #Important! Broadcast IP should be like this, otherwise device will not get DHCPOFFER package
"gateway": "10.0.1.1", #IP of RPi
"interface": "wlan0"
}
],
"hosts": [ #List of static IP addresses, because Homeassistant often needs static IP of sensor/switch/etc
{
"name": "Hassio", # RPi itself
"mac": "MAC",
"ip": "10.0.1.1"
},
{
"name": "XiaomiGateway",
"mac": "MAC",
"ip": "10.0.1.2"
},
* * *
]
}
Pay attention at broadcast option. Documentation says that it should be x.x.x.255, but as far as I know DHCP protocol, it’s not correct: device sends DHCPDISCOVER package to broadcast address 255.255.255.255, server gets it, sends DHCPOFFER back. And if we send DHCPOFFER to x.x.x.255 address, client device will not get it, DHCPOFFER should be sent to broadcast address. Maybe I wrong, or there is a bug in addon, but until I change broadcast address to 255.255.255.255, my client devices don’t get proper IP.