ESP8266/Uebertrafficlight

Aus C3MAWiki
Zur Navigation springenZur Suche springen
Die druckbare Version wird nicht mehr unterstützt und kann Darstellungsfehler aufweisen. Bitte aktualisiere deine Browser-Lesezeichen und verwende stattdessen die Standard-Druckfunktion des Browsers.

Uber Traffic Light

Die Ampel hat drei Fraben, welche alle einzeln wie folgt geschaltet werden können:

mosquitto_pub -h bigbrother -t "/room/trafficlight/red/command" -m "on"
mosquitto_pub -h bigbrother -t "/room/trafficlight/yellow/command" -m "on"
mosquitto_pub -h bigbrother -t "/room/trafficlight/green/command" -m "on"

Neben den Befehlen on und off kann auch eine Blinkfrequenz wie folgt festgelegt werden:

mosquitto_pub -h bigbrother -t "/room/trafficlight/yellow/command" -m "blink 200"

Bei den statischen Befehlen on und off wird der aktuelle Zustand auch ausgegben:

mosquitto_sub -h bigbrother -v -t "/room/trafficlight/#"
/room/trafficlight/yellow/state off
/room/trafficlight/red/state on
/room/trafficlight/green/state on