![]() |
|
JSON items into groups - Printable Version +- LogicMachine 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: JSON items into groups (/showthread.php?tid=5836) |
JSON items into groups - alexll - 13.01.2025 Hi there, I'm working with Airzone local API, and I need to write every item into LogicMachine group objects. This is my script: Code: require 'ltn12'And this is the response I get: Code: * table:I'm a newbie at json stuff. Please, can you help me with writing every item (systemID, zoneID, name, etc) into LogicMachine group objects? Thanks in advance! RE: JSON items into groups - RomansP - 14.01.2025 Hi alexll Here is a script Code: require('socket.http')RE: JSON items into groups - alexll - 14.01.2025 (14.01.2025, 07:58)RomansP Wrote: Hi alexll Great! Thank you so much!
RE: JSON items into groups - Erwin van der Zwart - 15.01.2025 Should it not be status = decoded[1].data ? RE: JSON items into groups - alexll - 15.01.2025 (15.01.2025, 07:51)Erwin van der Zwart Wrote: Should it not be status = decoded[1].data ? I don't know, but I have tried it and it works flawlessly. RE: JSON items into groups - Ceros2112 - 12.03.2026 Hi, I have the same situation but i need to switch on or off the device, is it possible? RE: JSON items into groups - admin - 12.03.2026 Try this. Event script mapped to a binary object. Change url, systemID and zoneID as needed: Code: require('json')RE: JSON items into groups - Ceros2112 - 12.03.2026 Thanks! It works but there is a little mistake here: Code: data = json.encode({here is my version: Code: data = json.encode({ |