Redis smart home integration, free and open source

Redis or Valkey keys as Gladys sensors, and writes from your scenes.
Your Redis (or Valkey) keys as Gladys sensors, and writes from your scenes: a simple bridge between Gladys and the home scripts that already keep counters, states or queues in Redis.
Tested against real Redis 7.4 and Valkey 8.1 (Docker), with and without a password, with an ACL user, and with keyspace notifications. Feedback and bug reports are welcome on GitHub.
What you get
- One device per key you add: a string or a hash field gives its value (a number, or a text), a list, a set, a sorted set or a stream gives its length.
- One device for the server: reachable, version, memory used, connected clients, keys in the database.
- Instant updates with the keyspace notifications, if your server sends them; otherwise the keys are read at the interval you choose.
- Scene actions to write a value, increment a number and publish a message, off by default.
- A scene trigger when a key changes (written, deleted, expired…).
- A dashboard widget with the value of every key.
Requirements
- Redis 6 or later, or Valkey, reachable from Gladys over the network (not
localhost: the integration runs in its own container). - Redis 6 or later is needed for an ACL user; with a plain
requirepass, leave the user empty.
Configuration
- Address: name or IP address of the server.
redis://host:portandrediss://host:port(TLS) are accepted too, without credentials. - Port, Database number (0 unless your scripts use
SELECT). - User (ACL, optional) and Password (optional).
- TLS connection, and Accept self-signed certificates for a certificate of your own.
- Refresh interval: from 10 seconds to 10 minutes; each key costs two
commands per read (
TYPE, then the read itself). - Allow writing from scenes: off by default; see Scenes.
- Channels allowed for publishing: the channels "Publish a Redis message" may use, separated by commas.
- Language of the names and messages: the names of the server features and the messages of the actions.
Then use Test the connection: it reads the server and every key, and says what is wrong.
An ACL user only needs to read the keys you add. For example, read only:
ACL SETUSER gladys on >password ~sensors:* +@read +info +dbsize +ping +hello +select +type,
plus +@write +publish &* to write and publish from scenes, and +subscribe &__keyspace@0__:* for
the notifications.
Keyspace notifications
Tick Follow keyspace notifications to read a key as soon as it changes. The
integration subscribes to the exact channel of each key added (never a pattern)
but never changes the server configuration: the server must send them. For
example, in redis.conf: notify-keyspace-events KA, or at runtime:
CONFIG SET notify-keyspace-events KA. Test the connection says whether the
server sends them. The periodic read stays as a safety net.
Adding keys
Gladys has no list field in a configuration form: the keys are added with the Add a key action of the configuration page, and kept by the integration.
- Key: the exact name, e.g.
sensors:garage:temperature. No pattern: the integration never scans the database. - Hash field (hash only): for a hash, the field to read, e.g.
power. - Type in Gladys: Automatic (number or text), Number, Temperature (°C), Humidity (%), Percentage (%), Power (W), Energy (kWh), Text. Automatic decides from the current value: a number, or text. A list, a set, a sorted set or a stream is read as its length.
- Name (optional): the name of the device; the key by default.
The same key added again changes its name or its type (a new type is a new feature: use "Update" in the Discover tab). Remove a key stops following a key; its device stays in Gladys until you delete it. Up to 50 keys.
Devices
Add the devices to follow from the Discover tab of the integration: the server, and one device per key. The values are sent when they change, and again every 6 hours when they do not. While the server does not answer, the key devices show as unreachable and the "Reachable" feature of the server goes to 0.
Scenes
Triggers
A Redis key changes: a keyspace notification arrived for a key you follow.
Filters: the key (empty: any) and the Redis event (set, del, expired,
incrbyfloat, hset…, empty: any). Variables: the key, its name, the event
and the new value (empty if there is none). Needs the keyspace notifications
(see above). To act on a value (above a threshold…), use the key device in a
"Device state" trigger instead.
Actions
Writing is refused until you tick Allow writing from scenes, and only reaches the keys you follow: the scene picks a key device. A list, a set or a stream is never overwritten.
- Write a Redis value:
SET(orHSETfor a hash field), with an optional expiry in seconds (on a hash, the expiry applies to the whole key). The value accepts the scene variables. - Increment a Redis value:
INCRBYFLOAT(orHINCRBYFLOAT), by 1 when empty, negative to decrement, a comma is accepted. Gives the new value. - Publish a Redis message:
PUBLISHon a channel listed in Channels allowed for publishing. Gives the number of subscribers reached.
Dashboard
The Redis values widget lists the value of every key you follow (or the ones chosen in its settings), a row for the server, and a Refresh button. The settings can hide the server row and the button.
Limits
- Strings, hash fields, lists, sets, sorted sets and streams; other types (modules such as RedisJSON) are not read.
- No Redis Cluster nor Sentinel: one server.
- A text is cut at 255 characters.
Troubleshooting
- "does not answer": check the address and the port, and that Redis listens
on the network (
bind,protected-mode), not only on127.0.0.1. - "access refused": check the user and the password; leave the user empty
with a plain
requirepass. - "refused by the ACL of the user": the ACL user cannot read this key or run this command (see Configuration).
- No instant update: the server does not send the keyspace notifications; Test the connection says so.
- More details with
LOG_LEVEL=debugin the logs of the integration. Report a problem on GitHub.
Redis is a trademark of Redis Ltd. This integration is not affiliated with Redis Ltd nor with the Valkey project.
Configuration settings
These are the settings Redis asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your Redis server | section | No | Redis 6 or later, or Valkey. Enter its address, then add the keys to follow with "Add a key" below, and their devices from the Discover tab. |
| Address | string | Yes | Name or IP address of the server, as seen from Gladys (not localhost). |
| Port | number | No | |
| Database number | number | No | 0 unless your scripts write elsewhere (SELECT). |
| User (ACL, optional) | string | No | Empty with a plain requirepass password. |
| Password (optional) | secret | No | |
| TLS connection | boolean | No | |
| Accept self-signed certificates | boolean | No | |
| Reading and writing | section | No | |
| Refresh interval | select | No | How often the keys are read: two commands per key. |
| Follow keyspace notifications | boolean | No | A key is read as soon as it changes. The server must send them (notify-keyspace-events, see the guide): the integration never changes it. |
| Allow writing from scenes | boolean | No | Off: the scene actions refuse to write. On: only the keys followed can be written. |
| Channels allowed for publishing | string | No | For "Publish a message": channel names separated by commas. |
| Language of the names and messages | select | No | Names of the server features, scene and action messages. |
How to install Redis in Gladys
- In Gladys, open Integrations: Redis appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-redis:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/guim31/gladys-redis.
Redis requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
Redis is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation