Trying to send the a http post via rule machine to activate the locking action on my 3rd party NUKI via their API. I am using the HTTP POST option in RM4 but not getting a response from NUKI.
What do I need to put/select in the the "Select content type" "Enter URL to send request to" and "Enter body for POST" sections to make this work.....
If I enter the following in my browser everything works fine.....
I'm in Germany so woke up to your message and of course it worked like a charm, although it doesn't make sense to me that I have to use a get and not a post when I am sending out a request but that's why I am a used and not a programmer I guess
Anyway thanks for you quick response and aid!
Maybe you can help me with with my next related issue...
GOAL: After the lock has been opened/closed (out of Hubitat) using the get http command I would like to update the status of the virtual lock that I have created on the HA Dashboard to mirror the current status of the lock as reported via the NUKI API. I get the status of my lock via sending a the http command to the NUKI server that responded with the following json information
MY IDEA: 1. Create a global variable (string) called Door Status (done that) 2. Write a RM rule that sends and received the above json information and then writes it in the global variable "Door Status" (can't figure out that part) 3. Write another rule that... IF the word "locked" is found in the variable "Door Status" sets the Virtual Lock to Locked and if word "unlocked" is found in the variable "Door Status" sets the Virtual Lock to Unlocked (that I could also figure out)
Any ideas how to accomplish Part 2? I tried a Rule using Set Variable "Door Status", Sting operation "Set from Get operation response" and entered the url in section "Enter URL to send request for response" Do not see any information in the variable "Door Status" Is this possible because it is being received in json format and not as plain text?
I just found a different thread where the issue was the json and not plain text return. So I am assuming that RM is not a solution.
"It would be reasonably easy to do it in Groovy with a driver or app" LOL... Way beyond my capabilities.
This is a real shame because there are many Europeans here in the community with difficulties due to lack of locks that are supported and usable on EU doors and quite a few with NUKI locks. If someone could write a driver that would support the NUKI api all the user would have got do if enter the IP address and the token and he would have NUKI fully integrated into HA.
I've been reading this a little and it seems the locks report their status to the bridge every time something changes.
If you poll the locks directly too often it will flatten the battery but you can probably poll the bridge for lock status and of course the bridge is mains powered
I can already open and close the lock with the /lock or /unlock commands from Hubitat. What I need is for have the door status be updated in HA when the door is opened or closed from outside Hubitat....
Not the solution you're looking for, but I've done it using IFTTT.
A virtual lock on Hubitat (showing on dashboard) is being (un)locked when anyone (un)locks the Nuki.
I'm also locking my door via IFTTT because I couldn't get the API to work, but I will try this again, now that I've read this tread.
Seriously all I need is to be able to read out the JSON response when I call the NUKI BRIDGE HTTP API ({"mode": 2, "state": 1, "stateName": "locked", "batteryCritical": false, "success": true} into a variable and them look for "unlocked" or "locked" in that variable within Hubitat.... Looks like I was close but Hubitat can only receive plain text and not JSON...
I have been using IFTTT to communicate with NUKI too. Works OK but not too reliable. I prefer to avoid IFTTT whenever possible.
I can help you with the implementation locking and unlocking of the NUKI Door Lock out of Hubitat if needed that part is pretty easy if you look look at the documentation the NUKI Bridge HTTP API (link posted above) You will need the NUKI bridge of course to implement this
I forgot about Maker api
Yep, you might be able to do it with that. (it's basically an endpoint anyway)
Easiest way to try Maker api is create a virtual switch and have a play sending commands to that
Once you have done it a couple of times it's quite easy to work with
Installed a virtual switch and Maker API but I have no understanding of what I can or have to do in there to send a http command or force and answer from NUKI...
Okay, so I've tried locking and unlocking the door from Hubitat. It works, but it's working too wel!
When I unlock the door it opens the door completely...
My intention is only to lock the door when Mode changes to Away or Sleeping and to unlock the door when Mode changes from Away or Sleeping. Not to open the door
IFTTT unlocks the door without opening it... I guess I have some Googeling to do...