Slow start - Setup of climate platform heatmiser_ndc is taking over 10 seconds

I am working to debug and improve the existing Heatmiser integration. I have setup a custom component, based on the original, for the moment, and will try and get this integrated back into the official component when I’m done.

Its working well for me so far, but I am seeing this warning message in the logs at startup:`

Setup of climate platform heatmiser_ndc is taking over 10 seconds.

The warning message doesn’t stop the platform working OK, but I’d like to get rid of it if I can. I have added some debug logging to the code, including a call at the start and very end of the setup_platform function. These calls show the setup is taking only about 1 second. Yet the calling code does not report that the setup is complete and the error message is reported c 9 seconds later.

So I’m wondering what does the core consider as setup complete?

There’s an element of the add_entities call in setup_platform code that I don’t understand (this is original code):-

add_entities( [ HeatmiserV3Thermostat(heatmiser_v3_thermostat, thermostat, uh1_hub)
            for thermostat in thermostats], True,  )

What are the True and the following null arguments for?

Any help would be appreciated.
Thanks
Nigel

PS relevant lines from the log files are here

2020-12-30 14:43:27 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for heatmiser_ndc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-30 14:43:27 INFO (MainThread) [homeassistant.setup] Setting up climate
2020-12-30 14:43:27 INFO (MainThread) [homeassistant.setup] Setup of domain climate took 0.0 seconds
2020-12-30 14:43:28 INFO (MainThread) [homeassistant.components.climate] Setting up climate.heatmiser_ndc
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Setting up platform
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.connection] Initialising interface 192.168.0.19 : 23
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Kitchen
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Guest Bath
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Guest Bed
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Study
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bed 1
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bed 1 Bath
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bed 2
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Hall
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Games
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Lounge
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Dining
2020-12-30 14:43:28 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bed 3
2020-12-30 14:43:29 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bed 4
2020-12-30 14:43:29 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bed 5
2020-12-30 14:43:29 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Initialised thermostat Bathroom
2020-12-30 14:43:29 INFO (SyncWorker_0) [custom_components.heatmiser_ndc.climate] Setup complete
2020-12-30 14:43:38 WARNING (MainThread) [homeassistant.components.climate] Setup of climate platform heatmiser_ndc is taking over 10 seconds.
2020-12-30 14:43:44 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 21.95s
2020-12-30 14:43:44 INFO (SyncWorker_0) [homeassistant.components.zeroconf] Starting Zeroconf broadcast

OK I think I’ve discovered what the 2nd argument to add_entities means. It requests an immediate update of the device before adding the entity.
Still dont know what the null 3rd arg is.
See
https://community.home-assistant.io/t/add-entities-documentation/103030

…and an update on my system with 15 thermostats takes c 12 secconds, So if the core waits for this to complete before marking the setup as complete, it will trigger the timeout. I’ll see if the update can be avoided.

Hi Nigel,
Thanks for all your work on Heatmiser V3 integration. Do you still have plans to integrate back into the main project component or do you have issues/features outstanding?

I have a 8 zone setup here that I am keen to integrate (just waiting on a serial-ethernet interface to arrive). Two of my zones have a PRT2-NTS PRT2-TS_PRT2-NTS.pdf (heatmiser.com) which I think is essentially a PRTHW-NTS PRTHW-TS_PRTHW-NTS.pdf - (heatmiser.com) with a second external thermal probe. Do you happen to know if these work off the bat or might require a bit of code furtling?

Kind regards
Chris