hello,newbie to openhab,latest stable,i am trying to IFTTT intergration and all are working just fine,i see all my exposed things and i can trigger them from IFTTT.I am wondering if there is a way to expose a rule so i can trigger it from IFTTT…?
As fast as I know, there are 4 types of rule triggers (item, time, system and thing), but there is no way to trigger a rule directly (without using one of the above triggers). You could create a proxy item (e.g. switch) and create a rule that’s being trigger by state change of that proxy item.
thank you,i was thinking that way too but my linux skills are worst than my 8 yo son .I am a technician and a fast learner,i have much reading to do.Can you point me to what i need to read to create a proxy switch to trigger from ifttt and to toggle it from my paperui?
Proxy switch is just a regular Switch item, you just don’t have to connect it to any channel/thing. You can read more about proxy items here.
For example, your .items file could contain something like this:
Switch IFTTT_Rule_Trigger "IFTTT Rule Trigger"
Then, you should connect a rule to a proxy switch state change/update. For example, you could add something like this in your .rules file:
rule "IFTTT Rule Triggered" when Item IFTTT_Rule_Trigger received update then //Do some logic here end
Then, you just change state of IFTTT_Rule_Trigger using IFTTT, and the rule will be executed. If your rule don’t need ON/OFF state, you can trigger this switch to ON from IFTTT, and, in the end of the rule, switch it back to OFF. This way switch (kind of) behaves like a push button.
Edit: In the .rules example above, rule will be trigger when you update a switch, so, it doesn’t matter if the switch is ON or OFF. If you need to trigger rule only when switching it ON then you should use:
when Item IFTTT_Rule_Trigger changed to ON
Using this approach will not trigger rule again when you change the state of the switch to OFF in the end of the rule.
ok did that and its working,thank you.Now i want the IFTTT RULE TRIGGER to show at my paperui as a switch…can i do that?
I don’t think that you can display items from .items files in the Paper UI. You can display them in Classic/Basic UI, Android and iOS application and HABPanel. As far as I know, Paper UI is not meant to be primary user interface. It’s more like a Control panel, where you can manage all the settings (bindings, things etc.). It does display things that are discovered automatically, and lets you control them, but, if I’m not mistaken, that’s about it.