ioBroker / ioBroker.eventlist

Create user defined events lists in ioBroker
MIT License
6 stars 5 forks source link
event-list-view iobroker

Logo

ioBroker.eventlist

Number of Installations Number of Installations NPM version

Test and Release Translation status Downloads

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.

Event-List adapter for ioBroker

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.

List

PDF

Alarm mode

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:

Possible presentations

In Admin as tab

You can enable the event list as a tab in the admin.

Web

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)

Vis Widget

Event list can be displayed as vis widget.

PDF generation

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:

The icons could not be shown in PDF.

Message box

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`);
});

Patterns

In the event texts and in the state texts, the following patterns could be used:

Usage of multiple instances in web

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.

Todo

Changelog

2.0.1 (2024-02-11)

2.0.0 (2023-10-12)

1.2.4 (2023-05-17)

1.2.3 (2023-03-16)

1.2.2 (2022-12-27)

1.2.1 (2022-12-23)

1.2.0 (2022-11-12)

1.1.1 (2022-10-12)

1.0.1 (2022-06-22)

1.0.0 (2022-06-20)

0.5.5 (2022-04-23)

0.5.4 (2022-02-14)

0.5.3 (2022-02-13)

0.4.4 (2021-06-24)

0.4.3 (2021-04-19)

0.4.2 (2020-12-05)

0.4.0 (2020-11-10)

0.2.9 (2020-10-20)

0.2.8 (2020-10-14)

0.2.6 (2020-09-25)

0.2.5 (2020-09-24)

0.2.1 (2020-09-21)

0.1.3 (2020-09-15)

0.0.3 (2020-09-08)

0.0.2 (2020-09-07)

0.0.1

License

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.