I recently started working with thingsboard in context of my bachelor-thesis. Right know I am trying out different functionalities in order to check which requirements thingsboard already satisfies and which have to be implemented by me.
Within that process I am stuck at the requirement that thingsboard dashboard should give live information about the connectivity status of a registered device (connected, disconnected, active, inactive).
To solve that I've tried out editing the rule chain used by the device profile assigned to the device of interest. Specifically I worked with the message type switch
and tried out various action nodes connected to it via ConnectEvent, DisconnectEvent, ActiveEvent and InactiveEvent. What I would like to have is the connectivity status of the device to be stored in an SERVER_SCOPE
attribute and then being displayed in the entity widget. All I've achieved is to generate an alarm when disconnected and cleared when (re)connected. I know there is a server side attribute called active
that changes true
immediately when device connects but it only turns false
after the inactivityTimeout
expired.
I also checked the ThingsBoard Device Connectivity Status page, the Create Alarm when the Device is offline guide and took long researches but couldn't get it to work.
Do you guys have any solutions or tips for me?
Kind regard.
lastActivityTime
server attribute which is appropriate for me but may not be for you.connected
(based onlastConnectTime
orConnectEvent
),disconnected
(based onlastDisconnectTime
orDisconnectEvent
), andlastActivityTime
would be neet to know too. The variables the states are based on are easy to show but I would like to have it as a binary connected variable or some string saying "connected"/"disconnected".connected = true
" and then save that via the Save Attributes node?