- Platform information:
- Hardware: RaspberryPi 3B+, Aeon labs Z-Stick Gen 5
- OS: openhabian 1.4.1-454
- Java Runtime Environment: openjdk 1.8.0_152
- openHAB version: 2.5.0 Build #1533
I have spent whole day yesterday going through various post forums and documentation, but most of the information found related to the old MQTT binding. I did found the post explaining how to migrate the 1.x configs to 2.4 and build my configs accordingly, but was only able to get it partially working.
My goal is to have z-wave items state changes posted to mqtt.
Here is how I’ve set it all up
mqtt.things
Bridge mqtt:broker:cloudmqttSecure [ host="mXX.cloudmqtt.com", port=XXXXX , secure=true, qos=0, clientID="malinka", retainMessages=true, certificatepin=true, publickeypin=true ,username="xxxxxxx", password="xxxxxxxxxxx" ]
{
Thing topic wejscie "MQTT drzwi wejściowe" {
Channels:
Type contact : drzwi "Otwarcie drzwi" [stateTopic="wejscie/drzwi", commandTopic="wejscie/drzwi/status", on="OPEN", off="CLOSED", retained="true"]
Type number : temperatura "Aktualna temperatura" [stateTopic="wejscie/temperatura", commandTopic="wejscie/temperatura/status", retained="true"]
Type number : bateria "Poziom baterii" [stateTopic="wejscie/bateria", commandTopic="wejscie/bateria/status", retained="true"]
}
Thing topic sypialnia "MQTT drzwi sypialnia" {
Channels:
Type contact : drzwi "Otwarcie drzwi" [stateTopic="sypialnia/drzwi", commandTopic="sypialnia/drzwi/status", on="OPEN", off="CLOSED", retained="true"]
Type number : temperatura "Aktualna temperatura" [stateTopic="sypialnia/temperatura",commandTopic="sypialnia/temperatura/status", retained="true"]
Type number : bateria "Poziom baterii" [stateTopic="sypialnia/bateria", commandTopic="sypialnia/bateria/status", retained="true"]
}
Thing topic wlacznik "MQTT włącznik korytarz" {
Channels:
Type switch : schody "oświetlenie schodów" [stateTopic="wlacznik/schody", commandTopic="wlacznik/schody/status", retained="true"]
Type switch : korytarz "oświetlenie korytarza" [stateTopic="wlacznik/korytarz", commandTopic="wlacznik/korytarz/status", retained="true"]
Type switch : wszystkie "wszystkie światła" [stateTopic="wlacznik/wszystkie", commandTopic="wlacznik/wszystkie/status", retained="true"]
}
}
and here are my home.items
// general wrapper
Group House "Dom" <house>
// location context
Group Locations "pomieszczenia" (House)
Group Entrance "drzwi wejściowe" <groundfloor> (Locations)
Contact SENS_ENTR_OPEN "czujnik otwarcia drzwi" (Entrance,DoorStatuses) {channel="zwave:device:d22b75a6:node3:sensor_door", channel="mqtt:topic:cloudmqttSecure:wejscie:drzwi"}
Number:Temperature SENS_ENTR_TEMP "czujnik temperatury [%.1f °C]" (Entrance,Temperatures) {channel="zwave:device:d22b75a6:node3:sensor_temperature", channel="mqtt:topic:cloudmqttSecure:wejscie:temperatura"}
Number SENS_ENTR_BATT "poziom baterii [%d %%]" (Entrance,BatteryLevels) {channel="zwave:device:d22b75a6:node3:battery-level", channel="mqtt:topic:cloudmqttSecure:wejscie:bateria"}
Group Bedroom "sypialnie" <door> (Locations)
Contact SENS_BR_OPEN "czujnik otwarcia drzwi" (Bedroom,DoorStatuses) {channel="zwave:device:d22b75a6:node2:sensor_door", channel="mqtt:topic:cloudmqttSecure:sypialnia:drzwi"}
Number:Temperature SENS_BR_TEMP "czujnik temperatury [%.1f °C]" (Bedroom,Temperatures) {channel="zwave:device:d22b75a6:node2:sensor_temperature", channel="mqtt:topic:cloudmqttSecure:sypialnia:temperatura"}
Number SENS_BR_BATT "poziom baterii [%d %%]" (Bedroom,BatteryLevels) {channel="zwave:device:d22b75a6:node2:battery-level", channel="mqtt:topic:cloudmqttSecure:sypialnia:bateria"}
Group Corridor "korytarz" <corridor> (Locations)
Switch SW_COR_COR "włącznik korytarz" (Corridor) {channel="zwave:device:d22b75a6:node5:switch_binary1", channel="mqtt:topic:cloudmqttSecure:wlacznik:korytarz"}
Switch SW_COR_SC "włącznik schody" (Corridor) {channel="zwave:device:d22b75a6:node5:switch_binary2", channel="mqtt:topic:cloudmqttSecure:wlacznik:schody"}
Switch SW_COR_MAIN "włącznik (wszystkie)" (Corridor) {channel="zwave:device:d22b75a6:node5:switch_binary", channel="mqtt:topic:cloudmqttSecure:wlacznik:wszystkie"}
// functional context
Group Sensors "zbiór wszystkich czujników" (House)
Group Temperatures "czujniki temperatur" <temperature> (Sensors)
Group BatteryLevels "poziomy baterii" <batterylevel> (Sensors)
my problem with this config is:
- if I toggle the light switch via openhab, the mqtt updates (which is what I expect it to)
- if I press the light switch (physically), the mqtt does not update
- no sensor update is sent to mqtt (door open/close, temperature, battery)
- if i change the light switch value via mqtt, openhab dashboard changes the light switch state, but the light does not go on.
I did a lot of digging, but since I got it partially working, I must be missing something. Could anyone point me in the right direction here?
bindings version for Z-Wave and MQTT are 2.5.0-snapshot (updated yesterday)