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

Sensors don't update after HASS restart #13

Open
grazmarks opened this issue Mar 23, 2021 · 7 comments
Open

Sensors don't update after HASS restart #13

grazmarks opened this issue Mar 23, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@grazmarks
Copy link

grazmarks commented Mar 23, 2021

Hi,

My thermoplus_ble sensors only update after a restart of HASS anymore. It used to work before in more or less regular intervals which normally never exceeded 10 minutes.

There was no change in the setup besides a template sensor that I added and removed again after playing around with it a little bit.

Does anyone else experience a similar problem? The sensors work fine when I open them in the native sensor app.

Any advice or hint into the right direction would be appreciated.

Many thanks!

2021-03-23 13:26:52 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/thermoplus_ble/sensor.py", line 54, in update
    self.process()
  File "/config/custom_components/thermoplus_ble/sensor.py", line 75, in process
    data = self.parse_event(event)
  File "/config/custom_components/thermoplus_ble/sensor.py", line 112, in parse_event
    entries.append({
MemoryError
2021-03-23 13:39:21 ERROR (Thread-30) [homeassistant] Error doing job: Fatal read error on socket transport
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 848, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
MemoryError

@titiviking
Copy link

I have the same issue.
Could be due to some update of HA as I only experience this since last upgrade...
No idea why... Debugging the component, I do see a lot of BLE devices being listed... It even tells me "1 known sensor", but no update to the values.

@araines
Copy link
Owner

araines commented Mar 29, 2021

I'm not experiencing this problem, but I'm also not running the latest versions of HA/HASS because of instability issues on raspberry pi. Perhaps if you could both note of your hardware, hassOS version (if applicable) and home assistant version then we could find a pattern?

  • Raspberry Pi 4 Model B Rev 1.2 4GB
  • HassOS: 4.20
  • HA Core: core-2021.3.4

@titiviking
Copy link

titiviking commented Mar 29, 2021

  • raspberry pi 4 model B
  • rasberian (up to date)
  • HassIO supervised (latest) (on docker)

@grazmarks
Copy link
Author

grazmarks commented Apr 2, 2021

Raspberry Pi 4 Model B 4GB
Home assistant 2021.3.4
Running on docker via docker compose

I hadn't experienced this issue after switching from starting the container directly with docker run to docker compose. Ran fine for a week. Same issue again but no exception in the logs this time.

Whats interesting tough is that I have a template sensor that derives from the thermopiles sensor, and that sensor updates regularly:

      arbeitszimmer_humidity:
        friendly_name: "Arbeitszimmer Humidity"
        value_template: "{{ state_attr('sensor.thermoplus_e9_47_00_00_0c_2e', 'humidity') }}"
        unit_of_measurement: '%'
        device_class: humidity

@grazmarks
Copy link
Author

  • raspberry pi 4 model B
  • rasberian (up to date)
  • HassIO supervised (latest) (on docker)

May I ask how you are running HassIO supervised in a container? I remember doing some research on this but decided that it would be too invasive and that I'd rather go for a vanilla HassOS in case I need it.

@araines araines added the bug Something isn't working label May 13, 2021
@araines
Copy link
Owner

araines commented Jun 6, 2021

I'm now experiencing some problems with this integration as well, although I'm not seeing the error messages described here. Given there is actually a much better maintained & feature-rich passive BLE component in the ecosystem, I've requested that support for Thermoplus sensors can be integrated in that component instead: custom-components/ble_monitor#393

I'm hoping the maintainers are open to that proposal.

Edit: through messing about a bit, I've discovered my problem goes away when I've got the ble_monitor installed as well and configured to have "active scan" enabled. I don't know if this will work as a temp workaround for anyone else - it kinda suggests there is probably some kind of nasty bug in this implementation.

@araines
Copy link
Owner

araines commented Jun 8, 2021

I'm recommending that people use ble_monitor (https://github.com/custom-components/ble_monitor) from this point forwards. The maintainers there have kindly integrated support for Thermoplus sensors as of version 3.1 (currently in beta). It also has a whole host of other features beyond this component which I think are great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants