BBernstein Posted April 8, 2022 Posted April 8, 2022 I would like to do the following, which I think is a pretty generic capability: 1) execute a network resource using a GET sting built from fixed text and variables. 2) capture a return JSON and return a specific response field into a variable. Has anyone done anything similar, or know if the capability is coming (I'm on Polisy 5.4.2) Thanks.
MrBill Posted April 9, 2022 Posted April 9, 2022 Network resources are one way traffic only. You can build your get string bases on variables, there are not currently string variables available although that may be coming in some form or another if I read another thread correctly. Number 2 on your list is not possible. Instead you need to create a node server.
BBernstein Posted April 10, 2022 Author Posted April 10, 2022 Thanks for the reply. Is there a guide for building a get string? I don't see a way to put a variable ID using the network resource tab.
MrBill Posted April 10, 2022 Posted April 10, 2022 the Wiki page is here: https://wiki.universal-devices.com/index.php?title=ISY-994i_Series_INSTEON:Networking:Network_Resources also these substitution strings can be used in the body or path portion of URL for the network resource. as you scroll thru that page you'll discover not only the ability to include variables but any nodes info. I've not used the replacements in the path portion of the NR before but there might be a need to check or uncheck the encode checkbox to the right of the path entry box. @larryllix can probably tell use for sure, IIRC he's done that type of replacement extensively with his wifi bulbs.
larryllix Posted April 10, 2022 Posted April 10, 2022 (edited) Here is a sample NR that talks to my RPi NRbridge software and controls my WiFi bulbs. These are the variable values I send This is the NR I use to send the variable values. Note the format included in the strings. A word of warning that variables are encrypted at send time and not at invocation time. @Michel KohanimIOW: If you change the value of a variable immediately after use in your program, the new value will get sent. This is a factor in making ISY and IoP very slow for lighting control. Every program line requires a Wait 1-3 seconds delay for repeated usage of the NR. Edited April 10, 2022 by larryllix
Recommended Posts