AronAyub/MQTT-and-Raspberry-Pi ? reverse-engineered prompt
Reverse engineered prompt
Build me a simple Raspberry Pi MQTT home automation demo in Python.
I want a script that connects to an MQTT broker with Paho MQTT, subscribes to a topic, and turns a few Raspberry Pi GPIO pins on and off based on incoming messages. Please include clear setup steps for Mosquitto on the Pi, a quick way to test publish and subscribe from the terminal, and a working example using a few commands like green_on, green_off, yellow_on, yellow_off. Use the Raspberry Pi board pin numbering and make it easy to swap LEDs for a relay module later so it could control real appliances.
Keep it beginner friendly and practical, with a clean main Python file and a little explanation of how to run it. If you need to, use current docs online to make sure the MQTT and GPIO code is up to date.
Have a live product UI? Try website reverse