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

Battery drainage (data recorded too often in Home Assistant) #81

Open
RexioGit opened this issue Nov 14, 2024 · 8 comments
Open

Battery drainage (data recorded too often in Home Assistant) #81

RexioGit opened this issue Nov 14, 2024 · 8 comments

Comments

@RexioGit
Copy link

Hi @pvvx,
thank you for your great work!

I am using 2x TH05F and THB1. I flashed BOOT to them and after that I installed OTA. I left all settings default exept one - I turned off displays as I dont need them. I paired all 3 sensors to Home Assistant (installed at RPi 3B+) but after 2 days Voltage dropped from 3,3V to 2,89V so im guessing that this will be a short life of this batteries.

I saw that sometimes Home Assisntant is pulling data every 2-5s and for me is way to often. I tried to change something in settings to make delays longer (i would like to set something betwen 5-30minutes) but to be honest I dont know what am I doing as sidenotes are in RU and names of variables are not so clear for me (I am not electrician nor programmer). Can someone add examples and more descriptions to documentation of all available settings?

Can you help me to set it up and running? My gol is to run this sensors for at least 6 months at one battery.

@pvvx
Copy link
Owner

pvvx commented Nov 14, 2024

Default settings:

image
image

@RexioGit
Copy link
Author

so basically if we can change the data measurement frequency we can run this sensor until the battery self-discharges.

can you tell me what to change to make measurements every 3-30 minutes?

It would be great if you can add some more detailed notes in documentation or at your html. It is always easier for me when I can see some examples. Im not to bright ;)

Thank you very much for you great work!

@marvinlehmann
Copy link

marvinlehmann commented Nov 14, 2024

On PHY62x2BTHome.html you could change the advertising interval to 10s and the measurement step to like 30 which would result in a measurement interval of 5min (10s * 30 = 300s).

A bigger advertising interval may lead to pairing/connection problems. You can press the button on your sensor to temporarily shorten the interval in case you can't get a connection through that web page later on.

I'm currently using a Filter to get a 5min average:

sensor:
  - platform: filter
    name: "THB2 Temperature"
    entity_id: sensor.thb2_f89c_temperature
    filters:
      - filter: time_simple_moving_average
        window_size: "00:05"
      - filter: time_throttle
        window_size: "00:05"

Statistics may also work but I had gaps in the graph. You could also give ha-average a try. I have no idea what the best method would be. I'd love to know if there's a easier way.

@egzumer
Copy link

egzumer commented Nov 19, 2024

I had the same initial concern with my TH05 1.6 when I saw how fast the battery goes down from 3.2V, but I measured the current consumption and it is less than 15 uA so it is ok. It is just the battery discharge curve, it drops very fast initially.

@GreenMarc
Copy link

GreenMarc commented Nov 30, 2024

On PHY62x2BTHome.html you could change the advertising interval to 10s and the measurement step to like 30 which would result in a measurement interval of 5min (10s * 30 = 300s).

Öhm... how can i change from ms to s ? If i set the advertising to 60000ms = 1min, it corrects self to 15937.5.... whatever a max limit this is...

But pvvxs screen above is ok for me... a year would be good

Marc

Screenshot_20241130-174704_Chrome

@pvvx
Copy link
Owner

pvvx commented Nov 30, 2024

a year would be good

It won't. Some thermometers with cheap sensor chips and LCD screen drivers consume quite a lot in sleep mode. And the PHY6222 itself is not the best in terms of consumption. As a result, with a processor doing nothing, etc., a year on a cheap CR2032 does not work out.

CHT8305 sensors do not work already at 2.5V.
In the documentation for the BL55028 LCD driver chip, the minimum supply voltage in economy mode is specified as 2.9V.
What kind of work can we even talk about from a CR2032 with such elements?

The current consumption of the BL55028 in the most economical mode and the PHY6222 in sleep mode is equal to the current of the working LYWSD03MMC when sending data every 2.5 seconds.
(The sleep LYWSD03MMC consumes 5..7 µA, and the average current when transmitting every 2.5 seconds is about 14 µA.)

Tuya devices are made to sell, not to work. It's a Chinese dump.

@marvinlehmann
Copy link

Öhm... how can i change from ms to s ? If i set the advertising to 60000ms = 1min, it corrects self to 15937.5.... whatever a max limit this is...

You can't. But the advertising interval will be multiplied with the measurement step so the sensor won't measure too often.

@pvvx
Copy link
Owner

pvvx commented Nov 30, 2024

If i set the advertising to 60000ms = 1min

The Bluetooth standard specifies a maximum of 10 seconds.
Measuring with a sensor does not significantly increase consumption. Much greater dependence on the type of sensor.
The most economical and accurate sensor in BLE/Zigbee thermometers is SHT4x. But Tuya does not install them in its cheap knockoffs.
The processor already has to wake up every 10 seconds to transfer data.
MJWSD05MMC with settings like in thermometers with PHY by default it works for more than 2 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants