New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsonExpand - Expand json state values into individual states #910
Comments
I already implemented a package to parse json objects into ioBroker states maybe this can help here. |
@TA2k Lets collaborate and I implement your library into an adapter? |
json2iob is no adapter but a callable npm pacakge o be used by js code I would suggest you open a issue at the adapter where you are missing expanded infomation. Expanding json data without knowlegde about the contents is not desired, as setting meaningful units and roles would not be possible. json states can be used by scripts without any problems. And - as far as I know - json data can be used by some widgets within visualisation too. |
@mcm1957 it looks like |
What kind of device or service would you like to see an adapter for?
Expand json state values into individual states.
E.g., Tasmota provides sensor information in the state
SENSOR
. There is no way to work with this data other than parsing it in scripts. Furthermore you can not configure triggers on this data because it will trigger for every change and not only for e.g.SENSOR.ENERGY.Power
.Is the device connected to the internet or only available on a local network?
local
Is an official App or Website available?
no
Is an official API including documentation available?
not applicable
Are other libraries for an integration available?
no
Is this device already integrated in other Smart Home systems?
not applicable
Is this device already integrated in homebridge? Might the ham adapter in combination with the homebridge plugin be sufficient?
not applicable
Additional context
Some adapters states contain json content. In order to be able to work with the content of the json, the data needs to be parsed in JS or any other kind of script. For beginners this is not very handy and also for more advanced users it is a little bit annoying writing scripts for each state or adapter in order to access the data which is need.
A few examples of how this adapter works:
Tasmota Sensor Values
The reason why smart plugs with power metering are used is often times to react to certain states of said power metering. Tasmota provides all sensor information in a single state
tele.SENSOR
.iCal Events
iCal only provides boolean states for events. If the pattern matches the event it will set
events.0.now.<Eventname> = true
. However, there is no further information for this event other than in thedata.table
state. The table state holds all events and needs to be parsed to extract more information. Using jsonExpand this information can be split into separate states for each event.Now with the individual states triggers can be implemented more efficiently and also custom settings can be made for each state.
I have already implemented this via Typescript but am planning to release a adapter which will add a custom setting for each state which allows you to expand this state into either
SENSORx
which indicates this state has been expanded from stateSENSOR
0_userdata
The text was updated successfully, but these errors were encountered: