PeteRager / lennoxs30

Home Assistant Lennox S40 / S30 / E30 / M30 integration
MIT License
87 stars 12 forks source link

Enhancement: Use zeroconf for configuration #334

Open rlippmann opened 1 month ago

rlippmann commented 1 month ago

Describe the solution you'd like S40 thermostats appear to advertise themselves via zeroconf as http services. It would be nice to use that for the config flow.

Details of your HVAC system (e.g heat pump, gas furnace, boiler, AC, external ventilation)

Additional context It appears to expose the service via: serial#_1._icomfort4._res._lii._http._tcp.local

PeteRager commented 1 month ago

I like the idea.

some challenges I see. Thoughts?

a) it won't work like it does in HA since by default the custom component is not installed b) the code needs a static IP to connect, so the user needs to configure this in the router and hence should know what it is, by auto configuring it they may have not do this step and when the lease changes it will no longer be connectable. c) do you know if custom components can integrate with zeroconf? I recall seeing that this is only supported for HA components as it doesn't scan the custom_components.

rlippmann commented 1 month ago

a) yeah, nothing you can really do about needing to install from HACS and having to restart b) the zeroconf entry does actually include the IP address, so you could have the config flow grab it from that, and on a failure, raise config entry not ready (or whatever the exception is), and restart the config flow to update the IP address c) i imagine it would work. you set zeroconf support in the manifest.json, which I think tells HA to use it for the config flow. maybe that was the case when you had to specify everything in yaml?

rlippmann commented 1 month ago

Actually, it gives you an mDNS SRV record, which you can then use mDNS to resolve to the IP address. The SRV record should always be the same, though.

PeteRager commented 3 weeks ago

I'd take a PR for this if you want to try. It's not a priority for me right now.