Engineerisaac Posted June 21, 2017 Share Posted June 21, 2017 I'm reaching out to you guys because I am simply curious on what the best practice would be for running a driver that synchronizes variables to a web service either via incremental timer or some format of restful update. I know it's rather a broad request but I'm really just looking for some idea or maybe if someone's willing example code on a good practice that won't drain the processor power of the controller but yet keep variables within sync of a http baised cloud service. I'm asking for help because my understanding in this area is rather limited even though I'm well-versed in Lua I know that control for has limitations on what Lua can do. Link to comment Share on other sites More sharing options...
msgreenf Posted June 21, 2017 Share Posted June 21, 2017 Yes you can do this. On event or timer would both work. Sent from my Nexus 6P using Tapatalk Link to comment Share on other sites More sharing options...
Engineerisaac Posted June 21, 2017 Author Share Posted June 21, 2017 I guess I need to be more clear to I'm sorry you guys. I'm looking for this action to be automated within the driver itself not within composers actions. So I guess my real goal here is this let's say that the customer has a thermostat and I want to read the thermostats temperature data so as a dealer I would add this magic driver to my project then go into my thermostat and select on temperature change update variable. Now on this magic driver when it notices that the variable has changed it automatically sends the update to the web service. Maybe I'm really asking how can I automatically send a post request from that driver when that drivers variable changes. Expressively I'm looking for Lua based help Link to comment Share on other sites More sharing options...
msgreenf Posted June 21, 2017 Share Posted June 21, 2017 yeah, you can register your driver for events, so when an event occurs it will notify your driver, then your driver can run a HTTP Post with a JSON body to post to your service Link to comment Share on other sites More sharing options...
Engineerisaac Posted June 21, 2017 Author Share Posted June 21, 2017 Yes I'm well aware that it's possible I'm really just looking for a hand holding moment due to my ignorance is there any examples such as unencrypted learning drivers I can poke through to figure out how I can do this? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.