I've been using a self-hosted federated Matrix server for chatting with family members and recently deployed it for one of my clients and needed a decent way to administrate the server. This is where I decided to make node-red-contrib-matrix-chat to accomplish just this.
The current nodes that existed didn't offer much flexibility (basically could only send/receive messages) and had quite a few issues that went years without being resolved. I tried to feature pack this module as much as possible and even added the ability for users to run functions directly on the client itself by exposing it globally for function nodes. This should cover most use-cases people have.
There is a public room I created to offer support to anyone using this module. Feel free to join and ask questions! #node-red-contrib-matrix-chat:skylar.tech
Installing this module is super easy. Just open your palette manager in Node-RED and search node-red-contrib-matrix-chat and click install. You are now good to go!
Setting up an account
You need an account for your client to use. If you are going to be using End-to-End Encryption you should generate the bot and only use it within Node-RED otherwise if you have other clients connected on the same user it could cause problems with e2ee (key sharing is currently not supported).
If you have access to the server directly you can use Shared Secret Registration as described here.
If this is a server you do not administrate/have access to follow these instructions:
- In a private/incognito browser window, open Element.
- Log in to the account you want to get the access token for, such as the bot's account. Do not setup key storage.
- Click on the bot's name in the top left corner then "Settings".
- (Optional) Set your bot's display name and avatar.
- Click the "Help & About" tab (left side of the dialog).
- Scroll to the bottom and click the
<click to reveal>part of
Access Token: <click to reveal>.
- Copy your access token to a safe place, like the bot's configuration file.
- Do not log out. Instead, just close the window. If you used a private browsing session, you should be able to still use Element for your own account. Logging out deletes the access token from the server, making the bot unable to use it.
I created some examples on the repository so feel free to check them out:
Generating user's from CSV file
This has been an extremely helpful module for me to use not only at home for my own self-hosted stuff but also for my clients. I currently have all the employees for one of my clients listed in a CSV file with columns containing their pre-generated password and whether they are currently enabled or not. Every few minutes I have it process the CSV and update the accounts on the server. This makes it easy for my client to administrate who has access as pretty much everyone knows how to use Excel. I'll most likely make a post in the future when I clean it up a little bit.
I hope others find this useful and if anyone wants to contribute feel free to open a PR on the repository. I know it has been a while since I have posted anything and I am truly sorry. It's been a rough time since I last posted but things are starting to get better and I am planning to start posting regularly again.
I plan to create more modules for Node-RED moving forward. I started with this module to get familiar with how to build modules for Node-RED. I'm currently working on Cannabis tracking software for farmers and could see Node-RED being a powerful tool in automating basic tasks (such as creating a task for the flowering crew when moisture levels in boxes fall below a set threshold).
Thanks for reading! Feel free to leave a comment if you like my work :)