Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to subscribe to new alarms on websocket? #10616

Closed
Philip2809 opened this issue Apr 23, 2024 · 1 comment
Closed

How to subscribe to new alarms on websocket? #10616

Philip2809 opened this issue Apr 23, 2024 · 1 comment
Assignees
Labels
question generic question

Comments

@Philip2809
Copy link

Component

  • Generic

Description
If possible, how can a subscribe to a new alarm creation? I know that I can create a notification rule when an alarm is created and subscribe to that, but that is not the best way for me, how could I subscribe to new alarms directly, is that even possible, if not could that be a feature?

Environment

  • ThingsBoard: CE 3.6.4
@Philip2809 Philip2809 added the question generic question label Apr 23, 2024
@Philip2809
Copy link
Author

Figured it out, you have to send something like this to the websocket:

{"cmds":[{"type":"ALARM_DATA","query":{"entityFilter":{"type":"entityType","resolveMultiple":true,"entityType":"DEVICE"},"pageLink":{"page":0,"pageSize":10,"textSearch":null,"typeList":[],"severityList":["CRITICAL","MAJOR","MINOR","WARNING","INDETERMINATE"],"statusList":["ACTIVE","CLEARED","ACK","UNACK"],"searchPropagatedAlarms":false,"assigneeId":null,"sortOrder":{"key":{"key":"createdTime","type":"ALARM_FIELD"},"direction":"DESC"},"timeWindow":86400000},"alarmFields":[{"type":"ALARM_FIELD","key":"createdTime"},{"type":"ALARM_FIELD","key":"originator"},{"type":"ALARM_FIELD","key":"type"},{"type":"ALARM_FIELD","key":"severity"},{"type":"ALARM_FIELD","key":"status"},{"type":"ALARM_FIELD","key":"assignee"}],"entityFields":[],"latestValues":[]},"cmdId":3}]}

You can find out more by using the alarms table widget. This does not require any notification rules!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question generic question
Projects
None yet
Development

No branches or pull requests

2 participants