stupid bot for our washing machine notifications https://nexy.blog/2025/07/27/how-i-hacked-my-washing-machine/
  • Python 99.6%
  • Dockerfile 0.4%
2025-11-28 01:38:14 +00:00
bot Change cycle button colour if claimed already 2025-11-28 01:38:14 +00:00
.gitignore Upgrades people, upgrades! 2025-09-20 03:00:45 +01:00
config.example.json Add a README and document how to use the bot for archival purposes 2025-11-28 00:54:53 +00:00
docker-compose.example.yml Add a README and document how to use the bot for archival purposes 2025-11-28 00:54:53 +00:00
Dockerfile Fix docker image 2025-09-20 03:12:43 +01:00
LICENSE Add LICENSE 2025-11-28 00:40:33 +00:00
README.md Add a README and document how to use the bot for archival purposes 2025-11-28 00:54:53 +00:00
requirements.txt Upgrades people, upgrades! 2025-09-20 03:00:45 +01:00

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:

  1. Register a Discord bot and get its token. You can follow this guide if you don't know how.
  2. Invite the bot to your server and give it permissions to see and send messages to a channel (including embeds).
  3. Clone this repository: git clone https://git.nexy7574.co.uk/nex/washing-machine-bot.git
  4. Copy the example compose file to docker-compose.yml: cp docker-compose.example.yml docker-compose.yml
  5. Make sure ./webhook-message-id.txt exists: touch ./webhook-message-id.txt
  6. Make sure that ./washing-machine.db exists: touch ./washing-machine.db
  7. Copy the example config file to config.json: cp config.example.json config.json
  8. Fill in the config.
  9. Run docker compose up -d --build to build and start the bot.
  10. The bot should now be running. Run docker compose logs -f --no-log-prefix bot to see its logs.

Tip

default_api_key is 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.