haemishkyd / poolsense

Pypi package to access the PoolSense device.
MIT License
0 stars 3 forks source link

PoolSense integration not working? #1

Closed colsonpete closed 3 years ago

colsonpete commented 4 years ago

Hi

I cannot get the PoolSense integration to work - it does not find any devices or entities.

I currently have two devices here that are registered to my account but are not working/communicating with SigFox.

I have now added PoolSense's DEMO device to my PoolSense account and that is working on the PoolSense app but is still not showing up in my PoolSense HA integration. I have both 'updated' the integration as well as deleted it and reinstalled it but still have no devices or entities showing up in HA.

I am currently running Home Assistant version 0.117.4. What version was your integration software tested with?

I have had a cursory look at the source code but am not familiar with the language so cannot see for sure if it can handle more than one device or if it simply expects to find just one device and picks up the readings from the first device found which, in my case doesn't have any readings at all. Perhaps you can advise?

If it helps, the HA CORE system log shows the following error for PoolSense:

2020-11-11 13:43:21 ERROR (MainThread) [homeassistant.components.poolsense] Unexpected error fetching poolsense data: 'waterTemp' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 144, in async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/poolsense/init.py", line 119, in _async_update_data data = await self.poolsense.get_poolsense_data() File "/usr/local/lib/python3.8/site-packages/poolsense/init.py", line 77, in get_poolsense_data "Water Temp": data["waterTemp"], KeyError: 'waterTemp' 2020-11-11 13:43:21 WARNING (MainThread) [homeassistant.config_entries] Config entry for poolsense not ready yet. Retrying in 80 seconds

colsonpete commented 4 years ago

Thinking through my suspicion that the HA integration might not cope with more than one device, I have deleted my two devices from the app so that the only device left is the PoolSense demo device and hey presto, my HA integration now works!

This would seem to prove that your code does not cope with more than one device at present. If the PoolSense app allows multiple devices on one account then I think you need to amend your code to cope with multiple devices per account too - e.g. instead of returning sensor.poolsense_temperature it needs to be something like sensor.xxxxx_poolsense_temperature where xxxxx is the device name.

Hope this helps!

haemishkyd commented 4 years ago

@colsonpete thanks for your efforts. I agree that I never really catered for more than one device at a time on the integration. My main concern with it was that I don't actually have two and as a result wasn't really sure what the output from the PoolSense server would be for more than once device. I had to reverse engineer the rest API they use. Would you be interested in helping me to get the info I need to update the integration to handle more than one device? This might mean testing some changes for me at certain intervals to make sure they actually do what they are supposed to.

colsonpete commented 4 years ago

Hi Haemish

I’d be happy to help but suspect you will need two working devices linked to the same account to be able to properly test your enhancements.

Sorry to say that even one working unit seems to be beyond my reach at the moment so I suggest either PoolSense get a second/third demo unit working for you/us to test or alternatively you contact hosting.io on GitHub who also requested this particular enhancement on Aug 28th.

I’d be happy to help out with/check out the Home Assistant side of things if that helps…

Kind regards

Peter Colson

From: Haemish Kyd notifications@github.com Sent: Wednesday, November 11, 2020 3:45 PM To: haemishkyd/poolsense poolsense@noreply.github.com Cc: Peter Colson peter.colson@pc-ss.co.uk; Mention mention@noreply.github.com Subject: Re: [haemishkyd/poolsense] PoolSense integration not working? (#1)

@colsonpetehttps://github.com/colsonpete thanks for your efforts. I agree that I never really catered for more than one device at a time on the integration. My main concern with it was that I don't actually have two and as a result wasn't really sure what the output from the PoolSense server would be for more than once device. I had to reverse engineer the rest API they use. Would you be interested in helping me to get the info I need to update the integration to handle more than one device? This might mean testing some changes for me at certain intervals to make sure they actually do what they are supposed to.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/haemishkyd/poolsense/issues/1#issuecomment-725497302, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALT7P7SCY6M3GTNEXX3XBRDSPKWQ5ANCNFSM4TSANWKA.