cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to set the description values of a thing?

yingziDing
4-Participant

How to set the description values of a thing?

Hi,

I wanted to reset the value of description while one property of the thing changed. I used subscription, and set the  DataChange to execute the script.

But the Application log showed that the property description is read-only. Is there any way that I can do the job?

Thanks

7 REPLIES 7
dmoon
5-Regular Member
(To:yingziDing)

Hi,

To clarify your question, did you make a property named "description"? And you added a subscription for a datachange event of it, right?

If so, can you share your setting for the property and a script for subscription?

Daniel

yingziDing
4-Participant
(To:dmoon)

Hi Daniel,

The "description" I talk about is thing's description. When we create a thing, we should input name, description, template, thingshape for the thing.

thingset.png

I want to reset the thing's description, when a property named "nickname " changes. I used a subscription to do that.  For example, when the value of "nickname" is set to "My First Device ", the thing's description is set to "My First Device".

setdescription.png

yingziDing
4-Participant
(To:yingziDing)

The Application log return.

log.png

Hi Mr. Ding,

You can use SetDescription service the set device descriptions.

Lily.

yingziDing
4-Participant
(To:liliu)

Hi Miss Liu,

Uh.. If I do as your method, I can finish the job. If I can't do it using a subscription at last, I will use this method.

Thanks for your help.

yingziDing
4-Participant
(To:liliu)

Hi Miss Liu,

I understand what you mean. It works.

111.png

Hi Mr. Ding,

Great, any concern, just let me know.

Lily

Top Tags