ruuvi-friends / ruuvi-hass.io

Ruuvi tag BLE sensor for Home Assistant.
MIT License
41 stars 11 forks source link

Collection of data stops after 1-2 hours #38

Open mkauttu opened 2 years ago

mkauttu commented 2 years ago

I have succesfully configured ruuvi-hass.io with couple of ruuvi tags. Data seems to come in for hour or two. After that data flow stops. Ruuvi tags continue to send out data, but HA -server does not recognize it. Restarting of HA (configuration --> Settings --> Server Controls --> Restart) will fix the issue. Of course rebooting of the entire server helps too. I'm running HASS.io official image on VMWare vSphere. Home Assistant version is 2021.12.10

japekka commented 2 years ago

Ihave also this issue. I will try to check if I could find some information in logs so that it could be useful to this case

japekka commented 2 years ago

After setting adapter: "hci1" the data seems to flow. In my installation there are two different bluetooth adapters visible, but you could try to set that value. Remember to change hci1 value to correspond your setup

lraty commented 2 years ago

Worked 10 days for me. Then needed reboot. Can I somehow add watchdog for this?

mkauttu commented 2 years ago

I created an automation to act as a watchdog. It runs every 5 minutes to check if latest update from a sensor is newer that 1800 seconds. If last update is more that 1800 seconds old host os reboots. Here is tha YAML. Jsut change the entity ID (sensor.outside_temperature) to match your's:

alias: Reboot if no data from ruuvi in 30 min
description: ''
trigger:
  - platform: time_pattern
    minutes: /5
condition:
  - condition: template
    value_template: >-
      {{
      (as_timestamp(now())-as_timestamp(states.sensor.outside_temperature.last_updated))
      | int > 1800}}
action:
  - service: hassio.host_reboot
    data: {}
mode: single
ojalaj commented 2 years ago

For me, similar issues started, when I upgraded the FWs of my 6 RuuviTags from version 2.X to 3.31.1.

See https://f.ruuvi.com/t/home-assistant-ruuvitags-not-properly-working-after-fw-upgrade/5562.

Any possibility that someone with sufficient skills could have a look at this (I don't have :D)?

ojalaj commented 2 years ago

Ping @mkauttu @lraty @japekka on this?