Noob ask help please

I need send command in this format:
Key arguments: “target_id” and “arguments”.
I think that I must send from button or from dimmer arguments:
divice_id=07, channel_id=06, intensity=64 (from 00 to 64 and that means intesity from 0 to 100(100DEC=64HEX)).
It means: target_id=0x07, arguments=0x06640001.
What I should do in things, items, rools, sitemap?
How from OH button send this http command?

You could use the http binding for this.

If you needed to send variable arguments, you would probably use a rule to build a string for the HTTP from your inputs

did not help yours links

Go one step at a time.

Sounds like you’d want to make Items for those, and want to display them in your sitemap, and control them from your UI. You must make the decisions, but I would guess you might want “target_id” to be a Number Item, that you can control from a Selection in the sitemap. “arguments” might be a Dimmer Item, controllable from a Slider.
See if you can make a start with that

RFM dont helping me : ((

Stating to not going to read the manuals ist not the best solution to find any help.

To solve your issue, you need a combination of virtual items and rules.
Define a virtual dimmer item to set your intensity in a range from 0 to 100
Create a rule that is triggered when your virtual dimmer changes
convert the dimmer value from decimal to hex
use HTTP action in your rule to send your http command.

Im full noob!
Im dont understand how to send http request when I change slider state.
Can some one write code for .sitemap, .items, .rools?

Why don’t you read the manuals and take a stab at it yourself and then ask questions. That way you learn so next time you may not need to ask, or you may be able to help someone else.


One step at a time. How far have you got so far, got an Item you can control with a slider on a sitemap? Another thread of your suggests you might have?

Im read manuals repeatedly.
There’s description of the structure.
And there are almost no examples that can be repeated to make sure that the example works.
And it on non-native language.
I can not understand even simple things. But I have a great desire. Before ask, I spend a lot of tests that can be found in this community

In rules I can get slider value.
But how to send http request?

One way would be to use the sendHttpGetRequest action in a rule.
Here’s a very short description for you not to read

There is a simple example of use here

So, you can already get your slider value, and lets guess you can trigger a rule on that value changing.

sendHttpGetRequest wants you to give it a string to work with, so your next job will be to work out how to make the string that you want to send, in that slider triggered rule.

You might start by having a fixed string GET request sent from the rule, to show that works.

Then next, you would look to make the string you want from parts. That might be something like the URL and first part of the GET parameters that you want, and then the string value of your slider, and then the rest of the GET parameter.

1 Like

In my case work this rule:

rule "Testing send http"
    Item test_item changed to OFF

But how to write this rule in one line?
Like this:
“Switch test_item “MySwitch %d]” { http=”>[ON:] >[OFF:]" }

You haven’t yet blended in your dimmer value to your sendHttpGetRequest action.

That is not a rule, it’s an Item definition. To do it that way is called binding an item. To be exact, this is an OH1 Item definition example that you have found, and it will not work simply with OH2, it needs the HTTP binding add-on.
It is possible to install the OH 1.x HTTP binding into OH2, but not especially simple for a beginner. It would I think be harder to include variables later (like the dimmer value).

Using the HTTP Action in a rule does not require the binding add-on.

1 Like