Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miflora component issue. #11815

Closed
tehbrd opened this issue Jan 20, 2018 · 5 comments · Fixed by #12149
Closed

miflora component issue. #11815

tehbrd opened this issue Jan 20, 2018 · 5 comments · Fixed by #12149

Comments

@tehbrd
Copy link
Contributor

tehbrd commented Jan 20, 2018

Home Assistant release (hass --version):
0.61.1

Python release (python3 --version):
Python 3.6.3

Component/platform:
hass.io rpi3

Description of problem:
miflora sensors no longer collect data

Expected:
sensors collect data, did prior to .61

Problem-relevant configuration.yaml entries and steps to reproduce:

sensor:
  - platform: miflora
    mac: 'XX:XX:XX:XX:XX:XX'
    name: Plant
    force_update: false
    median: 3
    monitored_conditions:
      - moisture
      - light
      - temperature
      - conductivity
      - battery

Traceback (if applicable):

ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.pot_plant_light_intensity fails
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 199, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 306, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/miflora.py", line 135, in update
    data = self.poller.parameter_value(self.parameter)
  File "/usr/lib/python3.6/site-packages/miflora/miflora_poller.py", line 128, in parameter_value
    self.fill_cache()
  File "/usr/lib/python3.6/site-packages/miflora/miflora_poller.py", line 60, in fill_cache
    firmware_version = self.firmware_version()
  File "/usr/lib/python3.6/site-packages/miflora/miflora_poller.py", line 102, in firmware_version
    _HANDLE_READ_VERSION_BATTERY, self._format_bytes(res))
  File "/usr/lib/python3.6/site-packages/miflora/miflora_poller.py", line 170, in _format_bytes
    return ' '.join([format(c, "02x") for c in raw_data]).upper()

Additional info:

bash-4.4# which gatttool
/usr/bin/gatttool
bash-4.4# hciconfig
hci0:   Type: Primary  Bus: USB
        BD Address: 00:1A:7D:DA:71:10  ACL MTU: 310:10  SCO MTU: 64:8
        UP RUNNING
        RX bytes:1578 acl:7 sco:0 events:94 errors:0
        TX bytes:1284 acl:6 sco:0 commands:80 errors:0

bash-4.4# hcitool lescan
LE Scan ...
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
XX:XX:XX:XX:XX:XX (unknown)
XX:XX:XX:XX:XX:XX Flower care
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
67:BC:EE:17:A4:9B (unknown)
<snip>
@raccettura
Copy link
Contributor

I'm getting the same thing.

Not sure if #11284 will make this invalid or not.

@forrestjr
Copy link

Do you guys know how we can test to see if BT is working from HASSIO or not?

@tehbrd
Copy link
Contributor Author

tehbrd commented Jan 29, 2018

Refer to my post above forrestjr

hciconfig / hcitool lescan should be able to run both those from the host or the guest (homeassistant docker)

In regards to my issue, it went away with a reboot and reappeared on another restart.

@tehbrd
Copy link
Contributor Author

tehbrd commented Jan 29, 2018

I was just replicating my issue when I noticed upon reboot hci0 was down. Althought this wasn't the case above.

@ChristianKuehnel
Copy link
Contributor

This is a known bug in miflora: basnijholt/miflora#80

@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants