I am using the shelly 1 native mqtt service, when i send on or off from openhab it works and the icon on my panel changes with it, but if i turn the shelly on or off via the attached light switch it does not get update on openhab, i can see the mqtt messages sent to the mqtt server when pressing the light switch.
shellies/shelly1-3288D6/relay/0 on
shellies/shelly1-3288D6/relay/0 off
this is my item.
//Shelly Units
Switch Shelly_1 “Shelly 1” [“Switchable”] {mqtt=">[broker:shellies/shelly1-3288D6/relay/0/command:command:on:on],>[broker:shellies/shelly1-3288D6/relay/0/command:command:off:off],<[broker:shellies/shelly1-3288D6/relay/0:state:default]"}
not sure what i have wrong on the inbound <[broker:shellies/shelly1-3288D6/relay/0:state:default]
rrichard
(Richard)
December 7, 2018, 8:30pm
2
Hello Gary,
for a Shelly 1 device with 6.3.0 Tasmota Firmware running, this is my working item in OpenHAB:
Switch Light "small Light" { mqtt=">[mqttbroker:test/switch/cmnd/Flur_Treppenlicht/POWER:command:*:default], <[mqttbroker:test/switch/stat/Flur_Treppenlicht/POWER:state:default]" }
the Shelly has these MQTT settings:
Are you using the HomeKit Binding?
Hi Richard
I am NOT using Tasmota I’m using the new Shelly firmware that has mqtt included.
Thanks for the reply.
vzorglub
(Vincent Regaud)
December 7, 2018, 10:25pm
4
According to the Sheely website your topic is correct.
You need a MAP transform to change on
to ON
and off
to OFF
Create a shelliesonoff.map file in the transform folder with the following content:
on=ON
off=OFF
ON=off
OFF=on
Your item:
Switch Shelly_1 "Shelly 1" [ "Switchable" ] { mqtt=">[broker:shellies/shelly1-3288D6/relay/0/command:command:*:MAP(shelliesonoff.map)],<[broker:shellies/shelly1-3288D6/relay/0:state:MAP(shelliesonoff.map)]" }
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)
vzorglub
(Vincent Regaud)
December 7, 2018, 11:25pm
6
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
Brignoud
(Elenio)
January 11, 2019, 2:38pm
8
Please, which is the THING I have to specify with the Shelly?
I will configure it as a Switch
H102
(CM6.5 H102)
January 11, 2019, 2:49pm
9
Are you using mqtt binding version 2.4 or 1.x?
1 Like
Brignoud
(Elenio)
January 11, 2019, 9:53pm
10
just installed 2.4
(thank you)
rkrisi
(Kristof Rado)
January 11, 2019, 9:55pm
11
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
Brignoud
(Elenio)
January 11, 2019, 10:14pm
12
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
rkrisi
(Kristof Rado)
January 11, 2019, 10:31pm
13
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
mikael
(Mikaël)
January 13, 2019, 10:42pm
14
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
vzorglub
(Vincent Regaud)
January 13, 2019, 10:54pm
15
What transformation you want to use?
Syntax is here: MQTT Things and Channels - Bindings | openHAB
Don’t use the quotes
rkrisi
(Kristof Rado)
January 14, 2019, 12:27pm
16
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
mikael
(Mikaël)
January 14, 2019, 3:46pm
17
Thanks, it works with your configuration !
mikael
(Mikaël)
January 14, 2019, 3:47pm
18
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.
rkrisi
(Kristof Rado)
January 14, 2019, 4:21pm
19
I’m glad! Hope that soon Shelly add more MQTT topics to each device (like RSSI and other things).
1 Like
Steve_J
(Steve Janzen)
March 8, 2019, 2:43pm
20
Hi I have the same configuration but I cant get my shelly to switch… Am I missing something. Please help
Thanks