Berry measurement update frequency based on Teleperiod #24141
-
|
I have a tank that empties very slowly over days or weeks, and then, when triggered by float, fills within minutes. Because the SR04 is a mechanical device, I have been getting a lot of failures. I want to avoid measuring every second (like the Tasmota built in Trig/Echo method), since I only need measurements every 30min while the tank is emptying. During filling, Tasmota receives a Berry Serial SR04 driver:It works fine as long as I don't change the However if I put I've considered leaving the code as is and sending a Options I've considered without success:
Please note: I’m not a programmer, and the code above has taken me days to piece together from the Language Reference, Cookbook, and other Berry sources. I’d appreciate constructive feedback only. I’m also aware that Any help is greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You are right that executing the Thus, just don't issue the command if you simply want to know the value. In your You should only have to issue the Don't venture into issuing I've not tried to dive into your code or how details work, but you should not have your own timing loops for polling, as your methods should always return as quickly as possible. Recommended is instead to have callbacks like |
Beta Was this translation helpful? Give feedback.
You are right that executing the
TelePeriodcommand, with or without argument, will trigger the telemetry period processing, meaning publishing the usual payload. It will also resynchronize the rhythm to the new starting point.Thus, just don't issue the command if you simply want to know the value. In your
init(), you can instead have a trigger liketasmota.add_rule('TelePeriod', def (value) self.teleperiod=value end)And then issue a
TelePeriodcommand to have the boot time value available thereafter.You should only have to issue the
TelePeriodcommand when you want to change the value. Then the above will update your instance variable.Don't venture into issuing
BrRestartcommand, you…