What is wrong with my code?

Hello
Would like to ask a view code or other problems I can not solve, thanks for advance!

  1. Dimmer Light_Office1 "Lampe PC" (Office,Lichter) {hue="1"}
    Result:
    no Dimmer feature, just on/off nothing between in the Browser. In the App I can see slider that work fine.

In the browser you won’t see a slider, just the arrow buttons you have in your picture above.
So everything is fine!

A switch looks different:

I can not dimm in the browser ? confused…
dimming would be from ?20 to 100% , can I show this value next to the slider? thx

[quote=“Richard_Nussdorfer, post:3, topic:3736, full:true”]
I can not dimm in the browser ? confused…[/quote]

That is not what I said. It’s just a different view: in the app you have a slider, in the browser you see the “slider” as two arrows, arrow down is for dimming down, arrow up is for dimmung up.

Just click on the arrow and hold it or click several times and the dimmer should work.

OK! just a click is on/off, holding is for dimming !
can I show the value of actual percentage? thx

Change your label from “Lampe PC” to “Lampe PC [%d %%]” to see the value.

Thx guys!
For learning, where did you get these infos, where can I get these ? thx

Back to the % of the dimming, could it be a value input, dimming to percentage is too tricky by browser… to fast (or a step of 1 per 500ms ??)
which possibilities do I have, what are all the parameters that could be used (syntax) ? thx

[quote=“Richard_Nussdorfer, post:8, topic:3736, full:true”]
which possibilities do I have, what are all the parameters that could be used (syntax) ? thx[/quote]

Read the binding page, all your questions are answered there!

OK, found some settings, do not understand all whats there, but hopefully in the future :wink:

the “Lampe PC [%d %%]” is not working in the App, in the Browser I can see it ?

  1. Date & Time
    items:

DateTime Datum “[%1$tA, %1$td.%1$tm.%1$tY %1$tT]” (Status) { ntp=“Europe/Berlin:de_DE” }

sitemap:

sitemap garden label="Garten"

{
Frame {
Group item=Office label=“Büro” icon=“office”
Switch item=Lichter mappings=[OFF=“AUS”,ON=“EIN”]
}
Frame label=“Datum und Zeit” {
Text item=Datum
}

}

all I get is mostly -;…-… sometimes there is
time and date (cfg = 60000)

also the frame is getting wrong?

To be honest?

What you created looks like a whole mess, you should start with the basics:

Items Configuration
Sitemap Configuration

and then take a look at the demos:

Item demo
Sitemap demo

I suggest you start with a simple switch in your items, then place it in your sitemap and after that try frames and group them all together …

And if ALL THAT works, then start with rules and persistence and everything else what you need.

Good luck.

Edit: One example why you should first learn the basics:

DateTime        Datum        "[%1$tA, %1$td.%1$tm.%1$tY %1$tT]"  (Status)   { ntp="Europe/Berlin:de_DE" } 

means, you have put DateTime in a group named “Status”. To see it on your sitemap you need to display that group OR you need to unassign DateTime from that group “Status” and display your DateTime instead as a normal item.

How this all works together you can find by reading the links above (and many more which you can find by using a search engine)

Actually I am just copying the most.
(Status) was a copy/paste error (but does not change anything at the output).
The wrong frame setup was just because there was no text inside ‘xxx’.
Now it works fine, but showing the time is useless because of the delayed update.

still I do not know why the App is not showing the % of dimming

One of the more challenging parts of working with sitemaps is understanding how the label works. I don’t think it is well described on the wiki (but I’ve no better ideas at the moment).

When you add a label text to an item there are two parts, the label name and the label value. The format is as follows:

"<name>[<value>]"

The <name> is a simple string and it can contain any valid character including spaces (but not newlines I think) and it is static. You usually put what the item is here (e.g. “Kitchen Light”). On the sitemap this part of the label will be left justified.

The <value> is always placed in brackets and it is supposed to represent the value of the Item. It too can contain any valid character to help you format the value (e.g. add a units label to the value). But it uses a special syntax for how you get at the value. This special syntax allows you to format the output of the value. For example, you may only want two decimal places in a float value or you may want to have the date-time formatted in a special way. The syntax for this is documented here.

In general, String.Formatter accepts a number of arguments and uses letters to tell it how to format the value when it prints it. To reference the arguments you use %N where N is the number of the argument. For example %1 is the first argument, %2 is the second, and so forth. On the sitemap there is only one value so you don’t have to use the number unless you are working with DateTimes (I don’t know why). So often you will only see a % followed by a letter for most values and %1 followed by a letter for DateTimes.

The letters that are supported and what they mean are documented at the site I linked to above. To take watou’s example the “%d” will print the numeric value as an integral (i.e. no decimal point).

The “%%” is a special case. Because ‘%’ means something to String.Formatter, you need a special way to just have the ‘%’ as part of your label in the value. That is what “%%” does.

So, using watou’s example, on your sitemap you will see, if your dimming value is 50% will look like:

Lampe PC                                      50 %

Hi Rich
Thanks a lot for your descriptions, I like that very much.
But it still does noch explain the difference, but this will be for now hidden in the code.

Actually now I am learning so many things I never used before, pushing me and my less time for it over the limit is of course a normal thing. I try my best (writing here with my 2 year old child sitting on my leg) to push me and you guys to get to a result and I think its gone fare for the short time. Still I have just started and have to learn a lot, but now I am still happy with it learning these things. One week ago I didn’t know about Python… :wink: Thanks guys!