Sonoff trigger with Webhooks

Platform information:

Hardware: Rasperry Pi 3
OS: Noobs
openjdk version “1.8.0_212”

Issue of the topic:
Hello again!
I want to use my Sonoff state as an external trigger to control another device, a Zigbee shader from Orvibo, that uses the app named Homenate. Basically, I want to have 2 switches wireless switches that control my shader through Webhooks and IFTTT. Sorry if I didn’t make myself clear so far.
I am running into some troubles and I can’t see where is my mistake. First of all I made my sonoff switch to work, I can see the state and also can publish commands. The problem is when I add a group to my item file, it doesn’t recognize my items anymore
My files:
ifttt_trigger.rules

rule "Send IFTTT Notification for Sonoff in Specific Group"

    when
        // Assign all sensor that will require notification together in one gorup
        Item gTrigger_Notification received update

    then
        // IFTTT parameters
        var String ifttt_key = "ihHjhXgJH7LkBYffXr0-UhnM_O7EVdxuR7C3UoBKC_g"
        var String ifttt_event = "Sonoff_Trigger"
        var String ifttt_url = "https://maker.ifttt.com/trigger/" + ifttt_event + "/with/key/" + ifttt_key
        var String notification_json

        // Get the last item that was updated
        var lastItem = gTrigger_Notification.members.sortBy[lastUpdate].last
        // Avoid sending the alert if the state didn't change
        // Compare state before update and now
        var lastState = lastItem.historicState(lastItem.lastUpdate.toDateTime.minusSeconds(1))

        //Check if last state is different than the current state. Zwave sensors send status reports on predefined intervals. This will trigger lastUpdate filed regard$
        if (lastState.state != lastItem.state) {
            notification_json = '{"value1":"' + lastItem.name + '","value2":"' + lastItem.state + '"}'
            sendHttpPostRequest(ifttt_url, "application/json", notification_json)
            logInfo("IFTT",    "IFTTT: ALARM - " + lastItem.name + " changed state from: " + lastState.state + " to: " + lastItem.state)
        }
        else {
            // State didn't changed, supress the notification
            logInfo("IFFT", "IFFT: SUPPRESED - " + lastItem.name + " changed state from: " + lastState.state + " to: " + lastItem.state)
        }

end

home.items

Switch Sonoff1 "Sonoff_1" { mqtt=">[broker:house/cmnd/house-light-1/POWER:command:*:default],<[broker:house/stat/house-light-1/POWER:state:*]"}
Group gTrigger_Notification
String  State1sonoff "State_1:[%s]" (gTrigger_Notification) { mqtt="<[broker:house/stat/house-light-1/power:state:default]"}

home.sitemaps

sitemap home label="Sonoff Switches" //creez o casa numita Sonoff Switches
{
       Frame label="Camera test"   //creez camera test
       {
                 Switch item=Sonoff1     //adaug un item in camera test
                                      //itemele trebuie create in fisierul .item
                 Text item=State1sonoff
                 Text item=Sonoff-basic-1
       }
}

rrd4j.persist

Strategies {
    // for rrd charts, we need a cron strategy
    everyMinute : "0 * * * * ?"
}
Items {
    gTrigger_Notification* : strategy = everyUpdate, everyMinute, restoreOnStartup
}

What “it”, what does this mean?

When rules don’t run as expected, or when editing rules and items files, it is wise to look in openhab.log

This thread looks related

although you could perhaps work with Member of group rule triggering instead

The sitemap doesn’t recognize my items. I managed to get the log to see the errors.
This happens when I try to use my Sonoff switch from my sitemap:

2019-05-23 11:34:29.603 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/Sonoff1' for the unknown item 'Sonoff1'.

This is the error I get when I add the group gNotification:

2019-05-23 11:33:58.316 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoff1' for widget org.eclipse.smarthome.model.sitemap.Switch
2019-05-23 11:33:58.320 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Switch
2019-05-23 11:33:58.323 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoff1' for widget org.eclipse.smarthome.model.sitemap.Switch
2019-05-23 11:33:58.326 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoff1' for widget org.eclipse.smarthome.model.sitemap.Switch
2019-05-23 11:33:58.329 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoff1' for widget org.eclipse.smarthome.model.sitemap.Switch
2019-05-23 11:33:58.333 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.336 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'State1sonoff' for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.340 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'State1sonoff' for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.343 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'State1sonoff' for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.347 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.350 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoffbasic1' for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.353 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoffbasic1' for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:58.356 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item 'Sonoffbasic1' for widget org.eclipse.smarthome.model.sitemap.Text
2019-05-23 11:33:59.793 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/Sonoff1' for the unknown item 'Sonoff1'.
2019-05-23 11:34:03.421 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/Sonoff1' for the unknown item 'Sonoff1'.

Okay, so these Items cannot be found by name in openHAB.
Item names are case sensitive, but your items file and sitemap do appear to match.

If there is a problem with the syntax in an xxx.items file, it may not load any of the Items in that file, so that looks like a good place to look at.

At boot time, or when you edit the items file, you should see a message in openhab.log like

... [el.core.internal.ModelRepositoryImpl] - Loading model 'home.items'

If there is something wrong with it, error message will follow.

If you don’t see the loading message, the file isn’t getting seen. Check folder location.