thecode / ha-onewire-sysbus

Home Assistant 1-Wire via sysbus
Apache License 2.0
27 stars 10 forks source link

Update time of sensors #97

Closed LooBlahNah closed 1 year ago

LooBlahNah commented 1 year ago

Hello,

I am using this integration on Home Assistant which is running on Rasberry Pi 3B+ using DS18B20 temperature sensor. Everything works fine but data refreshes on 30s. Is there a way to read data more frequently?

thecode commented 1 year ago

Home Assistant doesn't allow adding a parameter to customize the polling rate. You can disable automatic polling and create an automation that update the entity in any rate you want. https://community.home-assistant.io/t/ha-update-entity/457273/7 image

Note that a single DS18B20 can go up to around 1 update per second, but the internal temperature doesn't change that fast, most systems doesn't support update rates higher than 1 minute with this sensor.

Spettacolo83 commented 8 months ago

Thank you! Exactly what I needed! Here the official guide from HA to update a sensor based on your condition: https://www.home-assistant.io/common-tasks/general/

Here my automation of a DS18B20 sensor in YAML format to update it every 2 seconds:

alias: Updating DS18B20 sensor
description: ""
trigger:
  - platform: time_pattern
    seconds: /2
condition: []
action:
  - service: homeassistant.update_entity
    target:
      entity_id: sensor.28_xxxxxxxxxxxx_temperature
    data: {}
mode: single