- Python 99.6%
- Dockerfile 0.4%
| bot | ||
| .gitignore | ||
| config.example.json | ||
| docker-compose.example.yml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
Washing Machine Bot
This is the source code for the Discord bot that was featured on my blog: https://nexy.blog/2025/07/27/how-i-hacked-my-washing-machine/. It polls my WiFi-enabled washing machine's "API", checks for changes in the state, and appropriately sends or edits a notification in a Discord channel. It also features statistics tracking and a full notification system, which means I can put a load of washing in, go play games for a few hours, and be notified when it's done without having to guess.
Running yourself
You probably won't have much luck unless you have the same-ish washing machine as me (I can't even name it), but if you want to try your luck, here's some setup steps:
- Register a Discord bot and get its token. You can follow this guide if you don't know how.
- Invite the bot to your server and give it permissions to see and send messages to a channel (including embeds).
- Clone this repository:
git clone https://git.nexy7574.co.uk/nex/washing-machine-bot.git - Copy the example compose file to
docker-compose.yml:cp docker-compose.example.yml docker-compose.yml - Make sure
./webhook-message-id.txtexists:touch ./webhook-message-id.txt - Make sure that
./washing-machine.dbexists:touch ./washing-machine.db - Copy the example config file to
config.json:cp config.example.json config.json - Fill in the config.
- Run
docker compose up -d --buildto build and start the bot. - The bot should now be running. Run
docker compose logs -f --no-log-prefix botto see its logs.
Tip
default_api_keyis only used to store the initial decryption key for the washing machine's API, as the key is then stored in the database after the first run. If it is wrong, becomes wrong, or is simply missing, the bot will attempt to brute-force the encryption key when it encounters an encrypted payload (which doesn't always happen for some reason). This won't take long, but is likely to fail if the washing machine returns a slightly different payload to what is expected (since the brute-force is based on known plaintext). If you know the correct key, it's best to put it in the config to avoid any issues.