Converting RulesEngine to openLuup...
-
@akbooer , but if I want to take the road of "no-plugin", is it something possible directly in openLuup ?
-
I'm an "old" coder, just need to go back in "coding mode", but I would need a little bit of help to start..
So based on my PDF, what will be your approach ?
-
I'm an "old" coder, just need to go back in "coding mode", but I would need a little bit of help to start..
So based on my PDF, what will be your approach ?
-
@DesT said in Converting RulesEngine to openLuup...:
So based on my PDF, what will be your approach ?
Really hard to read. Is there a better format available from RulesEngine?
-
@DesT scenes will mostly do it. Recently I've transitioned to more luup.watch, but I'm not sure if that's a good way
@therealdb Are you coding directly without creating scene?
-
I like the full control I get from native code but it is certainly not for everyone. I also got tired of trying to maintain all the code located in all the different scenes. Although rigpapa's Lua View can help a lot in that regard.
So I have all of my code in the start up file and scenes only contain a call to the start up code or a call to Vera (been running openLuup for years - thanks again ak). Like so:
return myLua.executeSceneNumber(3)
luup.inet.wget "http://Vera_IP_address/port_3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=3"
I had a look at the xml file - a lot of stuff in there - about 8354 lines. Biggest problem from my point of view is that it all seems to be in French.
-
I like the full control I get from native code but it is certainly not for everyone. I also got tired of trying to maintain all the code located in all the different scenes. Although rigpapa's Lua View can help a lot in that regard.
So I have all of my code in the start up file and scenes only contain a call to the start up code or a call to Vera (been running openLuup for years - thanks again ak). Like so:
return myLua.executeSceneNumber(3)
luup.inet.wget "http://Vera_IP_address/port_3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=3"
I had a look at the xml file - a lot of stuff in there - about 8354 lines. Biggest problem from my point of view is that it all seems to be in French.
I have the same approach as the one described by @a-lurker
Lately, as I said, I stopped using scenes (I left the ones I already created in place, of course) and started to use watch in code. So it's like I'm coding a giant plugin.
But I think a normal approach will be to use reactor. It's top notch and Patrick is committed to support luup and openluup for the time being, since it's not interested at all in the new eZlo engine. Plus, it's open source, so easily fixable anyway.
-
@therealdb ,@a-lurker but if I want to use the approach of no plugin, no scene, anyone can tell me how/where to start with a single task so I can put my brain in coding mode
I want to get ride of all my Rules Engines scene that I used for more complex stuff that a scene can't handle like:
If
time is between 8pm and 5am
AND
house mode = 1
AND
motion sensor 1,2, 3 are idle for more than 5 mins
AND
motion sensor 4,5,6 are idle for more than 10 mins
then
do something -
No scenes and no plugin only leaves you with loading code from the startup lua. You can write your functions in module lua files and load them from the startup lua and then setup triggers/variable watches to call these functions from there too.
Anything can be written in lua... -
@therealdb ,@a-lurker but if I want to use the approach of no plugin, no scene, anyone can tell me how/where to start with a single task so I can put my brain in coding mode
I want to get ride of all my Rules Engines scene that I used for more complex stuff that a scene can't handle like:
If
time is between 8pm and 5am
AND
house mode = 1
AND
motion sensor 1,2, 3 are idle for more than 5 mins
AND
motion sensor 4,5,6 are idle for more than 10 mins
then
do something -
@DesT said in Converting RulesEngine to openLuup...:
more complex stuff that a scene can't handle like:
...would this be in a scene which runs, say, every 5 minutes, or so?
If that’s the case, then it’s pretty easy to code this up.
@akbooer The problem with a scene that runs every 5 mins, it's that if the motion sensor just stop detecting something it will be "true", that mean I will never be able to put a real "stop detecting motion since..." ?
@rafale77 Got this part, so I understand that @therealdb and @a-lurker are doing that ?
The problem with Rules Engine, I think, it's it add a kind of delay, it's not responding as fast I think openLuup should respond..
90% of all my "scenes" are in Rules Engine since 2 years, and I can't live without it now. So if tomorrow, Rules Engine broke 'cause of something else in openLuup/ALTUI as it happen back in time, I will have a complete broken system, that's the main reason to "code" everything directly in openLuup...
RulesEngine bring to openLuup an "advanced" scene creation with some more complex trigger.