andylockran / heatmiserV3

MIT License
11 stars 12 forks source link

Home Assistant integration failing. Setup of thermostat failing #53

Closed tomtokic closed 3 years ago

tomtokic commented 3 years ago

Hi, I have a Heatmiser UH1 with PRT-EN thermostats and have had it successfully serially integrated into an existing Indigo Domotics home automation system with a plugin that I wrote by integrating this code for the Heatmiser integration.

I am now migrating to Home Assistant and have used the Heatmiser integration, but it is failing to startup. It is giving me a server error log stating the CRC is INCORRECT. I have it connected via an ethernet to serial device and can see a packet sent to the system, but no response. The below is the full extent of the error messages.

Logger: homeassistant.components.climate Source: components/heatmiser/climate.py:73 Integration: Climate (documentation, issues) First occurred: 7:07:52 PM (1 occurrences) Last logged: 7:07:52 PM

Error while setting up heatmiser platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/heatmiser/climate.py", line 60, in setup_platform [ File "/usr/src/homeassistant/homeassistant/components/heatmiser/climate.py", line 61, in HeatmiserV3Thermostat(heatmiser_v3_thermostat, thermostat, uh1_hub) File "/usr/src/homeassistant/homeassistant/components/heatmiser/climate.py", line 73, in init self.therm = therm(device[CONF_ID], "prt", uh1) File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 108, in init self.read_dcb() File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 314, in read_dcb self.dcb = self._hm_read_address() File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 295, in _hm_read_address response = self._hm_send_address(self.address, 0, 0, 0) File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 286, in _hm_send_address verification = self._hm_verify_message_crc_uk( File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 171, in _hm_verify_message_crc_uk dest_addr = datal[0] IndexError: list index out of range

Logger: root Source: /usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py:167 First occurred: 7:07:52 PM (1 occurrences) Last logged: 7:07:52 PM

CRC is INCORRECT

2021-06-05 19:07:52 ERROR (SyncWorker_6) [root] CRC is INCORRECT 2021-06-05 19:07:52 ERROR (MainThread) [homeassistant.components.climate] Error while setting up heatmiser platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/heatmiser/climate.py", line 60, in setup_platform [ File "/usr/src/homeassistant/homeassistant/components/heatmiser/climate.py", line 61, in HeatmiserV3Thermostat(heatmiser_v3_thermostat, thermostat, uh1_hub) File "/usr/src/homeassistant/homeassistant/components/heatmiser/climate.py", line 73, in init self.therm = therm(device[CONF_ID], "prt", uh1) File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 108, in init self.read_dcb() File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 314, in read_dcb self.dcb = self._hm_read_address() File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 295, in _hm_read_address response = self._hm_send_address(self.address, 0, 0, 0) File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 286, in _hm_send_address verification = self._hm_verify_message_crc_uk( File "/usr/local/lib/python3.8/site-packages/heatmiserV3/heatmiser.py", line 171, in _hm_verify_message_crc_uk dest_addr = datal[0] IndexError: list index out of range

I initially opened this issue under the homeassistant/heatmiser site on github but was instructed by Andy to move it here.

I can do wireshark analysis to assist on my end and also look into the comms on the indigo domotics side of things to assist troubleshooting if needed. All support is appreciated.

Thanks

Tom

tomtokic commented 3 years ago

I did some troubleshooting tonight, and just showing some data with the request and response packets that I see when using my existing successful serial interface connection. This API leverages the hmutils.py file for comms. Note the values are decimal representations of the hex data sent.

Serial Request [1, 10, 129, 0, 0, 0, 255, 255, 44, 9] Serial Response [129, 75, 0, 1, 0, 0, 0, 64, 0, 0, 64, 0, 19, 3, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 20, 0, 7, 12, 28, 1, 1, 0, 0, 0, 0, 0, 0, 0, 160, 255, 255, 255, 255, 0, 0, 2, 23, 20, 35, 4, 0, 21, 5, 30, 12, 24, 0, 22, 24, 0, 17, 4, 0, 21, 5, 30, 12, 24, 0, 16, 24, 0, 16, 9, 168]

tomtokic commented 3 years ago

For reference, the hm_utils file is based on this. https://github.com/andylockran/heatmiser-v3-scripts/blob/master/hm_utils.py

