How to Migrate from Ecobee Cloud Integration to Local HomeKit Controller

I am adding here to share my experience with setting up an Ecobee Thermostat but the main difference for me is my HA runs in a docker container.

In a docker container “being on the same network” is not trivial. The docker network is typically a 172.0.0.0/16 range and the host machine is sitting on the same range as your network router. The mDNS broadcasts from the HA container to auto-discover the thermostat do not make it to the router’s network where the thermostat lives.

To get around this the easiest method is to add network_mode: host to your compose config for HA. However I have many containers running and already configured a lot of integrations in HA using the docker domain names so i would have to reconfigure a lot of I change the network mode. I also have HA behind a reverse proxy so i want to continue to use the proxy to pass traffic to the HA container and dont want to change that.

So how do I get only mDNS discovery pings to get to my host machine’s network?
I used an mdns repeater aptly named mdns-repeater docker container found here. I then configured this docker container using the following compose settings:

  mdns-repeater:
    image: monstrenyatko/mdns-repeater:latest
    container_name: mdns-repeater
    restart: unless-stopped
    command: mdns-repeater-app -f br-77625678b050 eno1
    network_mode: "host"

The important part is configuring the command. The two parameters passed are the network interfaces I want this container to repeat. So br-77625678b050 is the docker network my HA lives on and eno1 is the network my host machine lives on.

You can find the host interface by:

  1. Run ifconfig on your host machine
  2. Find the ip range your host machine lives on
  3. Record the interface name

You can find the docker network interface by:

  1. Run docker network inspect <network-name> on your host machine
  2. Search for the Subnet range. It will look like:
 "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
  1. Run ifconfig
  2. Search for what interface name matches the subnet range

Once you boot the container it will repeat the mDNS discovery from your HA container’s network to the host machine’s network. After this i was able to setup the Homekit Controller normally and the mDNS found me thermostat

One more thing! The pairing code for my thermostat was not in the format specified in the original post nor the documentation. It was simply 8 numbers with no hpyhens.

2 Likes

Thanks for posting this Homekit procedure as it worked perfect for me. The ecobee cloud update was always so delayed it was unusable for automations. Since I have 2 thermostats but only one furnace, I had struggled trying to get accurate runtimes since ecobee stats treat each thermostat as a separate entity. After using your procedure I set up an automation that would activate a virtual switch using as a trigger the status hvac_current action going from idle to heat for both thermostats. Created a second automation that triggers on ecobee going back to idle. The idle automation had a condition statement making sure both thermostats were in idle before toggling the switch to off.

At this point the virtual switch has the perfect run time statistics since it’s tracking both thermostats. I then created daily, weekly, monthly, and quarterly utility meter historical sensors so the stats are not gone after the standard 10 days I have within HA. I just completed all this but will need to see if the stats stay after 10 days but I have no reason to believe they won’t. I then replicated the above to track the central air system using “cooling” instead of “heating” havac action.


Thanks @automateit for the write-up, this is super helpful! I am considering buying an Ecobee thermostat and was curious if it is still true that the only valid options are home, away, or sleep that can be called from the HomeKit Controller?

Does it matter where the custom scenes are created to be able to call from HomeKit?

From this video, it seems like more HomeKit scenes can be created, but it must be done from the Ecobee app? I also see a note in ecobee’s support that says “The ecobee app features additional scene functionality not available in the Apple Home app”. I was wondering if creating the scenes in this way affected your ability to call those custom scenes from Home Assistant via HomeKit? Thanks!

I have an older Ecobee3. You might want to add as a prerequisite that you need a HomeKit-compatible Ecobee (the original Ecobee3 does not appear to be compatible.)

I assume nobody has figured out a way to communicate locally with the non-HomeKit Ecobees since they are presumably designed only to communicate with the Ecobee servers?

My ecobee 3 has the HomeKit functionality. My ecobee3 states a version number of 4.8.7.134. I’ve had these units for many years.

1 Like

@jbonzey yes, you have a Homekit-Compatible Ecobee3. Not all of us are so fortunate. See here for Ecobee’s Homekit documentation.

I am migrating from Ecobee cloud. I recommended the device from the ecobee cloud site … reset the device, then configured it back onto the network. When it was discovered I used the Homekit code displayed on the device … and it now appears in HA. But when I check out the Home app, it says accessory not responding.

Thoughts?

Thanks for the now 2-year old write up! I’m a new Ecobee user and struggling a bit with this part. I want to use HA scheduling but set the comfort setting on the Ecobee instead of a target temperature.

I’m unable to target my Ecobee when trying to use the set preset mode action, so I take that to mean I need to create a custom select helper, which I have done. But what action do I then use to take the selected option to set the comfort mode on my Ecobee?

I think I do what you are targeting. On Ecobee I have my Home, Away, and Sleep comfort settings set and I’ve set the schedule to something general but set hold duration to “until you change it”. That way Home Assistant changes persist. I have allowed follow me for temperature balancing and eco+ for smart away only.
For changing the comfort setting I use the action select.select_option and give the option of “Home” “Away” etc. No temperature settings in my Home Assistant automation, just select.select_option. Side note, in the visual editor it looks like the action is called select: select