Thing: Shelly via MQTT

Tags: #<Tag:0x00007f2fafec11a8>

You don’t have an Item named ShellyBuero
Check spelling, uppercase etc. against your xxx.items file
Look in your openhab.log at boot time for entry
- Loading model 'xxx.items'

OK, 1 step further.

2019-08-17 13:49:04.870 [ome.event.ItemCommandEvent] - Item 'shellybuero' received command ON 2019-08-17 13:49:04.877 [nt.ItemStatePredictedEvent] - shellybuero predicted to become NULL 2019-08-17 13:49:05.945 [ome.event.ItemCommandEvent] - Item 'shellybuero' received command OFF 2019-08-17 13:49:05.956 [nt.ItemStatePredictedEvent] - shellybuero predicted to become NULL 2019-08-17 13:49:28.347 [ome.event.ItemCommandEvent] - Item 'shellybuero' received command ON 2019-08-17 13:49:28.355 [nt.ItemStatePredictedEvent] - shellybuero predicted to become NULL 2019-08-17 13:49:29.366 [ome.event.ItemCommandEvent] - Item 'shellybuero' received command OFF 2019-08-17 13:49:29.379 [nt.ItemStatePredictedEvent] - shellybuero predicted to become NULL 2019-08-17 13:49:30.019 [ome.event.ItemCommandEvent] - Item 'shellybuero' received command ON 2019-08-17 13:49:30.026 [nt.ItemStatePredictedEvent] - shellybuero predicted to become NULL 2019-08-17 13:49:30.644 [ome.event.ItemCommandEvent] - Item 'shellybuero' received command OFF 2019-08-17 13:49:30.652 [nt.ItemStatePredictedEvent] - shellybuero predicted to become NULL

But i’m not reading any messages in MQTT.fx and the shelly is not switching.

after saving the things file again i got:

2019-08-17 14:05:39.651 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'shelly.things' has errors, therefore ignoring it: [1,17]: missing EOF at ':'

shelly.things:
Thing topic mqtt:broker:mqttbroker:shellybuero "ShellyBuero" { Channels: Type switch : power "Licht" [ stateTopic="shellies/shelly1-5548C3/relay/0", on="on", off="off", commandTopic="shellies/shelly1-5548C3/relay/0/command"] }

1,17 is the first :

Is your other things file with the broker bridge loading ok?

I’ve put both into one file.

mqtt.things:
Bridge mqtt:broker:embedded-mqtt-broker “MQTT Bridge”
[
host=“127.0.0.1”,
port=1883,
secure=“AUTO”
]

{
Thing topic shellybuero "BüroLicht " {
Channels:
Type switch : ShellyBueroLicht “Büro Licht” [stateTopic=“shellies/shelly1-5548C3/relay/0”, commandTopic=“shellies/shelly1-5548C3/relay/0/command”, on=“on”, off=“off”]
}
}

2019-08-17 14:38:24.101 [me.event.ThingUpdatedEvent] - Thing ‘mqtt:topic:embedded-mqtt-broker:shellybuero’ has been updated.

Yes, when you split your things files you must add an extra parameter to give it clue about which broker to use, in round brackets.

for some reason it is still not switching.

shelly.items:
Switch ShellyBueroLicht “ShellyBueroLicht” [ “Licht” ] { channel=“mqtt:broker:embedded-mqtt-broker:shellybuero:ShellyBueroLicht” }

i think it has something to do with the channel definition. But i don’t how it should look like.

Yep, your channel is
mqtt:topic:embedded-mqtt-broker:ShellyBeuroLicht
I reckon.

You can examine your topic thing in PaperUI to see what it is called.

Not working with this settings.

in PaperUI the mqtt broker has no channels at all.

You need to look into your generic mqtt thing named “shellybuero”!

found it.

used

mqtt:topic:embedded-mqtt-broker:shellybuero:ShellyBueroLicht

which was written below the label for the thing.
still not switching.

Do you see any messages on your mqtt.fx when trying to switch from openHAB?
If not, your openhab instance migth not be connected to the broker you are looking onto with mqtt.fx.

I don’t see any messages in mqtt.fx when switching with open hab.
when i switch using the web interface of the shelly and being connected to the mqtt broker on open hab i see messages.

With what credentials do you connect to the mqtt brooker on mqtt.fx and what for openHAB?
Are these really the same?

In the examples above you seem to have an openhab embedded broker and another one running.

I don’t use credentials.

How can i check if i have 2 brokers running?

I have a Shelly 2.5. The problem with shelly was that shelly sends out “off” or “on” while OH only accept commons ON en OFF.

What I did was in PaperUi add a Thing [MQTT binding]- Generic MQTT Thing.
Then (…Add thing en show thing) I added a channel (ON/OFF switch).

Please state all actual settings and status of your Broker-Thing as can be sen on PaperUI.

This is more off an example. The issue here is to fill in as above in Custom on/Open value “on” and Custom Off/Closed off.
@denkteich Perhaps you can check to Büro thing channel for these values. I see now that @rlkoshak gave the same advices. If doubt in having two MQTT brokers:
It is a fact that installed de embedded broker. You can check for mosquito in a terminal.
image
I’ve installed Mosquitto as you can.
I don’t if you already tried to send actual on en off through MQTT.fx.


If your shelly reacts then your broker is okee.

Found a solution, thx for all the hints.

I really had 2 brokers.
One setup via a things file another automatically discovered via paperui sitting in the paperui inbox.

I started from scratch again and will use the following process:

  • Setup Shelly MQTT Thing and Channels using PaperUI
  • Setup Items using items files for more flexibility

thx
for the help

I guess you are talking here about a Broker-Things (the bridge to the mqtt broker) and not the actual mqtt broker!