[SOLVED] Trouble with IFTTT location rule

Hi everyone I’m having trouble getting my location rule working it’s sent from IFTTT on mobile phone, Openhab does receive the updates but my rule is not right so nothing happens.

IFTTT Settings:

OPENHAB Setting:
AaronGEO is a string item

MY rule below:

rule "Aaron Presence2" 

when
    Item Aaron_GEO changed
then
    if(Aaron_GEO.state == Aaron entered area home) {
       Aarons_Home.sendCommand ("ON")
       logInfo("Rule", "Aaron Home")
       }
    if( Aaron_GEO.state == Aaron exited area home ) {
        Aarons_Home.sendCommand("OFF")
        logInfo("Rule", "Aaron Left")
       }
end
1 Like

Your item is a String so it’s states are going to be strings. String are defined in ""
Aarons_Home is a Switch and therefore accepts the commands ON and OFF without ""

rule "Aaron Presence2" 

when
    Item Aaron_GEO changed
then
    if(Aaron_GEO.state == "Aaron entered area home") {
        Aarons_Home.sendCommand (ON)
        logInfo("Rule", "Aaron Home")
    }
    if( Aaron_GEO.state == "Aaron exited area home") {
        Aarons_Home.sendCommand(OFF)
        logInfo("Rule", "Aaron Left")
    }
end

Thanks for that i will try that again i did try that once before but had weired results where it was only receiving part of the update , yes Aarons_Home is a switch

Thanks that seems too have sorted it

what applet did u use?
I’m having an issue to use the one that openhab created for IFTTT

The location and openhab applet

I used the same as you but my rule not working
seems that the IFTTT do its thing but the rule not executing what its should do
help please

logs:

2019-01-25 09:36:24.360 [ome.event.ItemCommandEvent] - Item 'Presence_IFTTT_Barak' received command Barak exited Home
2019-01-25 09:36:24.373 [vent.ItemStateChangedEvent] - Presence_IFTTT_Barak changed from OFF to Barak exited Home

items:

Switch Presence_Barak                  "Barak [MAP(presence.map):%s]"   <man_3>   (Presence)
Switch Presence_Almog                  "Almog [MAP(presence.map):%s]"   <woman_3> (Presence)
String Presence_IFTTT_Barak

rules:

rule "Barak Presence" 

when
    Item Presence_IFTTT_Barak changed
then
    if( Presence_IFTTT_Barak.state == "Barak Entered Home") {
        Presence_Barak.sendCommand (ON)
        logInfo("Rule", "Barak At Home")
    }
    if( Presence_IFTTT_Barak.state == "Barak Exited Home") {
        Presence_Barak.sendCommand(OFF)
        logInfo("Rule", "Barak Left Home")
    }
end

just realise that I have a Capital letter there, that might be the issue