Splitting attribute payloads - Attribute Links vs Rules

Hi,

We have, I think, quite a common use case, where we want to send a json with multiple attribute state values for a particular asset over MQTT and then split this out to update individual asset attributes e.g. temperatures, power etc. I’ve got a few questions forgive me for including them all in the one thread.

  1. I read this topic with interest - [MQTT] To update several attributes with a single message - #3 by dcompent - but I don’t think we have the security concerns mentioned and would be ok using an attribute link.

My first question is, is it possible to define this programatically so it gets set up automatically for any new asset of type X? We have already defined a custom model for our asset / the device we are working on and got that working (with a nice icon :smile:).

  1. Related to this is it possible to use a timestamp sent in the json as the time of record for the attribute value? I don’t think I’ve seen any documentation/forum posts on this.

  2. I’ve also been reading around other possibilities using groovy rules (this topic in particular - Custom attribute format with attribute link - #3 by perrochiba)
    My third question is, would that sort of approach be a better solution? Are those rules capable / efficient at splitting a json to update multiple attributes.

  3. One possible issue with defining attribute links in the custom asset model code is that updates to this don’t seem to get applied to any existing assets? i.e. I have added a extra attribute and as far as I have seen hasn’t appeared in existing assets of type X.

Thanks in advance for your help.

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