Um nicht lange suchen zu müssen, habe ich meine Erweiterungen hier mal zusammengefasst.
Für MQTT : sudo pip install paho-mqtt
Keyboards:
from_nextion.py - zum ansteuern des Nextion-Displays
from_url.py - einfache Ausführung von Event's über eine Url
Actions:
mqtt.py - senden von MQTT-Nachrichten an z.B. Smarthome-Servern
In der mqtt.py User und Passwort anpassen.
Beispiel doorpi.ini
[keyboards]
prodsystem = piface
next = nextion
web = url
[next_OutputPins]
page 1 = page 1
[next_InputPins]
1111t = out:Tueroeffner,1,0,2
[web_InputPins]
keypad = out:page 1,1
[prodsystem_InputPins]
0 = mqtt:192.168.***.***,1883,doorpi/action/ring1,true,false
[prodsystem_OutputPins]
1 = Tueroeffner
2 = blinking_led
[prodsystem_keyboard]
bouncetime = 200
polarity = 0
pressed_on_keydown = True
[EVENT_OnKeyPressed_prodsystem.0]
10 = mqtt:192.168.***.***,1883,doorpi/action/ring1,true,false
[EVENT_OnStartup]
10 = sleep:5
20 = mqtt:192.168.***.***,1883,doorpi/action/startup,true
[EVENT_OnShutdown]
10 = mqtt:192.168.***.***,1883,doorpi/action/startup,false
Alles anzeigen
Aufbau MQTT:
10 = mqtt:192.168.***.***,1883,doorpi/action/ring1,true,false
Befehl:MQTTServerHostname,MQTTServerPort,MQTTNachricht,Variable1,Variable2
Wird Variable2 weggelassen, wird nur Variable1 gesendet(z.B. StartUp DoorPi).
Mit Variable2 wechselt der Status von Variable1 nach 2 sek. auf Variable2 (z.B. beim Klingeln wechseln von true auf false)
Beispiel Nextion Url:
http://192.168.***.*/control/trigger_event?event_name=OnKeyPressed_web.keypad&event_source=doorpi.keyboard.from_url
rufe ich die Seite 1 vom Nextion auf.
Die erstellten Event's in der doorpi.ini, kann man unter der Url : 192.168.***.***/dashboard/pages/status.modules.eventhandler.html auslesen.