asishrs / smartthings

SmartThings Custom Integrations
MIT License
13 stars 26 forks source link

Ring-Alarm v3 #12

Closed Its2loud1 closed 4 years ago

Its2loud1 commented 4 years ago

asishrs,

thank you for updating this integration and including two-factor authentication. I'm not sure if you meant for this v3 to go live publicly but since my v2 was never working properly, I thought I'd try it. So far it's working much better for me but there are a few issues I thought you might like to know about.

  1. It doesn't work at all in the new Samsung Smarthings app.
  2. Am I supposed to see all my sensors in the device page in the Classic App? (aka Javier). I can see the status of my sensors in the logs but I wasn't sure if this new version included the ability to have ST trigger devices if something happens with a Ring Sensor.
  3. I have it set to Poll at 1 minute intervals but sometimes it's taking longer. Up to 5 minutes. Particularly if I arm the Ring from the ST app. I will Arm the Ring to either Away or Home and the status doesn't change in the ST app even though it does arm the Ring.

Just a few issues I've noticed so far. Really great work and thank you again.

asishrs commented 4 years ago

asishrs,

thank you for updating this integration and including two-factor authentication. I'm not sure if you meant for this v3 to go live publicly but since my v2 was never working properly, I thought I'd try it. So far it's working much better for me but there are a few issues I thought you might like to know about.

  1. It doesn't work at all in the new Samsung Smarthings app.
  2. Am I supposed to see all my sensors in the device page in the Classic App? (aka Javier). I can see the status of my sensors in the logs but I wasn't sure if this new version included the ability to have ST trigger devices if something happens with a Ring Sensor.
  3. I have it set to Poll at 1 minute intervals but sometimes it's taking longer. Up to 5 minutes. Particularly if I arm the Ring from the ST app. I will Arm the Ring to either Away or Home and the status doesn't change in the ST app even though it does arm the Ring.

Just a few issues I've noticed so far. Really great work and thank you again.

  1. The support for new SmartThings App is not available now.
  2. All your child devices will be showing as devices along with Ring Alam on My Home
  3. Timing issue is weird. Can you check the smartthings logs in IDE and share that with me?
Its2loud1 commented 4 years ago

Thanks,

I’m also seeing this in the app logs. “Base Station Offline”

None of the child devices are showing up. Do I need to add them manually in the IDE?

Here is my live logging and device events.

Thanks

On Jan 26, 2020, at 12:31 AM, asish notifications@github.com wrote:

asishrs,

thank you for updating this integration and including two-factor authentication. I'm not sure if you meant for this v3 to go live publicly but since my v2 was never working properly, I thought I'd try it. So far it's working much better for me but there are a few issues I thought you might like to know about.

It doesn't work at all in the new Samsung Smarthings app. Am I supposed to see all my sensors in the device page in the Classic App? (aka Javier). I can see the status of my sensors in the logs but I wasn't sure if this new version included the ability to have ST trigger devices if something happens with a Ring Sensor. I have it set to Poll at 1 minute intervals but sometimes it's taking longer. Up to 5 minutes. Particularly if I arm the Ring from the ST app. I will Arm the Ring to either Away or Home and the status doesn't change in the ST app even though it does arm the Ring. Just a few issues I've noticed so far. Really great work and thank you again.

The support for new SmartThings App is not available now. All your child devices will be showing as devices along with Ring Alam on My Home Timing issue is weird. Can you check the smartthings logs in IDE and share that with me? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tylermoragn commented 4 years ago

I am also experiencing a few issues, everything was working great until a few hours ago.

  1. Things seem Sluggish overall.
  2. Alarm will not Disarm based on my Disarm mode. I have 3 modes in ST, Away, Stay, Disarm, they are matched in Ring Manager, as Disarmed - Disarmed, Armed Away - Away, Armed Home - Stay.
  3. I made a webcore piston that Looks for Mode change and then sets Ring to "Turn off". That is working for me as a work around. But for me also adds a few milliseconds of delay, as I am using my front door deadbolt as a routine to trigger the mode to Disarm when unlocked, but takes ring a little longer than before to disarm the system.
Its2loud1 commented 4 years ago

Just curious, are you seeing the Ring child devices in the ST Classic App? And are you using the SHM Smartapp?

tylermoragn commented 4 years ago

I don’t use the child devices, sensors or anything like that. Where should I see them? They don’t show up in ST that I can find, but they where discovered by Alexa, and are connected and show their status and last active time.

To check overall sluggishness, I enabled push notifications for the Ring Manger, and i get the notification within a few seconds of an alarm status change.

