openDTU - JSON - http post - "no values found" - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: openDTU - JSON - http post - "no values found" (/showthread.php?tid=5455) |
openDTU - JSON - http post - "no values found" - cgn - 08.06.2024 Hi all, I'm trying to integrate / control openDTU² into my W4k. I can already read the data from my openDTU. Now I'm trying to write data to my openDTU, which fails. Any idea? Code: json = require('json') I get the following response in the log: Code: * arg: 1 In case it's done; I'll post the full code here. ²https://www.opendtu.solar/firmware/web_api/#list-of-urls RE: openDTU - JSON - http post - "no values found" - admin - 10.06.2024 Try this: Code: json = require('json') RE: openDTU - JSON - http post - "no values found" - cgn - 10.06.2024 This is something which I already tried. In this case I get the following log: Code: * arg: 1 I log "body" as well and get the following result: Code: * string: {"limit_value":"10","limit_type":"1","serial":"000000000000"} I don't understand why the serial is still in the thrid position. I changed the code and expect the serial to be on first position. Why does this not happen? Code: body = json.encode({ For a common understandig - although it's not shown hier in the code, I use the correct serial and IP. RE: openDTU - JSON - http post - "no values found" - admin - 11.06.2024 Try this: Code: json = require('json') RE: openDTU - JSON - http post - "no values found" - cgn - 13.06.2024 This didn't work either. Nevertheless I found a solution for setting the limit without using the json lib. Code: ltn12 = require('ltn12') |