Hi, this is my way to turn on/off the Meross plugs thanks to IFTTT (Webhooks).
Items:
Number Meross_1 { expire="1s" }
I used “expire” to reset the state since there’s no way to let Opnehab know if the light is on or off. (I hope Meross implements new actions and especially a consumption-based trigger on IFTTT)
rule "Meross 1"
when
Item Meross_1 changed
then
switch (Meross_1.state) {
case 0: {
sendHttpGetRequest("https://maker.ifttt.com/trigger/meross_1_off/with/key")
}
case 1: {
sendHttpGetRequest("https://maker.ifttt.com/trigger/meross_1_on/with/key")
}
}
end
I connected one socket to a floor lamp and use this rule to turn on the light at sunset:
rule "Meross 1 sunset"
when
Channel "astro:sun:home:civilDusk#event" triggered START
then
sendCommand(Meross_1, 1)
end
It’s not perfect, there’s a delay a few seconds but it works
Hello, I’m trying to replicate what you have done but I’m unable to have something work straight from IFTTT. What did you use in IFTTT to have the address? As for the trigger, is it always meross_1_on or does meross_1 refer to something in ifttt?
Ah! Never used webhook and last time I used IFTTT was about 3 years ago so I totally forgot how that worked. It’s working great now! I also tried another way, we can now use if openhab then meross, meaning you can monitor openhab var or switch value. PRoblem is the refresh rate is “run about in 2 hours” so not very fast.
I’ve used this to almost successfully get my Amazon Dash button to turn on my Meross device, thanks.
However, it only seems to work once! I press the button and the lights turn on. If I turn them off for whatever reason the button will not turn the lights on again unless I restart Openhab. Any ideas?
rule "Meross_1"
when
Item Meross_1 changed
then
switch (Meross_1.state) {
case 0: {
sendHttpGetRequest("https://maker.ifttt.com/trigger/meross_1_off/with/key/123")
}
case 1: {
sendHttpGetRequest("https://maker.ifttt.com/trigger/meross_1_on/with/key/123")
}
}
end
2
rule "My Dash Button pressed"
when
Channel "amazondashbutton:dashbutton:7103f09a:press" triggered
then
sendCommand(Meross_1, 1)
end