Aprilaire Thermostat 8800 any MODBUS experts?

This is exciting! I’ve been trying to get the wifi kit for months now! Can’t wait to see the git page once it is up! I’ve been on the fence with replacing my Aprilaire system just because it won’t integrate with the house/system.

Out of curiosity is it Local Polling/Pushing? Or is it talking to the Aprilaire Servers and making a bunch of API requests?

If you’d like to have a look at the Github, it is here: GitHub - chamberlain2007/aprilaire-ha If you want to try it out, you can add it to HACS and run through the integration flow with the IP.

Please note that the biggest concern I have right now is regarding stability. You may experience a connection drop and/or data not updating, which could require restarting the thermostat. I am working through some options around this. If you want to give it a try please do, but this is definitely not completed or bug free, and I may push breaking changes at any time. If you’d prefer to wait until it is stable and fully ready for use, I will certainly let this thread know.

It is using local push. There is very minimal network traffic (a couple of bytes of data to update and when a change of state is triggered on the thermostat). There are some instances in which it will send a request to the thermostat to send back an asynchronous response with current data, however this is again on the order of a few bytes of data. It does not communicate with Aprilaire’s servers and does not require any external network access.

2 Likes

Yes it should be compatible with the 8820. If/when you install and test there may be some different options from my own, but the protocol is the same, so I would request that you provide some requests/responses from the log if there is anything I need to look at. As mentioned in the previous comment, this is still very much in development so if you are a less technical user, you may want to wait until it has achieved a bit more stability.

I just got it set up! So far so good! Amazing Job!!!

I’ll be poking around the code to see how it actually works, this is very exciting!

@chamberlain2007 Are you good with PRs? Currently the branch is locked down so I can’t submit one. I made a local branch that may address one of the errors in the logs. Python isn’t my main language but I’ll hopefully be able to contribute to some bug squishing.

Hi, definitely open to pull requests. You should be able to fork the repo and create a PR from your fork back onto the main repo. Ping me in DM if that doesn’t work.

To provide a little insight the interface was locked down late summer of 2021 based on a security report I filed. Aprilaire's Insecure API - YouTube

Their thermostats were open to the entire world without authentication.

Hello, where do I go to turn on home automation mode? I took a look at my thermostat (6000 series) and can’t seem to find it.
Edit: is this it?

Does this mean that if you use the integration that you cannot use the Aprilaire app?

where do i find ip for thermostat i cant seem to find it

Yes that is the setting. I believe you should be able to still use the app, I have been using both without issue, they use different protocols.

I’m sure it’s in the settings somewhere, but I would check on your router as you’ll want to assign a static IP regardless.

They are using certificate pinning to protect the connection in the app from snooping. Still looking for ways around it.

Have you had any luck with the 8840? I have that model, however it doesn’t appear to have port 7000 exposed. I do however see a port 8000 that is exposed, but it errors out when connecting with your add-on. What can I do to debut this further?

Any chance you could share the C# code?

What errors are you getting? Is it able to connect to the socket at all? According to the documentation I have the 8840 should be supported, but I don’t have one of them myself.

I am able to connect to port 8000 with telnet, which seems to be the port that the 8840 uses. However, I am lacking documentation that would help me start diving into the issue more. Would you be able to share the information you have with me to do further debugging?

This is what I am seeing in the debug logs.

