This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.
Allows defining the states that must be logged in the event list.
The list can be shown in admin, web, vis, saved as PDF, material (not yet implemented).
Additionally, you can send events via Telegram or WhatsApp.
The events could be generated only in alarm mode.
The alarm mode could be controlled by variable eventlist.X.alarm
.
Additionally, the messages to messengers could be sent only if alarm mode is ON.
Use case:
You can enable the event list as a tab in the admin.
Event list could be shown under http://<IP>:8082/eventlist/index.html
. (for instances > 0: http://<IP>:8082/eventlist/index.html?X
, where X is the instance number)
Event list can be displayed as vis widget.
There is a possibility to generate a PDF document with all events.
Document title can consist the generation date if you place the pattern into it: Event list on {{YYYY MM DD}}
.
The exact description of time format could be found here: https://momentjs.com/docs/#/displaying/format/
The generation of PDF can be triggered by writing a true
into eventlist.0.triggerPDF
.
The PDF file could be accessed via:
http://<IP>:8082/eventlist/eventlist/report.pdf
(for instances > 0: http://<IP>:8082/eventlist/eventlist/report-X.pdf
, where X is the instance number)http://<IP>:8081/files/eventlist/report.pdf
(for instances > 0: http://<IP>:8081/files/eventlist/report-X.pdf
, where X is the instance number)The icons could not be shown in PDF.
Users can add custom events to the list via javascript:
// add custom event to event list
sendTo('eventlist.0', 'insert', {
event: 'My custom text',
id: 'ID.that.linked.with.this.event', // optional
ts: new Date('2020-09-25T16:11:00', // optional. Default is Date.now()
val: 5, // optional
duration: 5 // in ms
});
// Or simple
sendTo('eventlist.0', 'insert', 'My custom text');
// or
setState('eventlist.0.insert', 'My custom text');
// or
setState('eventlist.0.insert', JSON.stringify({event: 'My custom text %s', val: 5}));
User can request formatted JSON list for specific ID. Of course the ID must be enabled in the eventlist
before.
// add custom event to event list
sendTo('eventlist.0', 'list', {
ids: ['my.0.state.id1', 'my.0.state.id2'],
count: 10, // optional limit of maximal lines in table,
allowRelative: false, // optional if relative times, e.g. "one minute ago", may be used (Default: true)
}, result => {
console.log(JSON.stringify(result)); // array with events
// result = [{id: 'my.0.state.id1',
//
});
// or
sendTo('eventlist.0', 'list', 'my.0.state.id1', result => {
console.log(JSON.stringify(result)); // array with events
});
Users can delete some or all events from the event list.
// delete all events
sendTo('eventlist.0', 'delete', '*', result => {
console.log(`Deleted ${result.deleted} events`);
});
// delete all events for specific state ID
sendTo('eventlist.0', 'delete', 'hm-rpc.0.AEOI99389408.1.STATE', result => {
console.log(`Deleted ${result.deleted} events`);
});
// delete one event by timestamp
sendTo('eventlist.0', 'delete', '2020-10-20T21:00:12.000Z', result => {
console.log(`Deleted ${result.deleted} events`);
});
In the event texts and in the state texts, the following patterns could be used:
State changed to %s
=> State changed to 5
), State changed to %s%u
=> State changed to 5%
), %n changed state to %s
=> Device A changed state to 5
), State changed state on %t
=> State changed state on Sep Fr, 16:32:00
), State changed state %r
=> State changed state 5 seconds ago
),State was in previous state for %d
=> State was in previous state for 5s
), State was changed on %g%
=> State was changed on 1%
),State changed value from %o to %
=> State was changed on 1%
)E.g., you can show the specific list for instance 2, like http://IP:8082/eventlist/index.htmlindex.html?2
.
The generated report will be stored for instance 0 in eventlist/report.pdf
, but for instance 1 in eventlist/report-1.pdf
.
mui5
MIT License
Copyright (c) 2020-2024 ioBroker dogafox@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.