This whole project is still kinda sketchy. The goal is to attach a Raspberry Pi (or any other small board) to a Brother labelprinter and use it to print the current date onto a label, when a button is pressed.
Why? To stick it on food in your fridge. Ever lived in a shared appartment?
The script implements this topic with last-will message as indicator if it's still running:
dersimn/maintenance/LabelPrinter/online -> bool
Sending anything to this topic will trigger printing of a new label with the current date:
dersimn/action/LabelPrinter/printdate <- any string
Configure OpenHAB or mqtt-smarthome to trigger this topic when an Amazon Dash button is pressed.
Install Docker on your Raspberry Pi and use this command to run the script:
docker run -d --restart=always --name=labelprinter \
--device=/dev/usb/lp0 \
-e BROTHER_MODEL="QL-700" \
-e BROTHER_LABEL="d24" \
-e MQTT_HOST="10.1.1.50" \
-e TZ="Europe/Berlin" \
dersimn/brother_ql_fridgedate
Refer to the brother_ql documentation / source code for compatible printer models and label types.
docker run -d --name=mqtt -p 1883:1883 -p 9001:9001 -v "$(pwd)/contrib/mosquitto.conf":/mosquitto/config/mosquitto.conf:ro eclipse-mosquitto
docker run -d --name=webui \
-v $(pwd)/contrib/webui.yaml:/www/data.yaml:ro \
-e "WS_PROXY=host.docker.internal:9001" \
-p 8000:80 \
dersimn/mqtt-smarthome-webui
docker build -t test .
docker run --rm -e MQTT_HOST=host.docker.internal test python3 mqtt.py
docker compose up
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx build --platform linux/amd64,linux/arm/v7 -t dersimn/brother_ql_fridgedate -t dersimn/brother_ql_fridgedate:1.x.0 --push .
Philipp "pklaus" Klaus for his brother_ql package. Jim Lyles for the attached Vera font.