Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFTTT integration: Listen to all item events if no itemStatus is defined within the trigger #180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pfink
Copy link

@pfink pfink commented Apr 6, 2018

This change should make it possible listening to all item changes without being forced to filter the listener events. This can be done now with leaving the field "Changes to" / itemStatus empty.

To be honest, I have no test environment to test this, but I did the change very carefully to the best of my knowledge.

Use case: https://community.openhab.org/t/trigger-an-ifttt-action-always-when-an-item-changes/43017

Signed-off-by: Patrick Fink [email protected]

@digitaldan
Copy link
Contributor

Hi, looking at the code it looks like IFTTT is polling for both the item name AND the state is wants to be triggered on, so this would break that, no?

@pfink
Copy link
Author

pfink commented May 1, 2018

Hi! It's correct IFTTT polls for item name and status. This implementation does the following: If the status IFTTT polls for is empty (this happens if the user did not enter anything within the field "item status" on IFTTT-side), the status will not be treated as a filter criterion anymore. To sum it up,

current situation: If the user leaves the field "status" within the IFTTT configuration blank, IFTTT polls for events related to an item with the state "" (empty string), which will lead to an empty response in almost all cases (except for String items that have the state "empty string").

expected behavior after the PR: If the user leaves the field "status" empty within the IFTTT configuration, IFTTT still does the same request as before, but the new implementation returns ALL events related to the specified item.

@digitaldan
Copy link
Contributor

OK, I understand the functionality. My only concern is that this is not clear for users, how would they know that passing an empt string changes the functionality? But other then that I don't really see an issue with it. Have you tested this at all to make sure the query logic works?

@pfink
Copy link
Author

pfink commented May 6, 2018

Maybe we could adjust the description of the IFTTT field?

I didn't test it (just verified the syntax) because I was not sure how to set up a test environment. Is there a documentation somewhere how to get started with openhab-cloud and an IFTTT sandbox?

@pfink
Copy link
Author

pfink commented Oct 30, 2018

@digitaldan: Did you see my last post?

@rdhaese
Copy link

rdhaese commented Mar 16, 2019

Bringing this PR back to attention. I haven't looked at the code, but it seems to be just what I need. Thanks for the work @pfink.

I came here through https://community.openhab.org/t/trigger-an-ifttt-action-always-when-an-item-changes/43017 , just as the topic starter, I tried to use an empty field or a *.

In my opinion a '*' feels more natural. It won't confuse the user to much, definitely if you consider that the average openhab user is tech-savy and probably knows about wildcards.
An update of the IFTTT field description would be optimal, but not required.

I wouldn't use an empty field as a 'match-for-all' as it is currently implemented by @pfink. What if a user wants to react on an empty String item?
He could adapt his logic a bit, but using a '*' would omit the need for a clarification.

my use case:
I have a Number Item, which can have a state from 0 to 6. I want to pass this value to Tasker through IFTTT whenever the item state changes on myopenhab.org.
Currently I have to create 7 applets for this...

@hmerk
Copy link

hmerk commented Jun 12, 2022

@digitaldan Shouldn‘t this one be closed as we removed IFTTT support ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants