My ultimate goal is to integrate ST with a Raspberry Pi controlling a relay for my garage doors. I have the Pi working with some basic Python code and can control the relays and contact switches - so hardware I feel is sorted. I’ll use CherryPy to create a REST interface.
Trying to learn the SmartApp component so I can see how to create the mappings needed for my REST interface on the Pi, I’ve been playing with the virtual switch, using APIGEE to test the code, as recommended in the docs. All seems to work well - I can query the switch in APIGEE and it will return to me the state that the simulator shows the switch to be in. However, when I try to change the state of the switch from APIGEE, the code runs, but doesn’t actually change the state. You can see here from the logs that I’ve tried using the array state change (although using only 1 switch in this example) as well as iterating the array and switching each individually. The logging shows that even though the code is called, the state hasn’t changed, reflected too in the simulator. Is there some kind of ‘commit’ needed?