Pull
Senseye PdM has an extensive GraphQL API that can be used to poll for new cases. Alongside External ID support, it is often selected as a low friction method for notification integration.
Query¶
The following request makes use of the cases query on an organization to gather Cases which have opened since a given date. This can be used to gather the new cases since the last time the API was polled.
Cases have many attributes which may be utilized within the integration, the below example provides general information about the case along with the name and External ID for the associated asset.
The information generated by GenAI can be retrieved using the description value in the query.
The description field can be divided into:
- What’s happening – An explanation of what caused the case to open based on a given measure and the time the upward/downward trend or anomaly started.
- Possible explanations - Describes three possible explanations for the case to be opened. The three main reasons are marked with "**" followed by a description what could have caused that type of failure.
The links in the text will redirect you to measures and sensor information correlated to the case.
The ID for the chosen level of the hierarchy can be taken by extracting it from the URL in the application when the user is at the chosen level of the hierarchy. The ID being the string between nodeid=
and the next &
. For example, if the URL is https://app.senseye.io/settings/hierarchy-management?nodeId=9436480a-595d-4656-9e1c-483a84070d40&activeTab=properties&activeNodeConfigurationTab=computed
then the ID would be 9436480a-595d-4656-9e1c-483a84070d40
.
query($offset: Int, $limit: Int, $lastPollTime: Time) {
organization {
cases(offset: $offset, limit: $limit, openedAfter: $lastPollTime) {
results {
id
acknowledgement {
timestamp
}
latestManualNotificationEvent{
eventTime
message
state
user{
id
name
email
}
}
asset {
name
externalId
}
isOpen
openedAt
closedAt
primaryTrigger
triggers
description
}
}
}
}
{
"offset": 0,
"limit": 50,
"lastPollTime": "2025-01-03T00:00:00+01:00"
}
{
"data": {
"organization": {
"cases": {
"results": [
{
"id": "1cf5a1c0-152b-4e3b-bbb8-c43e74088874",
"acknowledgement": null,
"latestManualNotificationEvent": null,
"asset": {
"name": "Coating Drum CP5.1",
"externalId": null
},
"isOpen": true,
"openedAt": "2025-03-04T09:00:00Z",
"closedAt": null,
"primaryTrigger": "TREND",
"triggers": [
"TREND"
],
"description": "**What's happening**\n\n- Falling trend on https://app.senseye.io/measure/measure:e3c32b0f-b5ee-4f20-9519-9af90b9acffc:dm1 started 23 days ago.\n- Rising trend on https://app.senseye.io/measure/measure:e3c32b0f-b5ee-4f20-9519-9af90b9acffc:dm2 started 21 days ago.\n- Correlated behaviour on https://app.senseye.io/measure/measure:e3c32b0f-b5ee-4f20-9519-9af90b9acffc:dm3 and https://app.senseye.io/measure/measure:e3c32b0f-b5ee-4f20-9519-9af90b9acffc:dm4.\n**Possible explanations**\n\n- **Bearing wear or misalignment.** The rising trend in D.E. Bearing RMS and correlated behavior in NDE Bearing RMS suggest increased vibration, which could indicate bearing wear or misalignment. This is a common issue in rotating machinery and should be investigated to prevent further damage.\n\n - https://app.senseye.io/case/8c36ad73-d143-4490-8972-6e933b246532\n - https://app.senseye.io/case/b0fb16f7-89ca-447c-8bea-f32abb6373e6\n \n- **Electrical issues or motor inefficiency.** A falling trend in Motor Current Max could indicate reduced load or efficiency issues with the motor. This might be due to electrical problems or changes in operational conditions.\n\n \n- **Normal operational adjustments.** The absence of recent maintenance or notes might suggest that the observed trends are due to normal operational adjustments. However, given the concerning trends in bearing RMS values, this should be verified.\n\n "
},
{
"id": "74d228a3-5ed9-418f-82e6-6c76155df827",
"acknowledgement": null,
"latestManualNotificationEvent": null,
"asset": {
"name": "Outbound Pallet Conveyor AN 3",
"externalId": null
},
"isOpen": true,
"openedAt": "2025-03-04T09:00:00Z",
"closedAt": null,
"primaryTrigger": "ANOMALY",
"triggers": [
"ANOMALY"
],
"description": "**What's happening**\n\n- Upward level shift on measure https://app.senseye.io/measure/measure:d7264cf8-2873-43cc-9c2a-b535eba7a906:field4 on sensor https://app.senseye.io/sensor/d7264cf8-2873-43cc-9c2a-b535eba7a906.\n- Upward level shift on measure https://app.senseye.io/measure/measure:d7264cf8-2873-43cc-9c2a-b535eba7a906:field5 on sensor https://app.senseye.io/sensor/d7264cf8-2873-43cc-9c2a-b535eba7a906.\n- Upward level shift on measure https://app.senseye.io/measure/measure:d7264cf8-2873-43cc-9c2a-b535eba7a906:field1 on sensor https://app.senseye.io/sensor/d7264cf8-2873-43cc-9c2a-b535eba7a906.\n**Possible explanations**\n\n- **Gearbox or motor misalignment.** The upward step in gearbox RMS acceleration and motor RMS velocity could indicate misalignment issues. This simultaneous change suggests a mechanical issue affecting both components, which might require alignment checks.\n\n \n- **Increased load or tension.** The upward step in torque and belt tension could be due to increased load on the conveyor. This aligns with scenarios where operational load increases, affecting the torque and tension measures.\n\n \n- **Normal operational variation.** Conveyors can experience normal variations in torque and RMS measures due to operational changes. However, the simultaneous upward step in multiple measures is unusual for normal variation, suggesting a review of application sensitivity might be needed.\n\n "
}
]
}
}
}
}
Handling different maintenance systems across sites...
If different maintenance systems are used in different sites of your organization, you may wish to query just for cases within a given site. This is possible by querying for a specific sub-level of the hierarchy, then gathering the cases just from that branch of the hierarchy.
As example, the following section of the above query:
query($offset: Int, $limit: Int, $lastPollTime: Time) {
organization {
cases(offset: $offset, limit: $limit, openedAfter: $lastPollTime) {
...
}
}
}
could be replaced with the sublevel query:
query($offset: Int, $limit: Int, $lastPollTime: Time, $sublevelGUID: String) {
sublevel(id: $sublevelGUID) {
cases(offset: $offset, limit: $limit, openedAfter: $lastPollTime) {
...
}
}
}
or External IDs could be used to identify the sub-level using hierarchyNodeByExternalID and suitable type casting:
query($offset: Int, $limit: Int, $lastPollTime: Time, $sublevelExternalID: String) {
hierarchyNodeByExternalID(externalId: $sublevelExternalID) {
... on SubLevel {
cases(offset: $offset, limit: $limit, openedAfter: $lastPollTime) {
...
}
}
}
}
Aggregating Cases to a higher location within the hierarchy...
Assets within Senseye are often too low level for the maintenance system's hierarchy, and the Cases which are raised, need to be aggregated to a higher location within the hierarchy.
This can be achieved by gathering the path to the Case's Asset, along with the External IDs in use. In the example query above, the following section:
asset {
name
externalId
}
can be replaced with the following:
asset {
name
externalId
path {
name
externalId
}
}
which will provide the name and external id for the asset and all of its parents within the Senseye hierarchy. This can be used to select a suitable depth within the hierarchy for which to raise a Notification within your maintenance system. Please note that Assets can have only one open Case at a time, but when aggregating them up the hierarchy, there may be many open cases at a time on a given hierarchy sub-level.