Timer too fast in rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Timer too fast in rules

#1 Post by Wiki » 26 Sep 2018, 01:48

Hi,

if I'm wrong here with my post, please excuse me. I didn't use the search function into the deep - lack of time.

I am building a monitoring system for a set of four lead-acid batteries. The best way to monitor the remainig capacity of these batteries are the amperehours. So I started up with a Wemos D1 and a modified INA219 breakout board (both clones from China?) to get the charging and discharging current and summing up the amperehours using a two second timer in a rule.

At first I got really strange results far off reality until I figured out, that the event Rules#Timer is fired too fast by a factor of around 1.33~. After including a correction factor in my rule the results are still somewhat rough estimations of the remainig capacity, but pretty fine for my project. So for me there is no problem anymore.

Is this misfiring of the Rules#Timer a unique issue of my hardware or is it already known?

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Timer too fast in rules

#2 Post by grovkillen » 26 Sep 2018, 06:18

Yes we're aware that timers are not 100% accurate. Just a question, what exact length of timers are you using?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Timer too fast in rules

#3 Post by Wiki » 26 Sep 2018, 11:57

Hi,

I am using two seconds for my calculations.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Timer too fast in rules

#4 Post by grovkillen » 26 Sep 2018, 13:49

I would say that the error you are experiencing is biggest at 1-2 second timers.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: Timer too fast in rules

#5 Post by Wiki » 26 Sep 2018, 17:27

Yes, I already supposed that.

I know that setting up a time depending calculation using a timer event is not the best way. But I am glad to get my hands on an ampere hour meter using the rules. Helps a lot monitoring my batteries. And I am fine, if the correction factor works.

Fortunately I do have a stationary installed ampere hour meter, so I am able to doublecheck my results. Up to now it looks good, difference of about 3-4% - acceptable for me.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Timer too fast in rules

#6 Post by grovkillen » 26 Sep 2018, 18:20

We will add higher resolution later on, for sure with the ESP32. But we're not quite there yet.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 86 guests