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

Cant find Devices after adding in Homekit #2

Open
rob74lee opened this issue Feb 9, 2019 · 20 comments
Open

Cant find Devices after adding in Homekit #2

rob74lee opened this issue Feb 9, 2019 · 20 comments

Comments

@rob74lee
Copy link

rob74lee commented Feb 9, 2019

I can't find the devices after adding the Vivint platform and configuring son file. Is there any token that I need to add or something on the Vivint end? Please help.

@timcharper
Copy link
Owner

You just need to provide credentials is all!

@timcharper
Copy link
Owner

Check your logs, maybe there's an auth error

@jlhunter2008
Copy link

jlhunter2008 commented Feb 12, 2019

@timcharper I am experiencing a similar issue. I have three contact sensors, two of them from my previous ADT setup that Vivint setup for their system and then a third one that the Vivint installer setup himself. The only one showing up in HomeKit is the one the Vivint installer installed. If I go into the Vivint Panel configuration, I see all three contact sensors. What could be the issue?

@timcharper
Copy link
Owner

It might be that your contact sensors are configured and tagged differently; check at the state snapshot that is fetched when authenticating with Vivint (add logging if needed?). See if you can see them in there.

I have a little script like this that I used when figuring out the API and device mappings:

const fs = require("fs")
const request = require("request-promise-native")
const VivintApiModule = require("./lib/vivint_api.js")
const VivintApi = VivintApiModule({apiLoginRefreshSecs: 1200}, console.log)
creds = JSON.parse(fs.readFileSync("scratch/creds.json", {encoding: "UTF-8"}));

let apiPromise = VivintApi.login(creds)

function getPromise(p) {
  var r = {}
  p.then((_r) => r.value = _r)
  return r
}

messages = []

_api = getPromise(apiPromise)
api = _api.value; api


pubnub = api.connectPubNub()
let systemInfo = api.systemInfo
pubnub.addListener({
  status: function(statusEvent) {
    console.log("status", statusEvent)
  },
  message: function(msg) {
    messages.push(msg)
    console.log(msg.message.da);
  },
  presence: function(presenceEvent) {
    console.log("presence", presenceEvent)
  }
})

messages.forEach((msg) => console.log(msg.message.da.d))

// pubnub.addListener({
//   status: function(statusEvent) {
//     console.log("status", statusEvent)
//   },
//   message: function(msg) {
//     messages.push(msg)
//     console.log(msg);
//   },
//   presence: function(presenceEvent) {
//     console.log("presence", presenceEvent)
//   }
// })

r = api.putDevice('locks', 24, {id: 24, s: true})

// category = 'locks'
// id = 24
// data = {id: 24, s: false}
// request({
//         url: api.getPanelUrl("/" + category + "/" + id),
//         method: "PUT",
//         body: JSON.stringify(data),
//         headers: { Cookie: api.cookie }
//       })

_systemInfo = request({
  "url": "https://vivintsky.com/api/systems/" + api.panelId,
  "headers": {
    "Cookie": api.cookie
  }}).then(JSON.parse)

__systemInfo = getPromise(_systemInfo)
systemInfo = __systemInfo.value; systemInfo

You can just open up a node terminal and paste the lines one by one. Just create a file scratch/creds.json:

{"username": "<your-vivint-login>", "password": "<your-vivint-password"}

Repository owner deleted a comment from jlhunter2008 Mar 2, 2019
@timcharper
Copy link
Owner

@jlhunter2008 I deleted your post because it had some information in it that could have been used for people to access your home data. Be careful sharing logs. Make sure you redact any home or panel ids.

@jlhunter2008
Copy link

jlhunter2008 commented Mar 3, 2019

@timcharper Thank you fo doing that. I am using docker with homebridge and when I open a node terminal for homebridge and enter the first line in the script above in sh I get the error: "sh: syntax error: unexpected "(" " I am assuming I am entering this in the incorrect place. Any help would be greatly appreciated on where I need to do this.

Also could the issue be because the two sensors not appearing are not dw10 or dw11 smart sensors? Even though they appear and work on the Sky Panel.

@timcharper
Copy link
Owner

@jlhunter2008 you need to launch node, first. That's JavaScript there, not shell script :)

I've only added support for the Vivint devices that I have. Have a look at this line for an example how the various devices "detect" themselves:

return((data.t == "wireless_sensor") && ((data.ec == 1252) || (data.ec == 1251)))

You just need to find the "t" and the "ec" value that correspond to your device and add it to the condition so your dwt10 and dwt11 sensors are identified.

@jlhunter2008
Copy link

@timcharper does this code look correct?

return((data.t == "wireless_sensor") && ((data.ec == 1252) || (data.ec == 1251) || (data.ec == 0637)))

@timcharper
Copy link
Owner

Yeah, looks correct to me

@jlhunter2008
Copy link

jlhunter2008 commented Mar 12, 2019

@timcharper I'm sure you have this but here is the user manual for the Sky Control panel and if you do a search in the document for the equipment codes for example, 1251, you will see a list of all the different equipment codes, which should help you expand the plugin and help people like me not to have to open a ticket for the plugin in the future.

https://fccid.io/2AAAS-CP02/User-Manual/Users-Manual-3185523

@timcharper
Copy link
Owner

Pull requests welcome!

@mceres
Copy link

mceres commented Apr 13, 2019

I’m also not seeing some devices. How can I find out the device id or the information needed to be able to add them?

Need some guidance on how to run your script above.

I’m missing one door sensor.

The others I am not sure if it will be possible to add them but I have some glass break sensors, motion sensor, zwave light switches.

Thanks in advance and great job on this plugin.

@rob74lee
Copy link
Author

I can't figure out how to run the script for debugging. I am stumped. Any help would be appreciated.

@rob74lee
Copy link
Author

I’m also not seeing some devices. How can I find out the device id or the information needed to be able to add them?

Need some guidance on how to run your script above.

I’m missing one door sensor.

The others I am not sure if it will be possible to add them but I have some glass break sensors, motion sensor, zwave light switches.

Thanks in advance and great job on this plugin.

@rob74lee rob74lee reopened this May 11, 2019
@manipat
Copy link

manipat commented Aug 1, 2019

Having a similar issue, have the plugin up and working, can see immediately when different events occur (doors open and closed, system being armed) but no accessories have been added. Is there any method to manually configure them? Not sure what I’m doing wrong.

@rob74lee
Copy link
Author

rob74lee commented Aug 6, 2019

@timcharper I'm sure you have this but here is the user manual for the Sky Control panel and if you do a search in the document for the equipment codes for example, 1251, you will see a list of all the different equipment codes, which should help you expand the plugin and help people like me not to have to open a ticket for the plugin in the future.

https://fccid.io/2AAAS-CP02/User-Manual/Users-Manual-3185523

I can not figure this part out for the life of me. How did you add these sensors into the equation? Did you add the information to the Device.set.js file or into the config.js file? This part has me stumped

@jlhunter2008
Copy link

@rob74lee you add it to the device_set.js file

@rob74lee
Copy link
Author

rob74lee commented Aug 7, 2019

@jlhunter2008 Can you share an example of your file without any important information. My line 154 doesn't look like the example from above. I want to make sure I get it right. Thank you!

@jlhunter2008
Copy link

jlhunter2008 commented Aug 7, 2019

@rob74lee here is what my line 154 looks like
return((data.t == "wireless_sensor") && ((data.ec == 1252) || (data.ec == 1251)))

@forresthamilton
Copy link

Any chance you know how I can see the Linear remote garage door opener? It didn't show up as an accessory. Thanks in advance!

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

No branches or pull requests

6 participants