Search code examples
thingsboard

How do you update a key's value from a widget?


I'm wondering if any Thingsboard dev's have tried to update a device's telemetry's key/value from within a widget. If so how would you go about doing that?

Basically I have a widget that the end-user types a value into and I'd like the update a specific value associated with a key for a device with the user's input.

I know you could do a custom javascript POST command but if that's the case how do you read in the Device's access token from within the widget?


Solution

  • I found a way to do this without having to do a POST command. From this post here: Github Numeric Input modification widget Basically, the widget updates the data key directly via Javascript and a device or entity's shared attribute.