Hello all, I have just joined in to the discussions for NR and in particular UIBUILDER.
Firstly, I want to show my appreciation to TotallyInformation for the vast amount of work I can see has been put in to developing uibuilder, and also to others for their contribution.
I enjoyed the read from Collin (Mudwalker) on his journey into using uibuilder, and can relate very much to a lot of what Collin writes.
Secondly, my background is more from moving into using NR from many years developing my own SCADA systems based on Python for back end heavy lifting coupled to full javascript front end using SPA concepts with websockets for real time data updates.
So far, since starting with NR starting December 2025, firstly via HomeAssistant and now as stand alone NR server running on an industrial RPi (SeeedStudio reComputer CM4).
So, to my question: having only in past few days started with uibuilder and reading the very good documentation and reading many post here, I am doing some tinkering based on one of the examples, namely, FE SPA with router function.
I have a flow whereby I retrieve data from a PLC (Industrial box of magic tricks), via good old Modbus protocol. I pass the retrieved data through a buffer parser and end up with a key/value object, for example something like the following:
{"plc_vfd":{"fault_code":0,"warning_code":16},"_msgid":"9e35bf8c16035ee9"}
I then pass this into a uib-sender node.
Since I am using the example mentioned above, I am using route 3 as the space where I play, so in the route 3 html file I have placed the following:
<div>
<ul>
<li>VFD Fault Code: <uib-var variable="msg.plc_vfd.fault_code">...</uib-var></li>
<li>VFD Warning Code: <uib-var variable="msg.plc_vfd.warning_code">...</uib-var></li>
</ul>
</div>
I hit the deploy and set things in action and then issue a poll to the PLC.
Using the data as shown above, where the fault code is 0 and warning code is 16, what I notice on the page is that the value for fault code does not get updated, but for warning code it does.
After some tinkering, I found that if the value is 0, as in number zero, it does not update, but any other number will get through and be shown.
If I pass the value through as a string, so like "0" then of course it is shown.
I looked at using a filter to see if that could sort it, but no.
I am looking to reproduce a well defined and reliable SPA as an HMI for industrial projects.
In my existing SPA structures I make use of a nice little helper called Tinybind to do the magic of binding my data to the UI. Tinybind can do other very nice things like formatting of the data before being put to the UI. Maybe a bit like how the uibuilder filter might function.
If you're interested, Tinybind: https://blikblum.github.io/tinybind/
What is it that I might be doing wrong here with uib-var ?
And is there a better method to achieve what I wish with using uibuilder ?
Many thanks for any advice.
Edit:
Using another of uibuilder examples, uib-sender the exact same issue is noticed.
I set the uib sender node to send a payload of type number and try different numbers.
Again, without exception, all numbers except zero are sent to the UI.
I even tried -0 and 0.0, if the value equates to zero it will not get displayed.
It is as if it equates zero to a null.