How to get device label in thingsboard rule chain? - thingsboard

How to get device label in thingsboard rule chain?.
I'm using originator node to get device ID and device Name and working well, but actual name is stored in device label (as there is no unique constrain) so need to get device label in rule chain to pass info to external service.
Anyone help on this would be grateful. thanks.

I found, Label also can be accessed from Originator node. The source field to retrive label is 'label'. Thanks

Related

Can I remove the unique constrain for error "Asset/Device with such name already exists."

We are using open source Thingsboard for our IOT platform. One project has 100K devices/assets, and we have a tree structure for the assets/devices for example state -> county -> city, etc. Each county, we have an administrator who is responsible for asset/device creation. Frequently they use the same name for asset or device. Currently, Thingsboard doesn't allow duplicated name for asset/device. If we use the same name, we will get error messages
Asset with such name already exists
or
Device with such name already exists
We are thinking to remove this unique constrain but not sure if there is any side effect. Thanks.
It is not recommended to remove the unique constraint, but there may be workarounds:
Make the names unique, e.g. by concating the structure in the Tree for unique names (State_County_City_Device) or use the Device ID as name. In the Dashboards you can utilize the Label Field for a friendly-name.
See issue here: https://github.com/thingsboard/thingsboard/issues/4439

CNContact unique id between devices

I'm having a bit of a problem with trying to access the same contact between multiple devices. My goal is to have a user select a contact and select a phone number and email address, which will then be stored in a database. If the user opens the app on another device, I would like to have the same contact selected.
I was hoping to use the CNContact.identifier for this case, but it appears that it is a device specific id. I could store the identifier for each device, but that would require the user matching contacts and that doesn't seam ideal.
This doesn't seam like it should be difficult but apparently I'm missing something. Thoughts?
The solution that seams to working for me is, I store the Contact identifiers, Address identifiers, Contact name, and the Address in my database. Then I take a mutli-step appoarch.
Search for Contact:
I attempt to find the contact based on the stored contact.identifiers I have already saved.
If I find 1 contact (identifier matched) => Great! I then attempt to match the found contact to my address.identifiers. Once again, if I find only 1 match, we're great! If not I then go to attempt to find an address (See below)
If I find no contacts (no identifiers matched) => I attempt to find the contact based on the Contact Name I had saved previously. If I do find a match, I then go to attempt to find the matching address (see below).
Search for Address:
Since at this point, I have a CNContact record that I believe matches, I look at each of their postalAddresses and compare it against the Street/city/state/zipcode/country that I have stored in my database.
If we find that perfect match, then I update my identifiers to include the new address/contact identifiers
If we ultimately don't find a match, I give the user an option to manually select the contact/address from their device.

Apache Nifi RouteHL7 Issue

I am unable to understand how to use RouteHL7 processor in nifi, Can any one please guide me how to use that.
I want to add some property in RouteHL7 Processor. Please guide me how to use.
Thanks.
You add properties to the RouteHL7 processor the same way as for any other processor. There is a "+" button on the top right of the Properties tab of the Configure Processor dialog (right click on the processor and select Configure).
You then name the property (this will be the name of the connection relationship for any flowfiles that match) and provide your query value. For example:
glucose: DECLARE result AS REQUIRED OBX SELECT MESSAGE WHERE result.4 < 60
Then drag the connection from the RouteHL7 processor to your desired destination and select glucose as the relationship to route there.
I've posted this template as a Gist, and you can look at the unit tests for RouteHL7 to see other query examples.

Get user meta (cocoaLibSpotify)

I need to get hold of a user's profile image. Can't seem to find anything that points me in the right direction. And also, how can I get the full name of the user (not the username)?
Thanks!
If the full name is available, it'll be in the displayName property of the user. User images are not provided by CocoaLibSpotify.

not getting any address id from Quickbooks Online when I query customers

When I query for customers I get back a customer object with all the info. one of the properties is the Address. this contains the billing and shipping addresses for the customer. however, the id field for each address is always null. I am wondering how I push an update back to QBO without the id? how does QBO know which address I am changing without a key of some kind? my goal is to be able to query QBO and get all the customers and address that have changed since a specified date. I have all this working for the customer but need to do the same for addresses. I am going by the assumption that when an address is changed in QBO that is sets the modified timestamp for that customer record. can anyone tell me how I manage the addresses for a customer and be able to push updates back to QBO?
Try using tag(Billing/Shipping) attribute while updating the address. I've tested the same and it is working fine.
You mentioned earlier that you were getting the id field of address as null. It is becuase, the devkit works with both - QBO and QBD. QBD returns valid element id but QBO doesn't. So for QBO, Devkit shows null in place of element id(in your case - address's id).
You can test all these using api explorer(http://developer.intuit.com/apiexplorer).
Hope it will solve your porb.
Thanks
'the id field for each address is always null' - this line is not very clear to me. Did you mean the id of the customer entity ? Plz explain.
You can check the QBO-Customer object's documentation and sample update request xml, from the following Link - https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0400_QuickBooks_Online/Customer .
For testing you can use the api-explorer. Link - developer.intuit.com/apiexplorer
Thanks
Manas

Resources