- Platform information:
- Hardware: Raspberry Pi3
- OS: Docker on Raspbian
- openHAB version: OpenHab v2.4 Official docker container for arm (https://hub.docker.com/r/openhab/openhab/)
I have several Sonoff devices with the Tasmota firmware installed in my home. Before OH version 2.4 I was using the mqtt binding to control all these devices.
I need a special configuration for my corridor lights because before replacing the light switches on this area with smart ones, it was using a 3-way circuit to allow turn on/off the lights using any of the light switches in the edges of the corridor (make sense right).
After I replaced those light switched with smart ones the additional wire to implement the 3-way circuit become useless. I used the following configuration for the Corridor Light “Item” to accomplish the same behavior:
# The multiline and indentation are not in the original configuration
# but improved the readability of the configuration in here.
# This configuration was perfectly valid in OpenHab v2.3
Switch Corridor_Light "Corridor lights" <light> (Corridor) ["Lighting"] {
mqtt="
>[rpi:iot/mainentrance_lightswitch/cmnd/POWER:command:*:default],
<[rpi:iot/mainentrance_lightswitch/stat/POWER:command:default],
<[rpi:iot/mainentrance_lightswitch/tele/STATE:state:JSONPATH($.POWER)],
>[rpi:iot/kitchen_lightswitch/cmnd/POWER1:command:*:default],
<[rpi:iot/kitchen_lightswitch/stat/POWER1:command:default]"
}
With the release of OH 2.4 I had to update the configuration of my devices to use OpenHab Things instead. After you learn how “Things” works it’s obvious that it was an improvement to the previous system. But I missed something. A simple way to “synchronize” the state of two Things with a single Item.
I solved the problem writing a Rule, but I could avoid noticed that the new MQTT Generic Thing Binding hastwo configuration parameters that could potentially avoid me to use Rules to achieve the same goal. These parameters are postCommand and trigger. Sadly they were poorly documented and, due to a bug in the release 2.4 that forces me to restart the server each time I change the parameters of a Thing, I didn’t have much time to dig in how to use these options.
Do any of you have the same problem? and how did you solved it?