I am not using IFTTT anymore (too unreliable for geofencing, which was what I mostly wanted it for), but here some snapshots of the API config I was using, in case it is useful to somebody. It is probably not the best in the world, and can be surely improved
My IFTTT API configuration for custom OH Cloud instance:
I am using EpiGeoZone, even if it has been discontinued by the developer. For that, I use a custom PHP integration frontend, as it does not support OAUTH.
I can’t get this working. I installed this on Ubuntu in AWS, got some weird problem with bcrypt. sudo node app.js returns immediately.
Then I tried the same with Ubuntu 64bit in VirtualBox. There sudo node app.js gives “node_redis: Warning: Redis server does not require a password, but a password was supplied.” It stays on until ctrl-c but curl http://localhost:3000 just gives Connection refused.
Now, we need to add IFTT token information in to mongo db.
Log in to your openhab cloud server
Change the directory to your openhab-cloud installation folder cd /opt/openhab-cloud/
Create addoauth.js using Pedro Garcia’s script over here sudo nano addoauth.js
paste the script content
press ctrl+x and Y
run the script sudo node addoauth.js ifttt ifttt <that long string you typed in IFTTT as Client Secret>
Run connection test from IFTTT to see if everything works as expected!
Note: You have to update config.json to include IFTTT Channel Key and test token as below:
Update the iftttChannelKey and the iftttTestToken as below
“ifttt” : {
“iftttChannelKey” : “Service key from IFTTT API tab - General section”,
“iftttTestToken” : “See below”
},
To obtain your iftttTestToken,
Register a test user at your openhab cloud instance.
Then enter those user credentials at the “Demo account login” section of the IFTTT API tab - Authentication section
Run a connection test by clicking on the “Begin Test” button located at the “Connection Test” section of the API tab
Click “Allow” when prompted to authorize IFTTT accessing your openhab-cloud
Once test complete, Copy the “AccessToken” from the BODY of the RESPONSE of “Request Access Token” section. This becomes your iftttTestToken for the above config.jason update
I had to change my account from US to AU, as a result ive lost all my routines. I reset all Echo devices, readded them and relinked the openhab development skill as im using a private cloud instance of OH2.
It cant find any smart home devices, any thoughts?
Same problem… I configured notifications for android device through Google Firebase and everything is going well, but I have problems with iOS notifications. I have Apple developer account and I have the certificates generated and configured in config.json (section apn).
When I start the cloud service, all the logs look good but the connection to APN does not show any message. I Edited the aps-helper.js file to show some log (logger.info) and the module loads but apparently no function inside the module is loaded.
And trying in various ways even doing an upgrade of the module node-apn but still does not work. It seems that something is wrong in the code.
I register an account using the UUID/Secret but it says OFFLINE.
My mobile app cant connect either, it says ‘unable to resovle host undefined’ presumably because its showing OFFLINE in the webpage
Any suggestions wise ones? my eyes are going square! The day OH2 release a private cloud version of this the better. It shouldnt be this hard or complex. A notifciation worked just find via GCM.
Some logs:
kris@oh2dev:/var/www/openhab-cloud$ cat /var/www/openhab-cloud/logs/openhab-cloud-2019-02-14-process-3000.log
2019-02-14 03:54:03:033 info: openHAB-cloud: Backend service is starting up...
2019-02-14 03:54:03:033 info: openHAB-cloud: Backend logging initialized...
2019-02-14 03:54:03:033 info: openHAB-cloud: Initializing XMPP connection to GCM
2019-02-14 03:54:04:044 info: openHAB-cloud: Connecting ro Redis at 127.0.0.1:6379
2019-02-14 03:54:05:055 info: openHAB-cloud: Mailer will emulate sending in development environment
2019-02-14 03:54:05:055 info: opneHAB-cloud: Trying to connect to mongodb at: mongodb://127.0.0.1/openhab?poolSize=100
2019-02-14 03:54:05:055 info: openHAB-cloud: Scheduling a statistics job (every 5 min)
2019-02-14 03:54:05:055 info: openHAB-cloud: IFTTT is configured, app handling IFTTT capabilities...
2019-02-14 03:54:05:055 info: openHAB-cloud: express server listening on port 3000
2019-02-14 03:54:05:055 info: openHAB-cloud: Redis connect response: OK
2019-02-14 03:54:05:055 info: Redis is ready
2019-02-14 03:54:05:055 info: openHAB-cloud: Successfully connected to mongodb
2019-02-14 03:54:09:099 info: openHAB-cloud: GCM XMPP connection is online
2019-02-14 03:54:51:5151 info: openHAB-cloud frontend is shutting down from SIGINT
2019-02-14 03:56:49:4949 info: openHAB-cloud: Backend service is starting up...
2019-02-14 03:56:49:4949 info: openHAB-cloud: Backend logging initialized...
2019-02-14 03:56:49:4949 info: openHAB-cloud: Initializing XMPP connection to GCM
2019-02-14 03:56:49:4949 info: openHAB-cloud: Connecting ro Redis at 127.0.0.1:6379
2019-02-14 03:56:50:5050 info: openHAB-cloud: Mailer will emulate sending in development environment
2019-02-14 03:56:50:5050 info: opneHAB-cloud: Trying to connect to mongodb at: mongodb://127.0.0.1/openhab?poolSize=100
2019-02-14 03:56:50:5050 info: openHAB-cloud: Scheduling a statistics job (every 5 min)
2019-02-14 03:56:50:5050 info: openHAB-cloud: IFTTT is configured, app handling IFTTT capabilities...
2019-02-14 03:56:50:5050 info: openHAB-cloud: express server listening on port 3000
2019-02-14 03:56:50:5050 info: openHAB-cloud: Redis connect response: OK
2019-02-14 03:56:50:5050 info: Redis is ready
2019-02-14 03:56:50:5050 info: openHAB-cloud: Successfully connected to mongodb
2019-02-14 03:56:51:5151 info: openHAB-cloud: GCM XMPP connection is online
2019-02-14 03:57:50:5050 debug: openHAB-cloud: Checking for offline openHABs (0)
2019-02-14 03:57:50:5050 debug: openHAB-cloud: Checking orphaned rest requests (0)
2019-02-14 03:58:50:5050 debug: openHAB-cloud: Checking for offline openHABs (0)
2019-02-14 03:58:50:5050 debug: openHAB-cloud: Checking orphaned rest requests (0)
2019-02-14 03:59:50:5050 debug: openHAB-cloud: Checking for offline openHABs (0)
2019-02-14 03:59:50:5050 debug: openHAB-cloud: Checking orphaned rest requests (0)
2019-02-14 04:00:00:000 info: openHAB-cloud: every5min statistics collection job started
2019-02-14 04:00:00:000 info: openHAB-cloud: every5min statistics collection job finished
2019-02-14 04:00:38:3838 info: openHAB-cloud frontend is shutting down from SIGTERM
kris@oh2dev:/var/www/openhab-cloud$
Hi,
I followed steps documented here https://heathpaddock.com/2017/02/02/making-amazon-echo-alexa-sing-to-openhab2/ and was able to use authentication that is stored in variable userpass ( userpass is variable containing username, password in file config.js located in directory openhab-alexa ).
Now I want to use oauth2 with an Amazon account.
Thus I uploaded openhab-alexa again after putting userpass into a comment.
I made sure that account linking is configured etc. ( following several documents ).
I disabled the skill in the app on the phone and enabled it again.
Logged in via amazon web page on the phone.
I tried to access a switch but access to the items file is denied.
It looks like the authorization does not work and access is not granted.
In the meantime I solved it.
Following steps described on the previous described webpage works for basic authentication ( userpass set in openhab-cloud ) but not for oauth2 authentication.
Besides that when acount linking is defined authorization URI and access token URI need to point to your openhab-cloud server ( https:///oauth2/authorize resp. https:///oauth2/token ). Set the scope to your client-id.
To add the required information into the mongodb I used the script addoauth.js from this post: Setup your own openhab-cloud (myopenhab) server/instance
This looks like because that you could not either log in or receive a response from the private server.
Could you please confirm you followed these steps?
To obtain your iftttTestToken,
Register a test user at your openhab cloud instance.
Then enter those user credentials at the “Demo account login” section of the IFTTT API tab - Authentication section
Run a connection test by clicking on the “Begin Test” button located at the “Connection Test” section of the API tab
Click “Allow” when prompted to authorize IFTTT accessing your openhab-cloud
Once test complete, Copy the “AccessToken” from the BODY of the RESPONSE of “Request Access Token” section. This becomes your iftttTestToken for the above config.jason update