Use case: program lights to turn on/off at random times of the day when I am away on holiday so that the house looks occupied. See: https://github.com/tim-hellhake/scheduler-adapter/issues/2
I guess this would require the initial start time and end time to be randomly generated and be generated again each time that the “scheduler end” event fires.
I imagine that there might be other use cases for other adapters which might involve some king of “random” configuration" value.
Any thoughts?
Gateway support/involvement involved?
How would this be implemented? A quick search for “Mozilla Iot standalone script” didn’t find anything useful. Would it need to be incorporated into the scheduler adapter? Or something like a separate Python script - if so, called from where?
Thanks.
Just a normal Python script would be fine, running wherever you want. It would interact with the gateway over HTTP, using the spec linked in my last post.
Here are some examples from @twobraids, although you don’t necessarily need to use pywot
:
- http://www.twobraids.com/2018/10/the-things-gateway-pythonic-rule-system.html
- http://www.twobraids.com/2018/10/the-things-gateway-its-all-about-timing.html
- http://www.twobraids.com/2018/10/things-gateway-sunrise-sunset-swifty.html
- http://www.twobraids.com/2018/10/things-gateway-running-web-things-api.html
I’ve looked at twobraids blog before, but I’m afraid that writing a script based on his ideas is beyond my ability. And I’m reluctant to try to write a one-off script that is not an integral part of the gateway/addons architecture and not readily re-useable by others.
Just as an idea, couldn’t something like Node-red https://nodered.org/ be incorporated into the architecture? I appreciate that you don’t want to make the current rules engine too complicated and therefore not useable by non-programmers, so maybe incorporating Node-red (with a library of nodes derived from the addons) would be a useful addition. Even maybe replacing the current rules engine with a limited, non-techie, set of nodes (expandable to a more advanced set).
I’ve actually been talking with another user about that exact feature elsewhere: https://github.com/mozilla-iot/gateway/issues/690
That would be a welcome addition, but it should not be a direct part of the gateway.