Aprilaire Thermostat 8800 any MODBUS experts?

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.

I sent you a DM.

It definitely feels stable based on my interactions.

I am happy to develop it out against my 8840, hoping the only major difference is that the 8800ā€™s use port 8000.

I finally got around to installing the integration from HACS. I added the IP address from devices and services page and did another restart from my home assistant instance. However, I donā€™t see any sort of entity that was generated from the integration:

Is there something else I should be doing to see the entity for my thermostat?

Edit: Nevermind, it took a while but the entities show up now:

This is awesome. Is there a way to add multiple thermostats? I have another 6000 series thermostat with a different IP address.

Just wanted to chime in on the 8820ā€™s. I have been trying them on port 8000 and they work to a point. I have 7 thermostats. It seems that if I only connect to one thermostat it works OK and I get several entitles and I can make changes. Once I try to add the other thermostats, it says successful, but I get no entities for the additional TStatā€™s. It seems like if I add several 8820ā€™s, it can only create one of each possible entity. When I do connect to HA, and even though no entities are created, it does stop the thermostat from complaining about not being connected to a home automation system.

Below are the logs
Thanks!

2023-01-30 17:13:35.113 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Fan already exists - ignoring binary_sensor.aprilaire_fan
2023-01-30 17:13:35.114 ERROR (MainThread) [homeassistant.components.climate] Platform aprilaire does not generate unique IDs. ID Aprilaire Thermostat already exists - ignoring climate.aprilaire_thermostat
2023-01-30 17:13:35.115 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Humidity Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_humidity_controlling_sensor
2023-01-30 17:13:35.116 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Temperature Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_temperature_controlling_sensor
2023-01-30 17:13:36.933 WARNING (MainThread) [custom_components.aprilaire] No mode found in coordinator data
2023-01-30 17:13:36.936 WARNING (MainThread) [custom_components.aprilaire] No mode found in coordinator data
2023-01-30 17:14:18.133 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Fan already exists - ignoring binary_sensor.aprilaire_fan
2023-01-30 17:14:18.134 ERROR (MainThread) [homeassistant.components.climate] Platform aprilaire does not generate unique IDs. ID Aprilaire Thermostat already exists - ignoring climate.aprilaire_thermostat
2023-01-30 17:14:18.135 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Humidity Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_humidity_controlling_sensor
2023-01-30 17:14:18.136 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Temperature Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_temperature_controlling_sensor
2023-01-30 17:14:45.807 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Fan already exists - ignoring binary_sensor.aprilaire_fan
2023-01-30 17:14:45.808 ERROR (MainThread) [homeassistant.components.climate] Platform aprilaire does not generate unique IDs. ID Aprilaire Thermostat already exists - ignoring climate.aprilaire_thermostat
2023-01-30 17:14:45.810 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Humidity Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_humidity_controlling_sensor
2023-01-30 17:14:45.811 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Temperature Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_temperature_controlling_sensor
2023-01-30 17:15:30.963 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Fan already exists - ignoring binary_sensor.aprilaire_fan
2023-01-30 17:15:30.965 ERROR (MainThread) [homeassistant.components.climate] Platform aprilaire does not generate unique IDs. ID Aprilaire Thermostat already exists - ignoring climate.aprilaire_thermostat
2023-01-30 17:15:30.965 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Humidity Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_humidity_controlling_sensor
2023-01-30 17:15:30.966 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Temperature Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_temperature_controlling_sensor
2023-01-30 17:16:02.194 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Fan already exists - ignoring binary_sensor.aprilaire_fan
2023-01-30 17:16:02.195 ERROR (MainThread) [homeassistant.components.climate] Platform aprilaire does not generate unique IDs. ID Aprilaire Thermostat already exists - ignoring climate.aprilaire_thermostat
2023-01-30 17:16:02.197 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Humidity Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_humidity_controlling_sensor
2023-01-30 17:16:02.198 ERROR (MainThread) [homeassistant.components.sensor] Platform aprilaire does not generate unique IDs. ID Aprilaire Indoor Temperature Controlling Sensor already exists - ignoring sensor.aprilaire_indoor_temperature_controlling_sensor

