# Discovered weird caching behavior in mbus

**URL:** <https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307>\
**Category:** General\
**Created:** [28 May 2025 12:26 UTC](https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307 "2025-05-28T12:26:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [28 May 2025 12:26 UTC](https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307/1 "2025-05-28T12:26:52Z")

</div>

Today my team discovered a weird error when polling data from M-bus. The values didn't change, and apparently haven't changed in weeks. No errors or warnings. Most likely a physical device frozen / locked up. After a restart, updated values came in. So we did a lot of testing, including shutting down the gateway. And in fact mbus node continued to post data as if it was still connected! Turns out there are multiple time stamps in the data returned. One called `lastUpdateTime` which shows current query time. But each value object also has a `Timestamp` property, and this indicated why values weren't updated, as it was weeks old.

So effectively M-bus node caches values and returns latest even if disconnected! So to fix this, we calculated 5-min diff time between current time and record timestamp and handle errors from there.

Every time I work on a protocol in Node Red, we face weird details like these. Might be useful for someone else working with M-bus in node red.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 May 2025 12:54 UTC](https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307/2 "2025-05-28T12:54:48Z")

</div>

What node are you using for the comms?

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [28 May 2025 13:09 UTC](https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307/3 "2025-05-28T13:09:57Z")

</div>

This one: [node-red-contrib-m-bus (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-m-bus)  
Good documentation and very stable in normal use. But with some weird details.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 May 2025 14:25 UTC](https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307/4 "2025-05-28T14:25:39Z")

</div>

The best thing to do is to submit an issue [here](https://github.com/robertsLando/node-red-contrib-m-bus/issues). Then the author can comment.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 August 2025 14:26 UTC](https://discourse.nodered.org/t/discovered-weird-caching-behavior-in-mbus/97307/5 "2025-08-26T14:26:25Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
