Skip to content

LindsayCole/MMM-YoLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

MMM-YoLink - YoLink Sensors on your MagicMirror²!

This is a module for MagicMirror² that displays data from your YoLink sensors. After a truly epic journey of trial, error, and some fantastic community-led detective work, it finally works! My entire purpose for this was so that I could see a hot tub if it went into an error state.

A Friendly Disclaimer

This module was built through sheer persistence and the goodwill of the open-source community. It works for me, and I hope it works for you! However, please consider it a "use at your own risk" project. I can't offer official support, but I'll do my best to help if I can.


Installation

Getting this module up and running is pretty straightforward.

  1. Navigate to your modules folder: Open a terminal on your Raspberry Pi and go to your MagicMirror modules directory.

    cd ~/MagicMirror/modules
  2. Clone the repository:

    git clone https://github.com/LindsayCole/MMM-YoLink.git
  3. Install dependencies: This module needs node-fetch to talk to the YoLink servers.

    cd MMM-YoLink
    npm install

That's it for the installation! Now, let's get it configured.

Acquiring Your API Keys

Before you can configure the module, you need to get your personal API credentials from the YoLink app.

  1. Open the YoLink app on your mobile device.
  2. Tap the menu icon (☰) in the top-left corner.
  3. Go to Settings.
  4. Tap on User Access Credentials.
  5. You will find your UAID (which you'll use for uaid) and Secret Key (for secretKey) on this screen.

Configuration

Add the module to your ~/MagicMirror/config/config.js file. Here is a sample configuration with all the available options explained.

{
    module: "MMM-YoLink",
    position: "top_left", // Or wherever you want it!
    // header: "YoLink Sensors", // This line is commented out to hide the header
    config: {
        // --- Required ---
        uaid: "your_uaid_from_the_app",
        secretKey: "your_secretKey_from_the_app",

        // --- Layout & Alerts ---
        staticDeviceId: null, // Set a device ID here to make it always visible on the left.
        rotationInterval: 10 * 1000, // How often to rotate the other sensors (in ms).
        hotTubDeviceId: null, // Set the ID of a temperature sensor to monitor for alerts.
        hotTubTempDrop: 5, // Degrees C or F to trigger the flashing alert.

        // --- Filtering ---
        deviceIds: [], // Leave empty to show all compatible devices.
        showTypes: ["THSensor", "LeakSensor", "DoorSensor", "MotionSensor"],
        excludeIds: [],

        // --- Customization ---
        tempUnit: "C", // "C" for Celsius, "F" for Fahrenheit
        batteryThreshold: 25, // Show battery level only if it's at or below this percentage.
        updateInterval: 5 * 60 * 1000,
        deviceColors: {
            "d88b4c040005efe3": "#f5a623", // Example: Set a custom color for a specific device
            "another_device_id": "lightblue"
        }
    }
},

Configuration Options

Option Description Default Value
uaid Required. Your User Access ID from the YoLink app. ""
secretKey Required. Your Secret Key from the YoLink app. ""
staticDeviceId Set the ID of a device here to make it always visible in its own column. The other devices will rotate in a second column. null
rotationInterval If using staticDeviceId, this sets how often the second column rotates to the next sensor, in milliseconds. 10000 (10 seconds)
hotTubDeviceId Set the ID of a temperature sensor to monitor. If its temperature drops by hotTubTempDrop, its name will flash and the temp will turn red. null
hotTubTempDrop The number of degrees (C or F) the monitored sensor's temperature must drop between updates to trigger the visual alert. 5
deviceIds An array of specific device ID strings you want to display. If you leave this empty, the module will try to show all compatible devices. []
showTypes If deviceIds is empty, this will only show devices of the types you list here (e.g., "THSensor"). ["THSensor", "LeakSensor", "DoorSensor", "MotionSensor"]
excludeIds If deviceIds is empty, this lets you hide specific devices by their ID. Useful for hiding a Hub or a device you don't need to see. []
tempUnit The unit to display for temperature. Can be "C" or "F". "C"
batteryThreshold The module will only display the battery level if it is at or below this percentage. Set to 100 to always show it. 25
updateInterval How often the module should ask YoLink for new data, in milliseconds. 300000 (5 minutes)
deviceColors An object that maps a deviceId to a color (e.g., #ffffff, orange). This will change the color of the device name. {}

Enjoy your new sensor display!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors