I am trying to create the following in Thingsboard:
In a dashboard create a button, when it is clicked a rest api call to an external server is made.
So far I have found that it is possible to define a rule chain with "rest api call" node, but I am unable to find a good rule which will lead to its execution (sending an api each time an entity is created obviously is a bad option)
In the "control widgets" I was not able to create a working solution but it looks like the correct way.
Asked
Active
Viewed 1,302 times
4

Uri Loya
- 1,181
- 2
- 13
- 34
1 Answers
2
I have figured a way to do it, not the best but it works:
- Create a board.
- Create an "Update Device Attribute" control widget.
- Go to "Edit" in the "Update Device Attribute" control widget, pick an unused device (it might be possible to pick a used device but i am not sure if the operation might alter it), go to "Advanced" and set "Device attribute parameters to any valid json, for example: {"rest":1}.
- Go to "Rule Chains" and create the following rule:
Input -> Message Type Switch -(Attribute Updated)-> Rest Api Call (choose from nodes-external). - In the "Rest Api Call" set the required endpoint url and method, then apply change.
If you have configured everything properly, every time the button is clicked a rest api call will be made

Uri Loya
- 1,181
- 2
- 13
- 34
-
2You can ad the "Rest Api Call" directly under the "Message Type Switch" of the default "Root Rule Chain" – Olivier Jul 27 '22 at 14:44