SmartThings Community

NST Manager Real-Time Events

thermostat
cameras
nest
(Anthony S.) #1

Nest Real-time Event Streaming to SmartThings NST Manager

Versions:
  • Install Script: 0.9
  • Service Package: 2.0.1

FYI:

  • While the events are received near Real-Time there is a still minor processing delay between receiving the Nest Event and it reflecting in ST (~3 seconds).

Requirements to Use:

  • Try to contribute in some way to the Nest Manager or NST Manager Project documentation!
  • Have a Raspberry Pi/Linux machine running in there home. (This will install on windows but will require manual starting. Please do some searching…)
  • User is good at installing a simple bash script.
  • An Internet Connection
  • Device running any Linux Distribution:
    Install has been tested on the following distributions:
    • Ubuntu
    • Rasbian (Raspberry Pi)
    • Mint
    • TurnKey Linux
    • Just about any Debian based distribution

Installing the Service

Run the following Commands in Console (In this Order):

  1. Download the latest script to the local user folder

    wget https://raw.githubusercontent.com/tonesto7/nst-streaming/master/nst_utility_script.sh -O nst_utility_script.sh

  2. Make the script executable

    chmod +x nst_utility_script.sh

  3. Start the Install Process

    ./nst_utility_script.sh

    Wait while the script performs the following:
    1. Ensures all of your packages are up to date.
    2. Makes sure you are running the latest version of NodeJS
    3. Install the NST-Streaming service node package and pre-requisite packages

  4. That completes the service portion of the install. It should be up and running silently in the background


Enabling in NST-Manager

  1. Open NST-Manager SmartApp under SmartThings Mobile App
  2. Tap on Application Preferences
  3. Tap on Device | Structure Polling Preferences
  4. Turn on Enable Rest Streaming
  5. Tap on Auto-Discover Local Service
  6. Let the discovery run until the service is found
    (The page will refresh automatically and discovery may take 60 seconds)
  7. Tap Local NST Services and select the discovered item and press Done
  8. Press Done Until you get back to the Main smart apps list.

You can verify the service is working by watching the logs in the IDE for HAS Changed (Stream):

11:32:29 AM: info ||| API Device Data HAS Changed (Stream)

View Streaming Logs for Debugging

You can view the logs in the console window with this command:

journalctl -f -u nst-streaming.service

Getting Updates

To make sure you are running the latest script always pull in the latest script by running these two commands:

wget https://raw.githubusercontent.com/tonesto7/nst-streaming/master/nst_utility_script.sh -O nst_utility_script.sh

./nst_utility_script.sh -u


Custom Port

By default the service port is set to 3000
if you need to change it just use the install script:

  • New Installs Use: ./nst_utility_script.sh -port 3003
  • Changing Existing Install: ./nst_utility_script.sh -update -port 3003
Remember that anytime you use the script to make changes you need to pass the custom port

Available Script Parameters

These parameters will executes different script functions:
./nst_utility_script.sh [arg]

image

2 Likes
[RELEASE] NST Manager v5.0
Nest cam integration to SmartThings
[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)
[RELEASE] NST Manager v5.0
[RELEASE] NST Manager v5.0
[RELEASE] NST Manager v5.0
[RELEASE] NST Manager v5.0
[RELEASE] NST Manager v5.0
(Jarrett Lusso) #2

What’s the point of this?

(Anthony S.) #3

Smartthings doesn’t support WebSockets for receiving real-time changes from Nest so we are required to request data from Nest Every 1-2 minutes. So the point is to allow you to subscribe to events on your nest devices and send them to ST so you can trigger actions

1 Like
(ᵇᶥᵍ ШΞΒȘГẬŚ (Webstas)) #4

Donated, where do we get the server.js files?

(Blacktirion) #5

@tonesto7 Does this help with getting around the rate limits? It seems like Nest has recently gotten more strict about how many you can send in a period of time.

Thanks

(Anthony S.) #6

I doesn’t really change that but our queuing mechanism in the smartapp is pretty advanced to where you will never hit the rate limit. The real-time events are about subscribing to the nest events and sending them to ST within 2-3 seconds of them happening.

#7

@tonesto7 thanks for all your work on this. Im trying to trigger a porch light on a nest cam motion event. Will this work for that or will the delay be to long?

(Anthony S.) #8

This is exactly what i use it for in my setup. There is about a ~4-5 second delay

(Marcos) #9

HI every one. I had a hell of a time trying to get just the app to work. I am at another predicament. When I try to sign into my nest account to configure the app, it responds with something went wrong. I am using the most recent version and the nest prmary account. Any suggestions?

[RELEASE] NST Manager v5.0
(Eric) #10

I assume you are trying to get NST manager working?

There is another thread on that.

Please ensure you follow the instructions carefully
http://thingsthataresmart.wiki/index.php?title=NST_Manager

(Rhys) #11

Still need help with Documentation for Real Time NodeJS streaming service?

(Joe Goldin) #12

@tonesto7 How can I get a hold of the install instructions and source for this? I have a raspi ready to go! Thanks :slight_smile:

(Rhys) #13

@tonesto7 also interested in this if you are still looking.

(MacTechGenius) #14

I have a Mac that is always running. Can I use this?

I have a Nest Hello on the way…so want to use this for it.

(Dave O) #15

@tonesto7 is this still available? Thanks!

(Anthony S.) #16

It is… I’m just on vacation. I will be back tomorrow and can send you instructions

1 Like
(MacTechGenius) #17

Would also love to have the instructions

(Chris Wilson) #18

Is there anynchamce I can get the code for this and setup instructions?

(Jacob W) #19

@tonesto7 got the fix installed for the state manager and it rocks! Thanks. Now that I can get in my SmartApp again, I’ve moved on to the REST service. Been looking forward to this feature. My journalctl log is saying that a token is missing on the SmartThings side of things.

Can’t send Status back to SmartThings because the enpoint url or access token are missing…

I’m guessing this is where the donation only part comes in. (Gladly sent one your way). Take your time and thanks again for the great work.

Update: following the GitHub instructions for the token. Can’t seem to figure out what redirect URI I should be using. I’m trying https://graph.api.smartthings.com/oauth/authorize or ./oauth/callback … Is either right? It takes me to login and I select my location but then I get:

image
or
image

(Anthony S.) #20

You will need to go into the NST Manager > Preferences > Polling Settings> There is a section there about discovering the streaming service