Virtuino Forum

Full Version: Retention of Value display item
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I receive data from a remote IO unit which only has on publish topic.  I  thus get different messages for different data types which the unit publishes every 'x' seconds.  For example it will publish Digital input statuses, then digital output statuses, then Analog inputs etc.  An example of the Analog input message that gets published is:

{
  "devId": "493C220314031120",
  "msgType": "aiValueRpt",
  "data": {
    "AI1": "8580"
  },
  "timestamp": "1659010523"
}

The topic is /iot/pub

My value for JSON path that I select is data/AI1 and this gives me the correct reading.  When a new message comes through without a data/AI1 path, for example the following:

{
  "devId": "493C220314031120",
  "msgType": "rs485ValueRpt",
  "data": "0203140002004E0041000500650000000213EE000300C08051",
  "timestamp": "1659010685"
}


My value display goes to 0 because I assume it tries to read the value in each message published to the topic.  Is there a way for me to retain the value until a new message gets published which actually contains the data/AI1 path and ignore all other messages if it isn't present?
Hi,

are you sure the widget displays the zero value?
it should show a blank.

Anyway I think that the correct function is  to cancel the incomming value as you correctly mention in the message.

I wll fix it on the next update 0.0.14.
(07-29-2022, 09:18 PM)iliaslamprou Wrote: [ -> ]Hi,

are you sure the widget displays the zero value?
it should show a blank.

Anyway I think that the correct function is  to cancel the incomming value as you correctly mention in the message.

I wll fix it on the next update 0.0.14.
I will be available soon

Hi Ilias, yes you're 100% correct, it just shows a blank not 0, I was mistaken. Thanks for your reply.  These units are giving me some trouble with regards to parsing the messages so I've got another question, but I'll put that in a seperate thread with a correct heading.  I will also experience this same problem with the second message but as you mentioned an update should fix it.