UncleSamSwiss/ioBroker.loxone

Feature request: Message statistics/better 'Unknown event' detection

raintonr opened this issue · 1 comments

I sometimes see 'odd' behaviour from our Miniserver and wanted to check that it was not spitting out lots of traffic via the WS connection to ioBroker.

I think it might be nice to include some statistics on number of WS messages sent/received and update this periodically. This could also be a good opportunity to count number of times 'Unknown event' is detected and also expose that info.

An example of how this could be done would be to create states...

loxone.x.messagesReceived
loxone.x.messagesSent
loxone.x.unknownEvents

... and increment these counters as necessary.

It may be appropriate to keep an internal count of these values and only actually update the states once every x seconds (if changed) in order to avoid excessive updates. The existing values should be read at startup to avoid constantly resetting to zero.

On the same topic, it may also be useful to include...

loxone.x.lastUnknownEvents

... for troubleshooting as unknown events are currently only logged in debug mode.

Ie. When this kind of thing occurs...

2022-12-02 07:31:49.085  - debug: loxone.0 (10069) Unknown event 12e5ff44-0150-ec8b-ffffafc5b2cd852f: 19.812823343848585
2022-12-02 07:31:50.066  - debug: loxone.0 (10069) Unknown event 172548e7-01dd-4617-fffff62eeb38b63d: 0.6377083333333334
2022-12-02 07:31:58.487  - debug: loxone.0 (10069) Unknown event 176f8e85-024c-477a-ffff44ad78b611ef: 25.49375

... the loxone.x.lastUnknownEvents would contain:

[
  { "UID": "12e5ff44-0150-ec8b-ffffafc5b2cd852f", "count": 999, "lastValue": 19.812823343848585 },
  { "UID": "172548e7-01dd-4617-fffff62eeb38b63d", "count": 999, "lastValue": 0.6377083333333334 },
  { "UID": "176f8e85-024c-477a-ffff44ad78b611ef", "count": 999, "lastValue": 25.49375 }
]

The 999 count being the number of times this event UID has been seen and the lastValue being useful to help troubleshooting.

I would propose making this an array of limited length (say last 10 events) and updating only periodically avoid possibly huge state values and a large number of updates.

Fixed in 3.0.1