NEWS
PoC: JSON State Mapper for the ioBroker Javascript Engine
-
Hi all!
I am ioBroker newbie, working a lot with devices that publish JSON documents. So I was looking for ways to automatically persist values from the JSON document as separate data points. The whole thing as configurable as possible (and in some way scalable, meaning only once per same device type and not for each device individually). Effectively without the need to customize scripts. Since with moderate research I couldn't find a solution that best served my preferences and working methods, and I parallely wanted to delve into the depths and shallows of ioBroker anyway, I designed my own software component (a TypeScript module). In the spirit of a proof of concept so that I can see if my wish could be realized. Likely, there are better solutions out there, too, or my flow is not that of the general public, which is why my solution may not be a good fit for others. But: Since on my way to a working solution I got lost in details, the component has therefore already gained some size, I thought I could share the current state of work. It can be found here:
https://github.com/stevenengland/iobJs-JsonStateMapper
Roughly speaking, one configures which data points containing JSON documents (source data points) one wants to subscribe to and where (target data points) which values from the source should be written to:
Here's an example image of a Tasmota socket from which I want to transfer the consumed power from SENSOR (natively from TASMOTA) to CURRENT_POWER (specially created data point).
How exactly it works and what is needed is documented in the README in the repo.
Cheers