washboy commented 3 years ago

I'm a HomeAssistant user and I'd like to get involved (I have UH1 + 4xPRT-ENs +couple of spare PRT-ENs and a spare UH8-N) but I don't know how to interface with the PRTs. Advice appreciated.

Apologies if this enquiry breaks some rules or etiquette. Is there a more suitable forum that I should use instead?

tomtokic commented 3 years ago

I'm a HomeAssistant user and I'd like to get involved (I have UH1 + 4xPRT-ENs +couple of spare PRT-ENs and a spare UH8-N) but I don't know how to interface with the PRTs. Advice appreciated.

Apologies if this enquiry breaks some rules or etiquette. Is there a more suitable forum that I should use instead?

Hi washboy. I am happy to try and help you on this. I certainly have a UH1 working with an RS485 to USB serial interface on a Mac and connected into Indigo Domotics as a home automation platform. As per my comments above I wrote a plug-in for that system that leveraged the work from Neil Trimboy’s hmutils.py code.

At the moment, I am troubleshooting the integration to homeassistant as I have to introduce an Ethernet to serial converter to leverage the current integration. My current thinking is that the interface module I am using isn’t setup right. But once I get it working I will share the setup.

You shouldn’t need your UH8-N to get your integration working.

tomtokic commented 3 years ago

Hi @washboy I have now been able to get the UH1 interfacing to home assistant. The way I achieved this is by plugging the RS485 interface into my Mac, using socat to map the serial port to a TCP port via the following command structure: sudo socat TCP-LISTEN:5151,fork,reuseaddr FILE:/dev/cu.usbserial-14620,raw,ispeed=4800,ospeed=4800,nonblock,waitlock=/var/run/cu.lock

On home-assistant, I then configure it as follows:

climate: platform: heatmiser host: 10.x.x.x port: 5151 tstats:

I am going to close this "issue" out now as it was on my interface, not the code.

I will open a seperate feature request on the home assistant side for the heatmiser component as I am now wanting to get the thermostat to report the temperature it displayed based on a remote air sensor instead of the local one in the termostat.

Feel free to PM me if you want me to help you with your setup.

washboy commented 3 years ago

I'd like to PM you @tomtokic but I don't think that's possible on GitHub yet. I do need help with even the most basic setup and wiring to the Heatmiser.

tomtokic commented 3 years ago

Ok, what’s your email address? I’ll contact you that way and we can get you up and running.


From: washboy @.> Sent: Saturday, June 19, 2021 5:42:12 AM To: andylockran/heatmiserV3 @.> Cc: tomtokic @.>; Mention @.> Subject: Re: [andylockran/heatmiserV3] Home Assistant integration failing. Setup of thermostat failing (#53)

I'd like to PM you @tomtokichttps://github.com/tomtokic but I don't think that's possible on GitHub yet. I do need help with even the most basic setup and wiring to the Heatmiser.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/andylockran/heatmiserV3/issues/53#issuecomment-864239184, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQUKQBWZILHSIQT3UMWOYH3TTOORJANCNFSM46JRRQKQ.

NigelCoxon commented 2 years ago

@tomtokic Did you get your remote air sensor to work. I had this issue a while ago, and ended up writing a custom component to solve this and some other issues. If you're interested, take a look at https://github.com/NigelCoxon/Hass-heatmiser

Cheers

tomtokic commented 2 years ago

Hi Nigel. I was running the Brett custom component but it has been crashing. I have installed your and will give you feedback but it is summer here now so the units won’t run for 6 months.

Are you able to implement the hold temp method in your component? I used to use they from the base code a lot. It’s great to just give the heat a hit for an hour here and there.

On 10 Nov 2021, at 10:26 pm, NigelCoxon @.***> wrote:



@tomtokichttps://github.com/tomtokic Did you get your remote air sensor to work. I had this issue a while ago, and ended up writing a custom component to solve this and some other issues. If you're interested, take a look at https://github.com/NigelCoxon/Hass-heatmiser

Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/andylockran/heatmiserV3/issues/53#issuecomment-965039522, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQUKQBTYTC4NNBXZSO7LFXTULJJH3ANCNFSM46JRRQKQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.