[SOLVED] Shelly 1 mqtt works oneway

when I set it that way nothing works, I see mqtt traffic but device does not react.

shellies/shelly1-3288D6/relay/0/command MAP(shelliesonoff.map)
shellies/shelly1-3288D6/relay/0/command MAP(shelliesonoff.map)

You may need to install the MAP transformation in the paperUI

Thank you both, I had not used MAP before so yes it was needed to be installed in paper UI, also I changed the map file and it worked, I love these little units fits in the electrical box and no need to flash tasmota.

on=ON
off=OFF
ON=on
OFF=off

1 Like

Please, which is the THING I have to specify with the Shelly?
I will configure it as a Switch

Are you using mqtt binding version 2.4 or 1.x?

1 Like

just installed 2.4
(thank you)

If you are using MQTT Binding 2.4, you don’t even need to have a MAP transform. You can define specific ON/OFF values for the Switch item type in the channel configuration.

1 Like

can I ask to show me an example
IJust defined the broker thing in file as follow

mqtt:broker:myBroker [ host="192.168.xx.xx", secure=false ]

but I’m stucked as I don’t understand how to create the needed channels type in config files

I have configured my through PaperUI, but it should work from files as well. Please use the provided example from the docs:

Bridge mqtt:broker:myUnsecureBroker [ host="192.168.0.42", secure=false ]
{
    Thing topic mything {
    Channels:
        Type switch : lamp "Kitchen Lamp" [ stateTopic="lamp/enabled", commandTopic="lamp/enabled/set" ]
        Type switch : fancylamp "Fancy Lamp" [ stateTopic="fancy/lamp/state", commandTopic="fancy/lamp/command", on="i-am-on", off="i-am-off" ]
        Type string : alarmpanel "Alarm system" [ stateTopic="alarm/panel/state", commandTopic="alarm/panel/set", allowedStates="ARMED_HOME,ARMED_AWAY,UNARMED" ]
        Type color : lampcolor "Kitchen Lamp color" [ stateTopic="lamp/color", commandTopic="lamp/color/set", rgb=true ]
        Type dimmer : blind "Blind" [ stateTopic="blind/state", commandTopic="blind/set", min=0, max=5, step=1 ]
    }
}

So the Bridge connects to your MQTT Broker, and you add Things to this bridge, which should be your MQTT devices. Channels should be the used topics in that device.

Type switch : fancylamp "Fancy Lamp" [ stateTopic="fancy/lamp/state", commandTopic="fancy/lamp/command", on="i-am-on", off="i-am-off" ]

As you can see, this is how you can add specific on off values to a switch item.

You will need on=“on”, off=“off” for Shelly devices

1 Like

Can you post a screenshot of how you configure the transformation in the channel through paperUI ?
I can’t seem to find the right syntax.

Thanks

What transformation you want to use?

Syntax is here: MQTT Things and Channels - Bindings | openHAB
Don’t use the quotes

Sure.

@vzorglub this can be a confusing I think. This is not really a transformation, it is a ‘function’ of the binding.

This is how mine looks like

Thanks, it works with your configuration !

Thanks !
I was looking how to use “incoming value transformation”, but it turned out to easier by just entering on/open and off/closed values.

I’m glad! Hope that soon Shelly add more MQTT topics to each device (like RSSI and other things).

1 Like

Hi I have the same configuration but I cant get my shelly to switch… Am I missing something. Please help :wink:
Thanks

Hi Steve_J,
you will need to post your configuration to get help.
I configured a shelly1 in OH2 lately. It was straight forward.
So it should be possible to get yours to work, too. :slight_smile:
BR
Chris

Here is what i have done

This seems the right configuration. Is the Broker online? The Thing?

Did you tested it with manually injecting messages? Download some mqtt client (like mqtt.fx) connect to the server and try to publish to the command topic (and also watch for the state topic and see that it changes when you click the switch).

1 Like

Maybe you can share some logs in addition. There might be another problem in your configuration? As rkrisi said: Do you have some other “measure points” where you can see whats going on inside? :slight_smile:
regards, Chris