2023-01-21 20:14:31.783 INFO (MainThread) [custom_components.aprilaire] Aprilaire connection made
2023-01-21 20:14:31.792 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:14:31.862 INFO (MainThread) [custom_components.aprilaire] Aprilaire connection lost
2023-01-21 20:14:31.865 DEBUG (MainThread) [custom_components.aprilaire] Queuing data, sequence=1, action=Action.READ_REQUEST, functional_domain=FunctionalDomain.IDENTIFICATION, attribute=2
2023-01-21 20:14:31.865 DEBUG (MainThread) [custom_components.aprilaire] Queuing data, sequence=2, action=Action.READ_REQUEST, functional_domain=FunctionalDomain.CONTROL, attribute=7
2023-01-21 20:14:31.865 DEBUG (MainThread) [custom_components.aprilaire] Queuing data, sequence=3, action=Action.READ_REQUEST, functional_domain=FunctionalDomain.SENSORS, attribute=2
2023-01-21 20:14:31.865 DEBUG (MainThread) [custom_components.aprilaire] Queuing data, sequence=4, action=Action.WRITE, functional_domain=FunctionalDomain.STATUS, attribute=1
2023-01-21 20:14:31.866 DEBUG (MainThread) [custom_components.aprilaire] Queuing data, sequence=5, action=Action.WRITE, functional_domain=FunctionalDomain.STATUS, attribute=2
2023-01-21 20:14:31.898 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:14:31.899 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:14:31.899 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:14:31.901 DEBUG (MainThread) [custom_components.aprilaire] Sending data 01 01 00 03 02 08 02 fb
2023-01-21 20:14:31.901 DEBUG (MainThread) [custom_components.aprilaire] Sending data 01 02 00 03 02 02 07 19
2023-01-21 20:14:31.901 DEBUG (MainThread) [custom_components.aprilaire] Sending data 01 03 00 03 02 05 02 15
2023-01-21 20:14:31.901 DEBUG (MainThread) [custom_components.aprilaire] Sending data 01 04 00 20 01 07 01 01 00 00 00 00 01 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 01 01 00 00 00 ce
2023-01-21 20:14:31.902 DEBUG (MainThread) [custom_components.aprilaire] Sending data 01 05 00 04 01 07 02 01 d8
2023-01-21 20:14:31.902 WARNING (MainThread) [asyncio] socket.send() raised exception.

The asyncio error always occurs after the customer component tries to send data. Further down I see:

2023-01-21 20:42:38.912 ERROR (MainThread) [custom_components.aprilaire] Hit timeout of 30 waiting for 8, 2
2023-01-21 20:42:38.929 ERROR (MainThread) [custom_components.aprilaire] Missing MAC address, cannot create unique ID
2023-01-21 20:42:38.933 ERROR (MainThread) [custom_components.aprilaire] Failed to wait for ready
2023-01-21 20:42:38.947 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:42:38.947 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:42:38.955 INFO (MainThread) [custom_components.aprilaire] Aprilaire connection lost
2023-01-21 20:42:38.962 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:42:38.962 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data
2023-01-21 20:42:38.963 DEBUG (MainThread) [custom_components.aprilaire] Manually updated aprilaire data

Right, so what’s happening is that it is connecting to the socket (good) then disconnecting immediately (bad), trying to send the initialization commands (good but they will fail because it disconnected) and then failing the startup the component because it didn’t get the initialization data back (MAC address etc. expected because it disconnected).

Most of the time that I have seen issues with the socket not connecting properly, it’s because of a bad state on the thermostat. I’ve seen it happen when leaving a socket open for a while, trying to connect multiple sockets simultaneously, etc. Once it gets into a bad state, the only way to get it out is to disconnect and reconnect the thermostat from power, which reboots it.

I would recommend restarting it, making sure you don’t have any other connections going to it (eg telnet or another HA instance). See if it connects then.

Thanks I will give that a shot. By the way I was interested in helping out, but the only programming codes I have been able to find are the ones published on the Aprilaire Partners website. They don’t seem to apply to WiFi, may I ask how you came across your documentation, as I would like to acquire a copy for myself.

That seemed to work, let me know how I can help out. Python is new to me, but I have developed Smart Home integrations for Scrypted in JS for Dyson and TP-Link. Would love to help get this built out more, and get humidifiers, dehumidifiers, and fresh-air support built in.

Great, glad to hear. The finnickiness of the socket connection was the biggest roadblock to getting the integration going for me. You’ll see in the code that there is a fair amount that goes into just keeping the connection alive. Happy to say that it has been working for me days to weeks at a time without issues. That being said, it makes it tricky to do the development since you can’t run your dev instance and live instance against the same thermostat. So, there is a mock server in the repo that you can run your local instance against, which is helpful.

I will send docs to your DM.