Dear all,
I want to extend my bunch of Shellys via a Shelly Dimmer. I know Openhab 2.5 supports Shellies natively but - of the topic - MQTT is dramatically faster on my raspberry 4.
Regarding the topic itself:
I try to format the mqtt properly but it is not working. On top I do not see my command in MQTT.fx (even the working ones) and also openhab log just shows me the changed value of the item - so it is hard (for me) to debug.
The thing looks like this:
Thing mqtt:topic:Shelly_Kinderzimmer "Shelly Kinderzimmer" (mqtt:broker:Mosquitto) @ "MQTT" {
Channels:
Type switch : Power "Power" [ stateTopic="shellies/shellydimmer-xxxxxx/light/0", on="on", off="off", commandTopic="shellies/shellydimmer-xxxxxx/light/0/command", on="on", off="off" ]
Type dimmer : Dimmer2 "Dimmer2" [ stateTopic="shellies/shellydimmer-xxxxxx/light/0/status",transformationPattern="JSONPATH:$.brightness",commandTopic="shellies/shellydimmer-xxxxxx/light/0/set",transformationPatternOut="{turn: on, brightness: %s}"]
Type number : Number2 "Number2" [ stateTopic="shellies/shellydimmer-xxxxxx/light/0/status",transformationPattern="JSONPATH:$.brightness",commandTopic="shellies/shellydimmer-xxxxxx/light/0/set",transformationPatternOut="{\"turn\": on, \"brightness\": %s }"]
}
Items look as follows
Switch Shelly_Kinderzimmer_Dimmer2 "Kinderzimmer Dimmer" {channel="mqtt:topic:Shelly_Kinderzimmer:Dimmer2", autoupdate="false"}
Number Shelly_Kinderzimmer_Number2 "Kinderzimmer Number" {channel="mqtt:topic:Shelly_Kinderzimmer:Number2", autoupdate="false"}
When I change the name from “Dimmer2” to “Dimmer” I get the following error. Does anybody know the reason?
019-12-28 16:43:44.482 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'shelly.things' has errors, therefore ignoring it: [32,19]: missing RULE_ID at 'Dimmer'
[32,26]: mismatched input '"Dimmer2"' expecting ':'
[32,40]: missing '}' at 'stateTopic'
[32,97]: no viable alternative at input 'transformationPattern'
[32,143]: no viable alternative at input 'commandTopic'
[32,199]: no viable alternative at input 'transformationPatternOut'
[33,27]: mismatched input '"Number2"' expecting ':'
[34,1]: missing EOF at '}'
For me it feels I am doing some basics wrong.
The Shelly Dimmer MQTT docu is here: https://shelly-api-docs.shelly.cloud/#shelly-dimmer-sl-mqtt
M questions:
- Any idea why I can not call it “Dimmer” but “Dimmer2”?
- Any idea how to get it correctly working?
- Any idea how to debug MQTT properly (incl. outgoing messages)?
System:
Openhab 2.5 stable on raspberry 4.
Thanks and best
Matthias