mattlongman / Hassio-Access-Point

Hass.io addon to let you create a WiFi access point, perfect for using WiFi devices on off-grid installations.
MIT License
81 stars 63 forks source link

[Feature request] mDNS for wlan0 #17

Open kotyara75 opened 2 years ago

kotyara75 commented 2 years ago

Hi, thanks for making this plugin, for me it turned out to be the only way of enabling AP on HA OS.

I miss connecting to HA by .local name over AP connection though. I can see that in HA core it's implemented for eth0 using Network Manager, and I'm struggling to enable it for unmanaged wlan0 interface controlled by the plugin.

Should we add avahi daemon to this plugin? Or, anybody has better ideas? I'm happy to help with coding once we agreed on the approach.

Trakt0r22 commented 1 year ago

@CarlosGS How did you manage to get your ESPHome devices to connect to your hassio instance? I've been trying to flash an ESP8266 I had lying around to connect to the HASSIO instance I have, but It cannot seem to register in the ESPHome gui nor in Homeassistant. Wierdly enough I can see it connect in the logs for this access point add on, which tells me it should work. Any pointers you can give me or articles I can read? Been trying to google this with no progress.

Here's what I flash my espdevice with, if that helps? I can connect to the AP with an android phone and access homeassistant so it can't be that either.


esphome:
  name: wrist-device

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxx"

ota:
  password: "xxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Wrist-Device Fallback Hotspot"
    password: "xxxxxxxxxx"

captive_portal:

output:
- id: onboard_light
  platform: gpio
  pin: GPIO2
  inverted: true

CarlosGS commented 1 year ago

Hi! In the end I've set a fixed IP for each device. It simply needs an IP outside the DHCP range.

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.99.2 # (.3, .4, etc)
    gateway: 192.168.99.1
    subnet: 255.255.255.0

Then you need to manually connect them to Home Assistant (Devices->Add->Esphome->type node's IP). In your case, try doing that and typing "wrist-device.local" instead of an IP. Maybe it will resolve the address and allow you to use it without needing a fixed IP.

Domigome commented 2 months ago

@CarlosGS Thank you, this solved my problem with EspHome devices not being discovered on my home assistant.

Sadly I have a long way ahead to go and reflash every single EspHome device to assign a new ip to each.

Also I have some other devices and addons which entities don't appear probably due to the same reason (those ones I cannot reflash).

Does anyone knows if there any setting on Haasio Access Point or Home assistant to help?

ROBOT0-VT commented 2 months ago

Hiya, I'm looking into configuring the hotspot to act as an mDNS relay, just haven't had time to work on it in a bit. It's in the pipeline :D

There aren't any config options that can fix this, for the moment