Using webCoRE to create an interface to another unsupported hub system (QwikSwitch) / Parsing data


#21

Hmm, you mean like

deviceStates = 123456:0,234567:1 etc?


#22

Yip, like that. My understanding is that I have to put the cleaned up data into a variable so that I can extract the status of each device from there. Once Iā€™ve done that, I will write the status of a device, to another variable. Iā€™ll have a variable for each physical device containing the status of the device.


#23

Hmm, Iā€™m getting a stray comma in the outputā€¦ need to fix that.

Edit: I uploaded a modified oneā€¦ hopefully the output looks easier to read. 8 secs to process all thatā€¦ hmm, how to speed it up.

|+7695ms|ā•‘ā•‘0ce830:0, 224860:0, 0c8c30:0, 0ceb70:0, 207100:0, 16a400:0, 2070c0:1, 2070a0:1, 0ce880:0, 0cecb0:0, 2248b0:0, 0ce7f0:0, 0c8b20:0, 0acf30:0, 09e490:0, 0acfd0:0, 0c8dd0:0, 169b80:0, 0d0ce0:0, 0d53d0:0, 0ce7e0:0, 0c8b70:0, 0cefb0:0, 148320:0, 2070b0:0, 0ce890:0, 0ce790:0, 1002d0:0, 1fb970:0, 0c8bd0:0, 0ceba0:0, 0cefd0:0, 0ce770:0, 206b50:1, 0c8b90:0


#24

Aha, I thought it had to be something like that, but I lack the programming skills.

Thanks a million! Really appreciate your assistance.


#25

This was fun, learning experience for me also. Iā€™m curious how to use this to update ST virtual devices also. Hmm


#26

Iā€™m not sure what Iā€™ll use to trigger the piston, but Iā€™ll at least set it up to run every 5 minutes to check for changes.
The idea is basically to set up the piston like this: IF variable A (i.e. the variable containing the states of a QwikSwitch device) change from 0 to 1, then turn Virtual Switch A ON (and the other way around.) Iā€™ve set up one example and it seems to be working fine.
I still have to work out the logic of how many pistons Iā€™ll use to keep the actual QwikSwitch and ST Virtual Switches in sync in both directions. (If a device is turned on from the QwikSwitch side, the update in the ST direction will probably be slow, i.e. when the piston runs every 5 minutes e.gā€¦ I donā€™t think there is a way to get the Qwikswitch hub to trigger the piston if the status of a QS device change e.gā€¦ The most obvious solution is to schedule the piston to run every x minutes, or if a QwikSwitch device is turned on via an ST Virtual Switch)