Maybe somebody can help to find a solution. I am trying to add a local variable to a json url command without success. The following command is working well and the RBG color will change.
os.execute('curl "http://127.0.0.1:8080/json.htm?type=com ... hite=false"')
but if I replace the hex value by a local variable the curl command end with an error.
os.execute('curl "http://127.0.0.1:8080/json.htm?type=com ... hite=false"')
I tried serveral things to to create first the the http string and store it to a variable but everything will fail.
What am I doing wrong? Please help
Lua Script tu update a device with json url -help
Moderators: leecollings, remb0
- jvdz
- Posts: 2445
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Lua Script tu update a device with json url -help
Post your lua script code in a codebox </> so we can see exactly what you coded and tell us the error you get.
- psubiaco
- Posts: 233
- Joined: Monday 20 August 2018 9:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Italy
- Contact:
Re: Lua Script tu update a device with json url -help
Edited:
THIS DOES NOT WORK
THIS WORK CORRECTLY!
THIS DOES NOT WORK
Code: Select all
os.execute("curl http://127.0.0.1:8080/json.htm?type=command¶m=setcolbrightnessvalue&idx=14&brightness=12&hex=" .. RGB .. "&iswhite=false")
Code: Select all
os.execute("curl \"http://127.0.0.1:8080/json.htm?type=command¶m=setcolbrightnessvalue&idx=14&brightness=12&hex=" .. RGB .. "&iswhite=false\"")
Last edited by psubiaco on Saturday 19 August 2023 14:53, edited 1 time in total.
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
-
thaui
- Posts: 59
- Joined: Sunday 15 March 2015 19:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Hamburg
- Contact:
Re: Lua Script tu update a device with json url -help
@psubiaco
the first recommended line is not generating any error in the protocol, but it's also not doing anything.
the second one is working well. Thanks you saved me many hours of playing around
the first recommended line is not generating any error in the protocol, but it's also not doing anything.
the second one is working well. Thanks you saved me many hours of playing around
- psubiaco
- Posts: 233
- Joined: Monday 20 August 2018 9:38
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Italy
- Contact:
Re: Lua Script tu update a device with json url -help
Ok, I've edited my post to let people solving this issue quickly.
Have a nice weekend!!
Have a nice weekend!!
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Who is online
Users browsing this forum: No registered users and 1 guest