Sharptools not getting correct location settings from smartthings

Hi Everyone,

I am having an issue with my rules not executing becuase it is not getting the correct data from smartthings about the current mode of the house.

For example, I have a rule that turns on the night lights when motion is detected and the mode is “night”, however I can see in the log that it thinks the house is in “day” mode when its in “night” mode. It doest appear to be an issue with smartthings, because those devices are all updating in the smartthings bashboard.

Thoughts? or where can I escalate this to sharptools?

Can you please share a screenshot of your rule and a snippet of your rule logs so I can better understand how you have things setup?

I would also recommend adding a Mode tile for that location to a dashboard so you can watch the mode changes occur and ensure they are updating in SharpTools as you expect them to.

If the Mode is only used within a condition and not in any rule triggers, this will also ensure that the relevant event subscriptions are in place and you can verify that the data is updating as expected. If that’s the case that the Mode is only used in a rule condition and nowhere else, just adding the Mode tile to your dashboard might resolve the underlying issue for you. :slight_smile:

Here are the screenshots of the rule and the log. You can see that it states the mode is in ‘night light’ however it is in ‘night’ I can confirm this on multiple platforms. This rule has worked for over 12 months.

I tried to reset the connection between sharptools and smartthings, now none of my rules are working.

**Sorry, can only attach one media item in a post apparantly. Ill try post the other in another reply

Please keep in mind that the only time you would want to use the disconnect feature is if you are going to permanently remove the location from your SharpTools account.

As part of the disconnect process, all of the event subscriptions are unregistered in SmartThings which means no events will get sent over.

Once you have the location reconnected, I would recommend opening a page in SharpTools (dashboard, rule, user-page), then refresh your browser page. Behind the scenes, that runs a series of health-checks that will try to resolve situations like this. Note that it may take a few minutes to run in the background.

If you ever need to perform a fresh authorization / sync, you can proceed through the authorization flow starting from your SharpTools User PageManage Connections without using the disconnect feature.

As for the rule itself, I see that the mode is used as a condition. Please see the rest of my feedback, quoted immediately above for convenience.

I tried this multiple times first.

It still appears to be connected. I have also tried to reconnect it multiple times and i dont get any warnings saying it hasnt worked. it does show as connected on my home page.

I did add the tile to my dashboard. It appears that while I can send a command to change the home mode, it does not update from smartthings with the correct mode.

I really need some help here. Can you please have a look at my settings

Did you refresh the page as I suggested? This runs a series of healthchecks in the background that can resolve issues like this.

Yes I have done this a few times now. Nothing is changing

I can see that the location is authorized, but I’m also seeing that the event subscriptions in SmartThings were removed when the location was disconnected.

As a test, can you please try taking one rule that you can easily trigger using a device from SmartThings – for example, maybe a rule triggered by a switch status changing that you can easily control – then do the following:

  1. Disable the rule and save
  2. Wait a moment
  3. Enable the rule and save
  4. Refresh the page (while on a SharpTools dashboard/rule/user page)
  5. Wait 30+ seconds for the background healthcheck to complete
  6. Try testing that rule again.

Edit: I can see that SmartThings is reporting that the Location Mode event subscription is setup now, so I suspect that if you toggle the mode, you should see that change in your dashboard.

Edit2: I updated the instructions above to indicate that you would need to refresh the page to run the healthcheck in the background after disabling and re-enabling the rule.

Yes I am starting to get some functionality back. I can see the mode is updating instantaneously on the sharpthings dashboard. I am however having trouble getting the rule to work again. The last time it ran was before I disconnected everything.

Let me create a new rule and see if that works

You could also try adding the trigger devices to a dashboard. That sets up the event subscription if it’s not there already. Then you could refresh the page while viewing the dashboard that you added the devices to so it will run the health check in the background.

Yes I just tried this. It seems to have triggered the rule. Ill go through and do a test of everything and let you know if I have issues.

Thank you so much for your help, ill get back to you

1 Like

Ok, so I have done some testing and it looks like I am just back to where I have been since yesterday. It looks like there is a communication error between smartthings and sharptools. I have taken two screenshots to show what I mean. The bottom left window is ActionTiles, it shows the correct mode that smartthings is in. As you can see by the log in the second screenshot, sharptools is not executing a rule because it thinks smartthings is in a different mode. The sharptthings dashboard however sees the correct location mode.

**Next post has the second screenshot

thoughts?

Here is something interesting.

I created a rule to update a variable to reflect the location mode status. As you can see, by the logs (posted in the next post) it is picking up that the location changed to “2 Home - Night” however it is setting the variable to “Night”

Based on the rule that I have setup, it should make the variable match the mode.

I’m working on a patch now that I believe will resolve this.

In the meantime, you could use the Context Variable for the Event Value which would save the value that triggered the rule into your variable rather than querying for the mode.

1 Like

I pushed a release that should resolve this. Can you give it a try?