Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. Scripting / Logic
    4. JavaScript
    5. PoC: JSON State Mapper for the ioBroker Javascript Engine

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    PoC: JSON State Mapper for the ioBroker Javascript Engine

    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stev-io last edited by

      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).
      622c7bed-bc13-4892-97ec-b009f222e217-grafik.png

      How exactly it works and what is needed is documented in the README in the repo.

      Cheers

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate

      908
      Online

      31.8k
      Users

      80.0k
      Topics

      1.3m
      Posts

      javascript
      1
      1
      247
      Loading More Posts
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
      The ioBroker Community 2014-2023
      logo