Bit fields and bitwise operations

I would like to represent the status (open/close) of multiple windows for further use (e.g. alarm system). My idea was to put the status of all devices in one bit field. A bit field seems to be very handy, especially if you want to make bitwise logical operations in order to change or read one of the bits.
Strange to say NodeRed does not support fields natively, does it? So, what would you suggest alternatively? Otherwise I would try to realize that with function nodes/JS.

Welcome to the forum @Graefe

Why bother? Generally it would just complicate the code.

It isn't node-red that would have to support it, it is javascript.

JavaScript does support bitwise operations, but with a bunch of clumsy conversions between 64-bit floating point and 32-bit signed integers. Unless your application can really benefit from logical or shift operations on binary numbers, it's probably not worth the bother.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.