Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted

Dear all,
in Recent event's trying to make a script to control my Neato Botvac Connected  i found a way to finally do this.
Together with the help of a dedicated member here on the forum that have gone through the code together with me i am happy to announce we have a working POC.

many thanks to 

Please login or register to see this link.

 - 

Please login or register to see this link.

 - 

Please login or register to see this link.

 for their contributions on current project and projects before that gave me some insight.
A Quickapp code that actually lets you request all the data info from the robot and control it.

the idea started rom a github page that had some code on it to be able to control the robot via Postman and some info on the neato developer network page.

Please login or register to see this link.



once we did that i started to play around with coding in LUA to make a quickapp with a basic command via the API of Neato to request the robot data 
for this to work you need your robot serial as explained on the github page and manage to get your secret code.

i am currently still further developing the app and will post it here when done but i wanted to share the working code with whoever needs it.
regards Christophe
 

function QuickApp:getrobotinfo()
self:debug("onInit")
    local robotserial = "YOURROBOTSERIAL"
    local robotseriallow = string.lower(robotserial)
    local robotsecret = "YOURROBOTSECRET"
    local date = tostring(os.date("!%a, %d %b %Y %X GMT"))
    local body = '{"reqId": "77", "cmd": "getRobotState"}'
    local string_to_sign = robotseriallow .. "\n".. date .. "\n" .. body
    local signature = sha.hmac(sha.sha256, robotsecret, string_to_sign)
    local binary_hash = sha.hex2bin(signature)
    local base64_hash = sha.bin2base64(binary_hash)
    self.http = net.HTTPClient({timeout=5000})
   
    self.http:request("https://nucleo.neatocloud.com:4443/vendors/neato/robots/YOURROBOTSERIAL/messages", {
          options = {
              data = body,
              method = "POST",
              checkCertificate = false,
              headers = {
                ["Accept"] = "application/vnd.neato.nucleo.v1",
                ["Content-Type"] = "application/json",
                ["Date"] = date,
                ["Authorization"] = "NEATOAPP" .. " " .. signature,
                ["Host"] = "nucleo.neatocloud.com:4443",
              }
          },
          success = function(response)
              self:debug(response.status)
              self:debug(response.data)
          end,
          error = function(message)
              self:debug("error:", message)
          end
      })
end
  • Like 1
  • Thanks 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...