[PROJECT] SteelSeries Mousepads

The Steel Series mousepads are quite nice in my opinion and some have a light strip around the outside, allowing for some nice additions to lighting a desk at night. They also have an API, providing an opportunity to control them in line with other lighting on my desk:

This project is about exploring that as an option for integrating with HE.

I must admit updates to the PrismSync app does seem to give me most of what I am after in this space, so it is likely to be only a general interest in integrating anything I can into HE that will lead me to look at this in more detail.

If anyone is interested in this, I got some basic stuff working using HTTP calls through PostMan, which could be easily translated to a driver / app in HE. This just sets two similar colours across two zones on the LED strip around the mousepad. I would send a 1 or 0 depending on whether I want this effect on (1), or the lighting turned off (0). I'd like to look at more complicated lighting effects eventually, then try and tie this in with other automations, such as turning the lights off when I go to bed and maybe when I am working from home.

The example was built using SS's notes here.

The Setup

1. Register the "Game"

HTTP POST: http:// < IP of PC > : < SS Engine Port > /game_metadata

Body:

{
  "game": "LIGHTING",
  "game_display_name": "Smart Lighting",
  "developer": "sburke781",
  "deinitialize_timer_length_ms": 60000
}

2. Register Game Event
HTTP POST: http:// < IP of PC > : < SS Engine Port > /register_game_event

Body:

{
  "game": "LIGHTING",
  "event": "ON_OFF",
  "min_value": 0,
  "max_value": 100,
  "icon_id": 0,
  "value_optional": false
}

3. Bind Game Event

HTTP POST: http:// < IP of PC > : < SS Engine Port > /bind_game_event

Body:

{
    "game": "LIGHTING",
    "event": "ON_OFF",
    "min_value": 0,
    "max_value": 1,
    "handlers": [
        {
        "device-type": "indicator",
        "zone": "one",
        "color": {
            "red": 255,
            "green": 24,
            "blue": 0
        },
        "mode": "color"
        },
        {
        "device-type": "indicator",
        "zone": "two",
        "color": {
            "red": 255,
            "green": 24,
            "blue": 0
        },
        "mode": "color"
        }
    ]
}

Activating the Game Event

4. Game Event
HTTP POST: http:// < IP of PC > : < SS Engine Port > /game_event

Body:

{
    "game": "LIGHTING",
    "event": "ON_OFF",
    "data": {
        "value": 1
    }
}

5. Heartbeat (Optional)
HTTP POST: http:// < IP of PC > : < SS Engine Port > /game_heartbeat

Body:

{
  "game": "LIGHTING"
}

Annoyingly the interface seems to be bound to only local calls via loopback, and changes the port each time the application is restarted.... A bit more work will be required....

If only for my own notes....

I am thinking to get around the binding to the loopback address I might start and use EventGhost and the Community app / driver to initiate the lighting effects. I would have preferred to build something, but in the end some notes on configuring the setup may be what I need to do.

I'm thinking if I can trigger an Event on the PC and then EventGhost makes local HTTP calls from my earlier posts, then that should do it.

Here's the EventGhost Community thread:

Here's a post on the EventGhost forum about making HTTP calls with a small Python script or commands.

http://www.eventghost.net/forum/viewtopic.php?t=8138

I'll post back when I have a chance to try it out. All I've done so far is install EventGhost and do some reading.

Ok, this is definitely possible using the PC Controller plugin / app and EventGhost.

Here is a teaser of the EventGhost setup and calling an event from the HE device. Basically.... I have a configuration setup with the SteelSeries Engine application that "illuminates" the led (not really), but with a colour of black, essentially leaving it turned off. I then have my "app" in SS Engine setup to have two states, on and off (see earlier posts on this thread). In EventGhost there is a SteelSeries Heartbeat Timer that runs every 50 seconds and triggers the Timer.SS.TriggerEvent event, which triggers the macro SteelSeries - Trigger. This runs a python script, checking a global variable eg.globals.SmartLights, triggering the SS.OnEvent if true, otherwise the SS.OffEvent. These events trigger the turning on or off of the led light. To control the global variable or state of the lights, I can send SS.ModeChangeOn or SS.ModeChangeOff events from the Hubitat PC Controller device to turn the lights on or off (these events trigger a macro on EventGhost to update the global variable and immediately change the state of the led light.

Make sense.... :slight_smile:

I still need to include some python (I expect) to read a config file for the SS Engine to work out the port it listens on for the HTTP calls, which changes each time it starts up.

That is a skeery desktop...you're in black ops, aren't you?

:wink:

1 Like

I tend to refer to it as DevOps.... :wink: While not an entirely inaccurate representation of my night-time environment, a little exaggerated by some post processing...

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.