Right now everything seems to be clicking along just fine. But I do still have the issue of ring not disarming when ST mode is changed to disarm.

On Jan 26, 2020, at 11:20 PM, Its2loud1 notifications@github.com wrote:  Just curious, are you seeing the Ring child devices in the ST Classic App?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

asishrs commented 4 years ago

Child devices appear after you configure ring account and select the your ring device in the Ring Manager.

To select the Ring Device, Tap on ‘SmartThings Alarm Device’ and choose the alarm device under ’Use this Alarm’

Its2loud1 commented 4 years ago

Thanks Asishrs. I’m aware of how they should be setup. I’ve done all of that and they’re not showing up.

I’m happy to send you a screen shot of how it’s all setup.

1B56E683-CFCF-43AA-90CD-87174812C43A

Also, did you see my logs I sent you from the other message about the Ringbase showing offline in your Smartapp?

On Jan 26, 2020, at 9:18 PM, asish notifications@github.com 3B7B90E4-CC17-43BC-A16F-3FAD35AFA064 wrote:

Child devices appear after you configure ring account and select the your ring device in the Ring Manager.

To select the Ring Device, Tap on ‘SmartThings Alarm Device’ and choose the alarm device under ’Use this Alarm’

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Its2loud1 commented 4 years ago

I noticed you added the “bug” label. I’m assuming you’re working on something because now nothing is syncing between ST and Ring Alarm.

I’m happy to test something if you’d like.

Thanks.

asishrs commented 4 years ago

I am also experiencing a few issues, everything was working great until a few hours ago.

  1. Things seem Sluggish overall.
  2. Alarm will not Disarm based on my Disarm mode. I have 3 modes in ST, Away, Stay, Disarm, they are matched in Ring Manager, as Disarmed - Disarmed, Armed Away - Away, Armed Home - Stay.
  3. I made a webcore piston that Looks for Mode change and then sets Ring to "Turn off". That is working for me as a work around. But for me also adds a few milliseconds of delay, as I am using my front door deadbolt as a routine to trigger the mode to Disarm when unlocked, but takes ring a little longer than before to disarm the system.

Check this https://github.com/asishrs/smartthings-ringalarmv2/issues/19#issuecomment-579036781

asishrs commented 4 years ago

Thanks Asishrs. I’m aware of how they should be setup. I’ve done all of that and they’re not showing up. I’m happy to send you a screen shot of how it’s all setup. 1B56E683-CFCF-43AA-90CD-87174812C43A Also, did you see my logs I sent you from the other message about the Ringbase showing offline in your Smartapp? On Jan 26, 2020, at 9:18 PM, asish @.***> 3B7B90E4-CC17-43BC-A16F-3FAD35AFA064 wrote: Child devices appear after you configure ring account and select the your ring device in the Ring Manager. To select the Ring Device, Tap on ‘SmartThings Alarm Device’ and choose the alarm device under ’Use this Alarm’ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

I am sorry, I meant logs from your ST IDE - https://graph-na02-useast1.api.smartthings.com/ide/logs If the setup is correct, you shouldn't see any errors in the logs. Please remove any keys or other sensitive data from the logs before posting.

Its2loud1 commented 4 years ago

Here you go. Latest logs for Ring Manager 8B87F96F-F9A2-4010-8D31-E0EC54E3C38F 3CEF24B5-FBBB-4084-B918-3FEC4BC4FAB5

asishrs commented 4 years ago

@Its2loud1 Did you apply this change https://github.com/asishrs/smartthings-ringalarmv2/issues/19#issuecomment-579036781

Its2loud1 commented 4 years ago

Not yet. Will report back when I do. I just read it. Thanks

Its2loud1 commented 4 years ago

Ok. just updated per "asishrs/smartthings-ringalarmv2#19 (comment)". I'm not getting any errors in the logs and arming, disarming is zippy. However, I still do not have any child devices showing up in the ST app. I've removed and re-added the SmartApp twice with no luck. Any suggestions?

Screen Shot 2020-01-27 at 6 38 52 PM

I'm still seeing this in the "recently" logs in the app. IMG_B276EC509C0E-1

asishrs commented 4 years ago

Can you check Ring Alarm Logs in ST IDE and see if you see anything like addSensor() -> Adding sensor with type ${type} and ${deviceId}

Also, you can check the child devices in Ring Alarm device in ST IDE under My Devices

You should see something like below.

Screen Shot 2020-01-27 at 8 22 57 PM
Its2loud1 commented 4 years ago

I have not seen anything like that in my logs and I have no listing of child devices in my IDE

here are my Ring Alarm Events and my Devices list.

it has not added any child devices

Screen Shot 2020-01-27 at 7 31 44 PM Screen Shot 2020-01-27 at 7 31 34 PM
asishrs commented 4 years ago

On your ST App, do you see any logs in the Ring Alarm Device (on the bottom of the page) - like below. IMG_6D4DDE1D321D-1

tylermoragn commented 4 years ago

I am also experiencing a few issues, everything was working great until a few hours ago.

  1. Things seem Sluggish overall.
  2. Alarm will not Disarm based on my Disarm mode. I have 3 modes in ST, Away, Stay, Disarm, they are matched in Ring Manager, as Disarmed - Disarmed, Armed Away - Away, Armed Home - Stay.
  3. I made a webcore piston that Looks for Mode change and then sets Ring to "Turn off". That is working for me as a work around. But for me also adds a few milliseconds of delay, as I am using my front door deadbolt as a routine to trigger the mode to Disarm when unlocked, but takes ring a little longer than before to disarm the system.

Check this asishrs/smartthings-ringalarmv2#19 (comment)

I made this change, and now my alarm changes status when in Home Mode. I was able to disable the piston I made, that changes the ring alarm to off, so that has sped up the timing. Sometimes, the disarm is instant, other times, it lags for a few seconds, then changes Rings status to disarmed.

I am no sure if this screenshot has any bearing on the issues.

Screen Shot 2020-01-27 at 10 34 34 PM

Also FYI, I am not setting child devices in ST, but they are being passed thru to Amazon Alexa, as well as their status' IMG_1732 , see the screenshot attached.

Am I missing something to be able to speed up the ring disarm, when ST changes modes from Stay or Away to Disarmed?

Its2loud1 commented 4 years ago

On your ST App, do you see any logs in the Ring Alarm Device (on the bottom of the page) - like below. IMG_6D4DDE1D321D-1

Here is a screen shot of what I see. The app sees me child devices. It just hasn't added them into ST

IMG_7F03871FA5E8-1

tylermoragn commented 4 years ago

On your ST App, do you see any logs in the Ring Alarm Device (on the bottom of the page) - like below. IMG_6D4DDE1D321D-1

Mine shows a few devices and activity as well. IMG_13D3A0A6ED58-1

asishrs commented 4 years ago

@tylermoragn if you make the status change in Ring Mobile App or Interface, it can take up to one minute (assume that you have selected the polling interval as one minute) to refresh the status in ST App. This is because the ST app is configured to poll based on interval.

If you are using ST app to change the status, the action should be immediate to your Ring Account but its can take few seconds to refresh the view in ST app as the actual changes are driven by the manager and the manager sends an event to Device to update that. It is a 3 step process.

asishrs commented 4 years ago

@tylermoragn @Its2loud1 are you both using Andriod phones?

tylermoragn commented 4 years ago

I am on an iPhone 11 Pro.

I now understand the polling, makes sense.

Can you think of a quicker way for me to use my deadbolt unlocking to trigger the alarm to be turned off? Right now I have a Routine setup, that if the deadbolt unlocks, it changes ST state to Disarmed. There is no way from the ST App to turn the ring alarm off/disarmed using a routine? I guess I could setup a webcore piston to wait for the deadbolt to unlock, then arm ring to off?

Is there a reason that Ring Alarm Arm, Disarm, Stay modes are not available to be programmed in webcore? Only Ring Alarm "Turn Off"?

Sorry if my terminology is all over the place.

Its2loud1 commented 4 years ago

@tylermoragn @Its2loud1 are you both using Andriod phones?

I am on an iPhone 7 and also an iPad Pro. I was actually thinking that this might be an iOS related issue but that wouldn't make sense since the child devices still aren't showing up in the IDE or the logs.

Although, I have noticed something strange with iphone that might be a bug.

When adding in the API Url and API Key, if I copy/paste the URL and then hit done, I notice the URL I paste in doesn't stay when going to the next field for API Key. See attached video. Perhaps this is messing up the overall setup in ST?

https://vimeo.com/387604849/acdbba859f

Its2loud1 commented 4 years ago

I am on an iPhone 11 Pro.

I now understand the polling, makes sense.

Can you think of a quicker way for me to use my deadbolt unlocking to trigger the alarm to be turned off? Right now I have a Routine setup, that if the deadbolt unlocks, it changes ST state to Disarmed. There is no way from the ST App to turn the ring alarm off/disarmed using a routine? I guess I could setup a webcore piston to wait for the deadbolt to unlock, then arm ring to off?

Is there a reason that Ring Alarm Arm, Disarm, Stay modes are not available to be programmed in webcore? Only Ring Alarm "Turn Off"?

