PLEG luup.inet.wget issue

Hi to all,
I need to send the code with PLEG but

luup.inet.wget( "192.168.4.57/control?cmd=event,SetTemp=43" )

is not work, but when I send the code with

luup.inet.wget( "192.168.4.57/control?cmd=event,SetTemp%3D43" )

it works once and it return code

luup.inet.wget( "192.168.4.57/control?cmd=event,SetTemp=43" )

again then not works again. Do you have any suggestion?

Do you have repeats turned ON or OFF?
Try it toggled either way and see if it works as you intend.
Otherwise post a Status Report and description of the device and what you want it to do.

repeat mode ON, should I turn it OFF?

Turn it OFF and see what it does.

Not sure what device you are sending that to, but the syntax looks a bit odd. Should you be using & rather than , between the parameters?

 luup.inet.wget( "192.168.4.57/control?cmd=event&SetTemp=43" )

But & is necessary to use for making the script to work

OK, just a thought. I believe it should be & but you have written ,

I am really sorry “,” is necessary to use for making the script to work I try with “&” but not work. I am reading the URL encoding things for a while and my mind is mixed :frowning:

Can you control the Report with your experienced view?

Properties

Name Device Name Device Variable Value Last Change Previous Change
p_dis_hava Dis Hava Isi[45] CurrentTemperature[urn:upnp-org:serviceId:TemperatureSensor1] 4.0 2019-12-30 17:42:13.324 2019-12-30 17:40:13.294

Conditions

Name Options Logic Expression Value Last True (or Last Change) Last False (or Previous Change)
c_dis_hava_eksilerde Repeats p_dis_hava < 0 false 0 2019-12-30 17:42:13.329
c_dis_hava_0_3 Repeats 0 <= p_dis_hava AND p_dis_hava < 3 false 2019-12-30 14:25:57.921 2019-12-30 17:42:13.330
c_dis_hava_3_7 Repeats 3 <= p_dis_hava AND p_dis_hava < 7 true 2019-12-30 17:42:13.331 2019-12-30 14:25:57.924
c_dis_hava_7_11 Repeats 7 <= p_dis_hava AND p_dis_hava < 11 false 2019-12-29 13:24:56.258 2019-12-30 17:42:13.334
c_dis_hava_11_15 Repeats 11 <= p_dis_hava AND p_dis_hava < 15 false 2019-12-29 13:24:56.259 2019-12-30 17:42:13.336
c_dis_hava_15_denbuyuk Repeats p_dis_hava >= 15 false 0 2019-12-30 17:42:13.337

Actions

Name When Defined Actions
c_dis_hava_eksilerde Condition is True with Repeats LUA; Immediate - 0
c_dis_hava_0_3 Condition is True with Repeats LUA; Immediate - 0
c_dis_hava_3_7 Condition is True with Repeats LUA; Immediate - 0
c_dis_hava_7_11 Condition is True with Repeats LUA; Immediate - 0
c_dis_hava_11_15 Condition is True with Repeats LUA; Immediate - 0
c_dis_hava_15_denbuyuk Condition is True with Repeats LUA; Immediate - 0

Action: c_dis_hava_eksilerde

LUA:

luup.inet.wget( “192.168.4.57/control?cmd=event,SetTemp%3D50” )

Device Actions:

Immediate

Device Action Arguments

Action: c_dis_hava_0_3

LUA:

luup.inet.wget( “192.168.4.57/control?cmd=event,SetTemp%3D49” )

Device Actions:

Immediate

Device Action Arguments

Action: c_dis_hava_3_7

LUA:

luup.inet.wget( “192.168.4.57/control?cmd=event,SetTemp%3D48” )

Device Actions:

Immediate

Device Action Arguments

Action: c_dis_hava_7_11

LUA:

luup.inet.wget( “192.168.4.57/control?cmd=event,SetTemp%3D46” )

Device Actions:

Immediate

Device Action Arguments

Action: c_dis_hava_11_15

LUA:

luup.inet.wget( “192.168.4.57/control?cmd=event,SetTemp%3D44” )

Device Actions:

Immediate

Device Action Arguments

Action: c_dis_hava_15_denbuyuk

LUA:

luup.inet.wget( “192.168.4.57/control?cmd=event,SetTemp%3D43” )

Device Actions:

Immediate

I’m sorry. PLEG means absolutely nothing to me at all.

Turn Repeats Off, it isn’t required.

OK but what does the repeat do? I want to learn its usage.

Sometimes Repeats has unintended consequences such as you are experiencing.
Turning it off may help, it may not but it won’t break anything you have running.
PLEG Basics attempts to explain it, generally when the question was asked if a Condition didn’t work as expected the first place to go was to toggle “Repeats”.
Mightn’t be the magic bullet that you asked for but worth trying.

OK I will try and see what will happen.

I solve my own problem. Maybe somebody need that page later. So issue came form my mistake when building Logic Expression. My Logic Expression is like 0 <= p_dis_hava AND p_dis_hava < 3 but it should be (0 <= p_dis_hava) AND (p_dis_hava < 3). I forget to use brackets. By the way, Repeats mode is off.

1 Like