rsnodgrass / hass-flo-water

Flo Water Control for Home Assistant
Other
0 stars 0 forks source link

Unable to set up platform on HA 0.103.6 #5

Closed snicker closed 4 years ago

snicker commented 4 years ago

I'm on master

2020-02-16 00:59:16 WARNING (SyncWorker_8) [custom_components.flo.sensor] No startdate specified. Use 2020-01-01 instead.
2020-02-16 00:59:16 WARNING (SyncWorker_13) [custom_components.flo.sensor] No startdate specified. Use 2020-01-01 instead.
2020-02-16 00:59:16 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform flo
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/flo/sensor.py", line 70, in setup_platform
    sensors.append( FloPressureSensor(hass, device_id) )
  File "/home/homeassistant/.homeassistant/custom_components/flo/sensor.py", line 143, in __init__
    self.update()
  File "/home/homeassistant/.homeassistant/custom_components/flo/sensor.py", line 162, in update
    if self._state != round(state, 2):
TypeError: type NoneType doesn't define __round__ method
2020-02-16 00:59:17 ERROR (SyncWorker_13) [custom_components.flo.sensor] Bad request: 2020-01-01 00:00:00+00:00:2020-02-16 00:59:16.783344+00:00:1m
rsnodgrass commented 4 years ago

Try updating to the latest master. It should resolve this issue.

snicker commented 4 years ago

this will still throw an error on line 163 as state will be None. get_telemetry('psi') is returning None and then the code is trying to round that

snicker commented 4 years ago

the PR above seems to be working. However, I still have a very strange issue where I don't get any data from the Flo unless I have the iOS app open on my phone simultaneously. Should I open an issue in the main pyflowater repo?

shaz57 commented 4 years ago

i have the same issue, i only get the data first time when i restart HA, after that no data fulled from Flo. i was using 0.0.1 with out any issue for over 4 months. 2.0.x (5/6) both had the same issue.

now if i move back to 0.0.1, i get another problem it worked first time, all zero in 2nd pull works again in 3rd pull all zero in 4th pull and and so on

see the image you can see the zero values

https://ibb.co/R9NMX72

rsnodgrass commented 4 years ago

Same issue everyone else has, it doesn't update unless app is open. With Flo's change to 2.0, there must be an API that needs to be called to trigger updates of cached state on the Flo server side. I don't have time to dig into this right now, hopefully someone can investigate and submit a patch.

On Sun, Feb 16, 2020 at 2:12 PM shaz57 notifications@github.com wrote:

i have the same issue, i only get the data first time when i restart HA, after that no data fulled from Flo. i was using 0.0.1 with out any issue for over 4 months. 2.0.x (5/6) both had the same issue.

now if i move back to 0.0.1, i get another problem it worked first time, all zero in 2nd pull works again in 3rd pull all zero in 4th pull and and so on

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rsnodgrass/hass-flo-water/issues/5?email_source=notifications&email_token=AAQY4XBDYSTDSFGAMAJDP4DRDG24TA5CNFSM4KV6COPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL4UAUY#issuecomment-586760275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQY4XCPMADJJIA53DBQF3TRDG24TANCNFSM4KV6COPA .