Sorry if my terminology is all over the place.

Tyler, I have tried to do what you are and because of the 1 minute polling delay between ST SHM and Ring it's impossible to get an instant Ring disarm when unlocking a smart lock through ST. Unless you're able to use the SmartLock with Alexa and Guard, this integration will not be an instant response, unfortunately.

asishrs commented 4 years ago

I am on an iPhone 11 Pro.

I now understand the polling, makes sense.

Can you think of a quicker way for me to use my deadbolt unlocking to trigger the alarm to be turned off? Right now I have a Routine setup, that if the deadbolt unlocks, it changes ST state to Disarmed. There is no way from the ST App to turn the ring alarm off/disarmed using a routine? I guess I could setup a webcore piston to wait for the deadbolt to unlock, then arm ring to off?

Is there a reason that Ring Alarm Arm, Disarm, Stay modes are not available to be programmed in webcore? Only Ring Alarm "Turn Off"?

Sorry if my terminology is all over the place.

With this setup, I can try to achieve a 15 seconds delay. Anything lower than that will be challenging.

You can call below methods from WebCore

def triggeroff() {
    log.info "triggeroff() -> Setting Ring Alarm mode to 'Off'"
    callApiAndUpdateEvents('off')
}

def triggerhome() { 
    log.info "triggerhome() -> Setting Ring Alarm mode to 'Home'"
    callApiAndUpdateEvents('home')
}

def triggeraway() {
    log.info "triggeraway() -> Setting Ring Alarm mode to 'Away'"
    callApiAndUpdateEvents('away')
}
tylermoragn commented 4 years ago

I am on an iPhone 11 Pro. I now understand the polling, makes sense. Can you think of a quicker way for me to use my deadbolt unlocking to trigger the alarm to be turned off? Right now I have a Routine setup, that if the deadbolt unlocks, it changes ST state to Disarmed. There is no way from the ST App to turn the ring alarm off/disarmed using a routine? I guess I could setup a webcore piston to wait for the deadbolt to unlock, then arm ring to off? Is there a reason that Ring Alarm Arm, Disarm, Stay modes are not available to be programmed in webcore? Only Ring Alarm "Turn Off"? Sorry if my terminology is all over the place.

With this setup, I can try to achieve a 15 seconds delay. Anything lower than that will be challenging.

You can call below methods from WebCore

def triggeroff() {
  log.info "triggeroff() -> Setting Ring Alarm mode to 'Off'"
  callApiAndUpdateEvents('off')
}

def triggerhome() { 
  log.info "triggerhome() -> Setting Ring Alarm mode to 'Home'"
  callApiAndUpdateEvents('home')
}

def triggeraway() {
  log.info "triggeraway() -> Setting Ring Alarm mode to 'Away'"
  callApiAndUpdateEvents('away')
}

But for clarity, cause im a little slow sometimes. right now, sometimes I can turn my deadbolt and its right on and instant, am I just catching the polling at the right time?

but arming and disarming from ST directly or webcore, would be "near" instant, cause its not waiting on a polling update of the mode, but rather just sending the command to the API?

the code you just wrote, I don't really know how to use in webcore, only know how to use the if / than statements.

honestly, really great work, I can't imagine having to arm and disarm, as well as lock and unlock from front door from 2 different apps. Thank you!

asishrs commented 4 years ago

I am on iPhone X and I can also see the same on iPhone 11 (not a Pro) 😢 I need some time to check this Child Device not appearing issue. It will be helpful if you can uncomment some of the loggers I added in the Ring Alarm Device handler, and share the logs with me.

After this click on the save button and publish for me. This allows capturing additional logs that will be useful

Its2loud1 commented 4 years ago

I just removed both the Ring Device and Smartapp and re-added both.

Now I am seeing this activity in the "Recently" logs but absolutely nothing was added in the devices list for child devices

IMG_7315

asishrs commented 4 years ago

@tylermoragn I meant, you can see the methods triggeroff, triggeraway, triggerhome methods in WebCore

Its2loud1 commented 4 years ago

I am on iPhone X and I can also see the same on iPhone 11 (not a Pro) 😢 I need some time to check this Child Device not appearing issue. It will be helpful if you can uncomment some of the loggers I added in the Ring Alarm Device handler, and share the logs with me.

* Uncomment line 169 on Ring Alarm Device handler -` //log.trace "Ring Device to add/update - ${ringDevice}"`

* Uncomment line 190 on Ring Alarm Device handler - `//log.trace "addSensor() -> Sensor with type ${type} and ${deviceId} already exists, not adding it again."`

After this click on the save button and publish for me. This allows capturing additional logs that will be useful