Itā€™s similar behavior for me but I noticed something strange. When I added the first thermostat all of the entities populated. Then when I added the second thermostat it said successful but instead of generating new entities it seems all except for one of the entities from the first thermostat jumped over to my second thermostat:

Aprilaire Entrance/Foyer Thermostat (the first one I added to Home Assistant):

Aprilaire Bedroom Thermostat:

Originally I added the Entrance/Foyer thermostat and all 9 of the entities populated under it first. However, after I added the second Bedroom thermostat the only entity remaining on the Entrance/Foyer was sensor.aprilaire_humidification_status. The bedroom thermostat now has 8 entities. There is only 1 thermostat entity between the two thermostats which isnā€™t right since they can be individually controlled with their own temperatures.

Yes, Iā€™m getting the same behavior. After installing the thermostats and verifying that the first one installed had all the entities, I checked back the next day and they were gone and a different thermostat had the entities. I have also seen the entities split over a few thermostats but never more than one of each entities.

Wanted to chime in here. Iā€™m running a 6045M with the fresh air system and itā€¦ kind of works. Iā€™m successfully connected with the thermostat in Automation mode on port 7000. Initially after connecting, I can make changes from HA and see the changes update on screen of the 6045M. Thereā€™s two primary things Iā€™m seeing however:

  1. It appears the socket is disconnecting after some time. The interesting thing is I only lose the ability to make changes from HA to 6045M but not from 6045M to HA.
  2. When it is working, Iā€™m noticing that it gets caught in an odd state where it will update from HA to 6045M but the updates are ā€˜one update behindā€™. E.g. Set to 74 from 75, then I get 75. Set to 73 from 74, then I get 74.

Iā€™m not a dev but I am an EE and network enthusiast. If anyone needs traffic snooped or signals captured on a oscope, let me know. Iā€™d love to help out. If it wasnā€™t for the zones and fresh air system, Iā€™d rip it out and go with Ecobee. But itā€™s hard to justify new replacement equipment when this house is less than a year old.

  1. It appears the socket is disconnecting after some time. The interesting thing is I only lose the ability to make changes from HA to 6045M but not from 6045M to HA.

It is likely that the FIN command is sent to close down the writable stream of the socket, and the connection isnā€™t being re-established. If you have logs during this event, it would be extremely helpful.

  1. When it is working, Iā€™m noticing that it gets caught in an odd state where it will update from HA to 6045M but the updates are ā€˜one update behindā€™. E.g. Set to 74 from 75, then I get 75. Set to 73 from 74, then I get 74.

This is an odd-behavior, I would recommend you switching to the 0.2 branch if you havenā€™t already. I have found it to be more stable than the 0.1 which was originally published.

Iā€™m in the same boat as you. I have a new construction home built by Meritage. I think this is the system they go with in their newbuilds.

Yes I can get whatever you need. Where do you want me to pull the logs from and do I need to turn on verbose logging?

In AZ? Yeah thatā€™s exactly it for me. It really wouldnā€™t be that difficult to rip out their provided HVAC controls but itā€™s just a waste of money when itā€™s all done and working as it.

I was hoping thereā€™s at least cloud control through HA of the thermostat but it seems that not enough people really use Aprilaire. Hats off to Nick, chamberlain2007, and everyone else involved in working on this for a niche user base!

Looks like the last update fixed the issues with generating new entities when adding additional thermostats. Amazing work @chamberlain2007 and to everyone that has contributed to this project so far.

Just one thing I noted is that one of my thermostats isnā€™t reporting the correct set temperature:

Iā€™ve only added it within the last few minutes so Iā€™m hoping itā€™s just a delayed reporting for a new entity.