[SOLVED] Need help in HTTP binding with dimmer

Hi,
As stated by @rlkoshak, the loop is obvious!
To conclude: [quote=“Nishit, post:1, topic:30678”]
Rule "RED LED"
when
Item Led_R received command
[/quote]

and then changing the Led_R state in the same rule

it does end in an infinite loop

Best regards,

George

George,
How should I change it?

Why not using this as @rlkoshak himself already laid as a suggestion. I do think he nailed it!

George,
I read that thread, and understood the example of dimmer, but how should I send that value of variable via http binding?
Are my item setting for it OK??(Just the binding part, as I would add a proxy item with it)

Dimmer Led_R	"Red"	(FF_Nishit, Lights){http=">[*:GET:http://192.168.0.108:5000/red3/%2$s]"}

Rich,
What should I do to avoid looping?

As the Link says:

  1. create a proxy Item
  2. put the Proxy Item on your sitemap
  3. trigger your rule by the Proxy Item
  4. in the rule, send the new state to your HTTP Item.
1 Like

I guess the proxy item and bounding items are just the names and can be named as anything else, Am I right?

Dear @Nishit,

I hope you are doing well! As rude as I may seem, I will not apologize: I already pointed you, how to do it!!!

Best regards,
George

Dear Rich,

You’re a peach!!!

It rhymes coincidentally!

George

1 Like

You can name any Item anything you want.

You said at one point, if I remember correctly, that you have been using OH 1 for some time. Your questions make we wonder if you do not have as much experience as needed.

I recommend reading the Beginner’s Tutorial, if you truely have experience with Oh 1, the Migration Tutorial, and the Introduction and Concepts sections of the Manual. You might also get some benefit by activating the demo and looking at the demo configs.

There is clearly a disconnect between your experience and knowledge of how OH works and my expectations of what you should know as someone who has used OH 1 for some time.

Now, if I’m wrong and it was someone else who said that then I apologize. Regardless you should read the above resources.

1 Like

Yes,
I have used OH1 in past, but then due to hardware failure I had to concentrate on learning linux and python so I lost the command over OH, but I will read your suggestions, thanks for the help.

Rich,
I tried some rules,
but with my current settings of rules and items, the http binding sends the whole link like this ‘192.168.0.108:5000/red3/?d=%2$s’

where as it should send the value sent by the rule/ the python script returns: 'could not convert string to float’
Here are my rules settings:

rule "blue led"
when
    Item Led_B received command
then 
    if (receivedCommand == DECERASE){
	Led_B.sendCommand((Led_B.state as DecimalType) - 5)
}
   else if (receivedCommand == INCREASE){
        Led_B.sendCommand((Led_B.state as DecimalType) + 5)
}	
end

and items settings:

Dimmer Led_B   "Blue"   (FF_Nishit, Lights){http=">[*:GET:http://192.168.0.108:5000/blue3/?d=%2$s]"}

can you suggest anything here?

Spreading your problem over two threads is not helping

Try the suggestion to add some formatting in the Item label

It’s not all clear to me where the binding gets the ‘format’ string that %2 is supposed to refer to

Rossoko,
I also tried udo’s suggestion, but I only get the value update in the sitemap(in UI app), but the same value is not transmitted to my http server.

What binding version are you using? Dimmer type support in the binding only appeared in Nov 2016. I do not know which OH versions that will have got into.

I haven’t checked the version of the binding, but I installed it through the paper UI, so I guess it should be the latest version.

I checked the version of my binding, it is 1.9.0

Rossoko,
How to update the http binding version?, I checked the thread mentioned by you, but the file is missing from Dropbox.

I believe you will get current from
https://openhab.ci.cloudbees.com/job/openHAB1-Addons/lastSuccessfulBuild/artifact/bundles/binding/org.openhab.binding.http/target/

There are a few threads on updating 1.x bindings

Rosso,
Thanks for your help, it was the version 1.9.0 which was not updating the state, I installed the latest version 1.11.0 which did the trick.