Jey-Cee / ioBroker.enocean

Connect and control your EnOcean devices with ioBroker.
Other
23 stars 10 forks source link

The "enocean.0.0190xxx." is invalid. Ids are not allowed to end in "." #28

Closed KLVN closed 3 years ago

KLVN commented 3 years ago

Describe the bug
Since v0.3.1 my motion sensor Eltako FABH65S is supported and I'm able to read the states, however, it's not very reliable and every time there's a signal incoming (e.g. when forcing the teaching mode of the sensor) I get this error and the adapter crashes.

To Reproduce
Steps to reproduce the behavior:

  1. Add new device, choose FABH65S, insert ID (with leading zero, different from the label on the backside or copy & paste last received ID)
  2. Put a magnet close to the sensor to initiate teaching/pairing mode
  3. Adapter crashes (see log)
  4. Wait for adapter to start again, trigger sensor after a few minutes, adapter crashes again

Screenshots & Logfiles

-- -- -- --
enocean.0 2021-01-27 01:08:20.247 info (7830) starting. Version 0.3.1 in /opt/iobroker/node_modules/iobroker.enocean, node: v12.18.3, js-controller: 3.1.6
host.ioBroker 2021-01-27 01:08:17.667 info instance system.adapter.enocean.0 started with pid 7830
host.ioBroker 2021-01-27 01:07:47.628 info Restart adapter system.adapter.enocean.0 because enabled
host.ioBroker 2021-01-27 01:07:47.621 info instance system.adapter.enocean.0 terminated with code 0 (NO_ERROR)
enocean.0 2021-01-27 01:07:47.074 info (7683) Terminated (NO_ERROR): Without reason
enocean.0 2021-01-27 01:07:47.072 info (7683) terminating
enocean.0 2021-01-27 01:07:47.056 info (7683) The serial port was closed.
enocean.0 2021-01-27 01:07:47.046 info (7683) cleaned everything up...
enocean.0 2021-01-27 01:07:47.041 error at processTicksAndRejections (internal/process/task_queues.js:97:5)
enocean.0 2021-01-27 01:07:47.041 error at runMicrotasks ()
enocean.0 2021-01-27 01:07:47.041 error at handleType1.main (/opt/iobroker/node_modules/iobroker.enocean/lib/tools/Packet_handler.js:157:16)
enocean.0 2021-01-27 01:07:47.041 error at handleType1.setState (/opt/iobroker/node_modules/iobroker.enocean/lib/tools/Packet_handler.js:174:22)
enocean.0 2021-01-27 01:07:47.041 error at Enocean.setStateAsync (/opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:1584:16)
enocean.0 2021-01-27 01:07:47.041 error at new Promise ()
enocean.0 2021-01-27 01:07:47.041 error at /opt/iobroker/node_modules/iobroker.js-controller/lib/tools.js:1585:16
enocean.0 2021-01-27 01:07:47.041 error at Enocean.setState (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:5713:17)
enocean.0 2021-01-27 01:07:47.041 error at validateId (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:518:23)
enocean.0 2021-01-27 01:07:47.041 error (7683) Error: The "enocean.0.0190xxxx." is invalid. Ids are not allowed to end in "."
enocean.0 2021-01-27 01:07:47.033 error (7683) unhandled promise rejection: The "enocean.0.0190xxxx." is invalid. Ids are not allowed to end in "."
Unhandled 2021-01-27 01:07:47.031 error promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().

Versions:

KLVN commented 3 years ago

Looking at the faulty code line I assume my sensor isn't responding with a shortcut or it's just empty and therefore this.adapter.namespace + '.' + deviceId + '.' + shortcut results in a state-name ending on .

Jey-Cee commented 3 years ago

Found the issue and fixed it. It is already on github.