Hi guys,
I used basicly the code from bartus here to set up a ledstrip. But unfortonaly the mqtt-messages won#t come trough.
The log says that the mosquitto server is up and running:
2019-02-17 11:30:56.467 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2019-02-17 11:30:56.472 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'pinguinbau'
my .itmes
String Leinwand_oben "Leinwand" {mqtt=">[broker:home/LeinwandUp/set:state:*:default]"}
Switch Leinwand_oben_Power "Leinwand AN/AUS" (Status){mqtt=">[broker:home/LeinwandUp/set:command:*:MAP(LEDStripEffectJSON.map)]"}
Number Leinwand_oben_FX "Leinwand Fx" (Status){mqtt=">[broker:home/LeinwandUp/set:command:*:MAP(LEDStripEffectJSON.map)]"}
Color Leinwand_oben_Color "Leinwand Farbe" <rgb> (Status)
Number Leinwand_oben_Speed "Leinwand Speed [%.0f]" (Status)
Number Leinwand_oben_Intensity "Leinwand Intensity [%d]" (Status)
my .rules:
rule “LED Strip Leinwand JSON Color”
when Item Leinwand_oben_Color received update
then Leinwand_oben.sendCommand("{“color”: {" +
"“r”: " + (Leinwand_oben_Color.state as HSBType).red + “,” +
"“g”: " + (Leinwand_oben_Color.state as HSBType).green + “,” +
"“b”: " + (Leinwand_oben_Color.state as HSBType).blue + “}}”) end
rule “LED Strip Leinwand JSON Speed”
when Item Leinwand_oben_Speed received update
then Leinwand_oben.sendCommand("{“transition”: “” + Leinwand_oben_Speed.state + “”}") end
rule “LED Strip Leinwand JSON Intensity”
when Item Leinwand_oben_Intensity received update
then Leinwand_oben.sendCommand("{“brightness”:" + Leinwand_oben_Intensity.state + “}”) end
and my sitemap part:
Frame label="Leinwand" {
Switch item=Leinwand_oben
Selection item=Leinwand_oben_FX mappings=[1="BPM",2="Noise",3="Fire",4="Rainbow",5="Twinkle",6="Glitter",7="Solid",8="Sinelon",9="Juggle",10="Confetti",11="Dots",12="Lightning",13="Candy Cane",14="Cyclon Rainbow",15="Ripple",16="Christmas Alternate",17="Police All",18="Police One",19="Random Stars",20="Sine Hue"]
Colorpicker item=Leinwand_oben_Color
Setpoint item=Leinwand_oben_Speed minValue=5 maxValue=240 step=5
Setpoint item=Leinwand_oben_Intensity minValue=0 maxValue=255 step=16
The esp is working and connecting fine so far:
11:34:03.084 ->
11:34:03.084 -> Connecting to Pinguinbau
11:34:03.704 -> …
11:34:07.500 -> WiFi connected
11:34:07.500 -> IP address:
11:34:07.500 -> 192.168.178.77
11:34:07.500 -> Ready
11:34:07.500 -> IP Address: 192.168.178.77
11:34:07.500 -> Attempting MQTT connection…connected
11:34:07.534 -> Setting LEDs:
11:34:07.534 -> r: 0, g: 0, b: 0
I checked everything twice but I dont find the problem, may you see any?
Thanks a lot!