Hi.
There are a couple of formatting errors in your widget. I got it working with the following changes. I’m not the best coder in the world so you might want to double check; and I could not completely test it without waking the house up!
The main ones being ‘title’ needing to be under config (I think) and the unit on the slider needing to be in quotes as you wanted to use the ‘%’ sign.
Hope this helps.
Forgot to say; I think you want “_CurrentTrack” and not “_MediaTitle” for the trackItem parameter on the oh-player-controls. I didn’t correct that in my original reply.
Thank you, it mostly works now. I just wanted it to display all elements, which you have solved that so I can now hopefully learn the secret handshake on how to keep the yaml happy.
anyone tried storing a JSON inside a Item? Was able to read and parse it with JSON.parse but can’t figure it out how to write something back. Have an input (time) field and would like t read the time from Json, change it and store it with the sendbutton option
I was able to write json back to string. You need to stringify the JSON object. Otherwise you will paste the whole object to the item but this is not accepted by an string item.
If you use a ECMA script you can use the following:
On GUI pages this is not done out of the box. I used find and replace for this but it is ugly. Maybe in the future there will be a better solution available.
Ah thx. Yea already used the JSON stringify but didn’t think about using events.postUpdate ( ).
Im quite new to JavaScript and run in the problem of using a variable/prop inside the JSON.parse callup like
JSON.parse(items.myitem).wz.mo
is my current syntax which works but i want to use a prop insteadof the “wz” to use the widget dynamically. Any hints? (maybe it’s just to late for me and i dont’see the obvious)
Hi @ysc, i have been using the snapshots for past months, and really congrats to all the team to get the final version out
wanted to check if you would have a chance to look at the drop down options for oh-input type widgets, like list items, cards etc. thanks!
Hi @hmerk,
I try to color my buttons too.
Your code is working for lights and contacts.
But what is the correct code to change the color with a dimmer light item?
This doesn’t work for me when a dimmer is the item
It looks like it only changes the color of the dimmer slider background, but not the button background.
Lol. What is the status of this ui documentation? Is it ready to be included in the openHAB documentation? Because this thread has completely derailed into a q&a about ui instead of feedback on the documentation.
So either only useful feedback on the documentation page is posted here or this thread should be closed. And if one has a question about the ui open a new topic please.
We are rare on documentation contributors as usual. @rlkoshak is working on additional articles for the beginner tutorial.
So far no onw is working on a port to the docs for this yet.
Maybe closing this for now should be the best option.
@hmerk
The color from the dimmer slider changes with the posted code, but not the button background (like on normal switch icons) what I was looking for
So maybe this is a bug in OH3.