Happy to but can you please explain "uncomment"? I'm not familiar with that.

asishrs commented 4 years ago

I am on iPhone X and I can also see the same on iPhone 11 (not a Pro) 😢 I need some time to check this Child Device not appearing issue. It will be helpful if you can uncomment some of the loggers I added in the Ring Alarm Device handler, and share the logs with me.

* Uncomment line 169 on Ring Alarm Device handler -` //log.trace "Ring Device to add/update - ${ringDevice}"`

* Uncomment line 190 on Ring Alarm Device handler - `//log.trace "addSensor() -> Sensor with type ${type} and ${deviceId} already exists, not adding it again."`

After this click on the save button and publish for me. This allows capturing additional logs that will be useful

Happy to but can you please explain "uncomment"? I'm not familiar with that.

Remove the // at the start of those lines. After this click on the save button and publish for me.

Its2loud1 commented 4 years ago

"Remove the // at the start of those lines. After this click on the save button and publish for me."

Done

asishrs commented 4 years ago

If for any reason the child device creation fails during the start, the app attempts to create it every 15 minutes.

With that you should either see logs saying log.trace "addSensor() -> Sensor with type ${type} and ${deviceId} already exists, not adding it again." or addSensor() -> Adding sensor with type ${type} and ${deviceId} 🤞

Its2loud1 commented 4 years ago

ok. logs where? in the IDE or on the app in "recently" list?

asishrs commented 4 years ago

ok. logs where? in the IDE or on the app in "recently" list?

ST IDE

Its2loud1 commented 4 years ago

why does it say this in the event logs?

Base Station is Offline

asishrs commented 4 years ago

why does it say this in the event logs?

Base Station is Offline

That is a bug 🐛😔 looks like I am not parsing the ring alarm status properly.

Its2loud1 commented 4 years ago

that might have something to do with it? here are my Ring Alarm Manager logs.

the fact that you can do any of this is amazing to me so if we need to work out a few bugs it's no biggie.

Screen Shot 2020-01-27 at 8 50 40 PM
asishrs commented 4 years ago

Can you also share logs from Device handler?

Its2loud1 commented 4 years ago

Can you also share logs from Device handler?

Screen Shot 2020-01-27 at 8 57 24 PM Screen Shot 2020-01-27 at 8 59 00 PM
Its2loud1 commented 4 years ago

This is the first I've seen this log item.

Screen Shot 2020-01-27 at 9 05 25 PM
asishrs commented 4 years ago

@Its2loud1 I believe, I understand the issue now. Looks like you are using the older version of the Ring Lambda. Can you check? Steps to get the aws url and key is here https://github.com/asishrs/smartthings-ringalarmv2#get-your-api-url-and-key

You may have both old and new version running in your AWS account. You need to use the new version for adding child devices.

Once you get the URL and Key for new lambda, just update that in the Ring Manager settings and reinstall the Device handler. Don't forgot to update the Alarm Device in Ring Manager after you reinstall the Device handler.

Its2loud1 commented 4 years ago

Hmmm. I'll check but I setup the new Lambda 2 days ago and I'm using that URL and key

asishrs commented 4 years ago

Hmmm. I'll check but I setup the new Lambda 2 days ago and I'm using that URL and key

The new API returns an id from the lambda for each device which I am using to create the device id. From the logs you posted https://github.com/asishrs/smartthings/issues/12#issuecomment-579079416 I am not seeing the id.

Its2loud1 commented 4 years ago

Ok, I've deleted all old API from the old setup. The only API i have is this one

Screen Shot 2020-01-27 at 9 17 24 PM
asishrs commented 4 years ago

Do you remember whether you used https://github.com/asishrs/smartthings-ringalarmv2/releases/tag/v1.3.3 as part of this?

If not, can you do update the lambda by following below?

Its2loud1 commented 4 years ago

I can show you screen shots of the matching URL and KEY in both AWS and the ST app if that helps

Its2loud1 commented 4 years ago

Do you remember whether you used https://github.com/asishrs/smartthings-ringalarmv2/releases/tag/v1.3.3 as part of this?

If not, can you do update the lambda by following below?

* Download the `deployement.zip` file from https://github.com/asishrs/smartthings-ringalarmv2/releases/tag/v1.3.3

* Go to https://console.aws.amazon.com/lambda/home?region=us-east-1#/functions

* Click on the lambda name

* Click upload button, choose the `deployement.zip` downloaded and upload that

I did, but I can do it again if you'd like

asishrs commented 4 years ago

@Its2loud1 based on the logs, you dont have the latest version. If you can do that now, it will be helpful