Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
/ SmartZensor Public archive

To control smarthome devices using sensors in my Galaxy Watch (Gear S3)

License

Notifications You must be signed in to change notification settings

AndreasHassing/SmartZensor

Repository files navigation

Smart Zensor

Double-click Home, rotate your wrist; volume goes up and down! Leave control-mode by pressing Back.

See it in action here (twitter video).

I want this on my Samsung Watch ⌚!

Ok cool 🍦, follow these steps:

Prerequisites

Let's go!

  1. Clone this repository.

  2. Copy src/config.template.ts to src/config.ts and make changes to the sonosClientId and sonosClientSecret properties.

  3. Bootstrap a Sonos API token:

    # *nix in pwsh shell, or Win in PowerShell shell:
    ./tools/Set-BootstrappedSonosApiToken.ps1 -ClientId <client id from config.ts> -ClientSecret <client secret from config.ts>
    • You may think: "Why do I need to do all this?": I didn't bother implementing a OAuth2 authentication flow on the Gear - or in a companion app on Android). Instead, you run the initial access-token generation, and then let the app run it inside your watch for consecutive refreshes. Never do that in the real world! Your server should be creating and refreshing tokens on behalf of your users - do not share your integration secrets with devices that are not completely in your control.

  4. Run npm install and npm run build in the project folder.

  5. Load the ./tizenproject project in Tizen Studio and run it on your watch.

    • You can also run npm run build-dev to get source maps and easier debugging.
  6. Configure double-press of the Home button to open this app.

    • Press the Back button to stop controlling the volume.

Can you add feature x to "Smart Zensor"?

Feel free to open an issue against this repository and/or create a pull request. If feature requests are quick and easy to implement, I might add them when I find the time 😊.