[OBSOLETE] [BETA MILESTONE 1] CoRE (Community's own Rules Engine)

Wow this is extremely powerful once you get the hang of it. Thanks for all the hard work.

3 Likes

I think it’s time to add this line to your signature badge! Or I might, because answering to this question prevented me from yelling ‘It’s a bug’ several times…

4 Likes

I have to agree - works - it was on inconstancy within the rules some actions had “Action” some “Local” now it seems like its all fixed … phew :blush:

I almost thought of screenshots or ipad and iphone to re-create all rules which with the app interface being as sluggish as it is would have been a bit more painful than this exercise …

shoot just realised I have used the wrong thread - should all stay in one !! :frowning:

Im trying to create a rule that involves taking action on my Logitech Harmony Hub “media controller”. I want to start a Harmony ‘Activity’ (e.g. Watch TV). CoRE sees the Harmony Hub as a device under media controllers and does give me the choice to ‘Start activity’ when building an Action for the Harmony hub device, but once I select that ‘Start activity’ action CoRE does not prompt to choose an Activity. Any ideas?

What should the parameter be? A string? Or a list? Documentation is very … limited…

Found it, fixed it.

v0.0.05c.20160601 - Alpha test version - Updated the startActivity action

1 Like

Legend! Thanks. Am I going to wipe out all my existing rules if I install the new version of the app?

No. But you may encounter some “paused” pistons. Use the dashboard to quickly turn them on. Pausing/Resuming is literally the same if done from the CoRE UI or the dashboard.

Sorry for my ignorance, but where is this dashboard of which you speak?

I found it, don’t worry.

So this is probably a dumb question by someone who’s been writing my own code this long, (Haven’t lately, have no experience with app children.) What happens to the rules when I manually update the code of the SmartApp? They just inherit the new code? (I hope) or are they orphaned as the old code? (I hope not).

I guess bottom line, I don’t want to fear updating the parent SmartApp will cause the children to become “headless.” Cue terrific images of horror movies past.

Other than that question I’m very excited about what I see happening here, more excited than I have been in a long time about ST. I checked and there is no greener grass than here ATM.

1 Like

Updated app and I do see that I am now prompted to key-in an Activity name. This isn’t how it normally works within ST though, normally I am prompted to select from the list of existing Activities that are defined on the Harmony Hub. If I key-in an Activity name exactly as defined on the Harmony Hub, will that work?

It should. If you’re using a Harmony specific app, it will “know” what activities it supports. Documentation on ST suggests the parameter is a string, no clue as to what options are available…

Updating the app code does not lose data. Pistons will survive :slight_smile:

I shall give it all a fair shake. I’ve been struggling to makes things happen when me or my wife comes home. Do I want when either presence is true or changes to present? I figured the changes to was more like a subscription type app which I wanted.

As long as you don’t have any “prerequisite” conditions to the presence becoming present, you can safely use conditions. If, however, you have other conditions that need to be “passed” at the time presence changes, and not the other way (i.e. someone arrives and mode is home, but not if mode becomes home and someone was already present - sense the difference?) - then you need to use a trigger. When mixing triggers and conditions, only devices involved in the trigger can make things happen. When using conditions only, any device involved in those conditions is “eligible” to reevaluate the piston and do things.

I tried entering the Activity name (in this case, CABLE) but it didn’t work. In ST I do have to use an app called “Logitech Harmony (Connect)” to have ST recognize the Hub and Activities and another app called “Logitech Harmony Hub Control” to tie a switch to a Harmony Activity. So I guess CoRE would somehow have to tie into those apps to have access to the Hub’s Activities?

Do you define these activities in those apps? Like, create your own list? I don’t have the Harmony so I can’t test anything, but you could figure out what string is being sent?

Actually I can just have the Piston trigger the switch which I have tied to the Activity in the Logitech Harmony Hub Control app, of course.

You define the Activities when setting up your Harmony Hub, which you do using their supplied remote control or their IOS app. Those activities are then stored on their server and those apps that I mentioned link into your Harmony account and retrieve the Activities from their server.

Excerpt from the Harmony hub code:

def startActivity(String activityId) {
	log.debug "Executing 'Start Activity'"
	log.trace parent.activity("$device.deviceNetworkId-$activityId","start")    
}

Can you start an activity and see what exactly is done? Add this line before the log.trace…:

log.trace "activityId is $activityId"

and then look into the live logging to see what activityId is being sent by the harmony app - then use that string exactly…

My ‘hack’ worked. Instead of having CoRE control the Harmony ‘media controller’ I just have it push a virtual momentary switch that in turn triggers the Harmony activity via the Logitech Harmony Hub Control smart app. Works perfectly.