homebridge-vivint icon indicating copy to clipboard operation
homebridge-vivint copied to clipboard

Cant find Devices after adding in Homekit

Open rob74lee opened this issue 6 years ago • 20 comments

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.

rob74lee avatar Feb 09 '19 18:02 rob74lee

You just need to provide credentials is all!

timcharper avatar Feb 11 '19 00:02 timcharper

Check your logs, maybe there's an auth error

timcharper avatar Feb 11 '19 00:02 timcharper

@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?

jlhunter2008 avatar Feb 12 '19 21:02 jlhunter2008

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"}

timcharper avatar Feb 19 '19 22:02 timcharper

@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.

timcharper avatar Mar 02 '19 06:03 timcharper

@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.

jlhunter2008 avatar Mar 03 '19 00:03 jlhunter2008

@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:

https://github.com/timcharper/homebridge-vivint/blob/6286fc727ef4b6a686f276fa46e45bac1408a4a8/lib/device_set.js#L154

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.

timcharper avatar Mar 09 '19 18:03 timcharper

@timcharper does this code look correct?

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

jlhunter2008 avatar Mar 10 '19 06:03 jlhunter2008

Yeah, looks correct to me

timcharper avatar Mar 10 '19 19:03 timcharper

@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

jlhunter2008 avatar Mar 12 '19 03:03 jlhunter2008

Pull requests welcome!

timcharper avatar Mar 12 '19 20:03 timcharper

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.

mceres avatar Apr 13 '19 03:04 mceres

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

rob74lee avatar May 10 '19 17:05 rob74lee

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 avatar May 11 '19 01:05 rob74lee

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.

manipat avatar Aug 01 '19 21:08 manipat

@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

rob74lee avatar Aug 06 '19 16:08 rob74lee

@rob74lee you add it to the device_set.js file

jlhunter2008 avatar Aug 07 '19 13:08 jlhunter2008

@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!

rob74lee avatar Aug 07 '19 13:08 rob74lee

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

jlhunter2008 avatar Aug 07 '19 14:08 jlhunter2008

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!

forresthamilton avatar Dec 31 '19 20:12 forresthamilton