I try to get work my new Shelly Plus H&T with Openhab. Because the old Shelly binding failed to communicate with the device (the whole time in sleep mode) and the new Shelly binding is failed to install i decided to give a try to the MQTT.
I newer worked with MQTT before. I installed the Binding. Made a mqqt.things file, where i wrote:
Bridge mqtt:broker:mosquitto [ host="192.168.100.111",port="1883", secure=false ]
{
Thing topic PlusHT1 "PlusHT1" {
Channels:
Type number : S_PlHT1_Batt "Shelly Plus HT1 Battery" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/devicepower:0", transformationPattern="JSONPATH:$.battery.percent"]
Type number : S_PlHT1_Humi "Shelly Plus HT1 Humidity" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/humidity:0", transformationPattern="JSONPATH:$.rh"]
Type number : S_PlHT1_Temp "Shelly Plus HT1 Temperatur" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/temperature:0", transformationPattern="JSONPATH:$.tC"]
Type number : S_PlHT1_rssi "Shelly Plus HT1 RSSI" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/wifi", transformationPattern="JSONPATH:$.rssi"]
}
Bridge mqtt:broker:mosquitto [ host="localhost",secure=false, username="XXXXX", password="XXXXXXXXXXXXXXXXX" ]{
Thing topic ShellyPlusHT "Shelly Plus H&T" {
Channels:
Type number : ShellyPlusHT_Battery "Shelly Plus HT1 Battery" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/devicepower:0", transformationPattern="JSONPATH:$.battery.percent"]
Type number : ShellyPlusHT_Humidity "Shelly Plus HT1 Humidity" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/humidity:0", transformationPattern="JSONPATH:$.rh"]
Type number : ShellyPlusHT_Temperature "Shelly Plus HT1 Temperatur" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/temperature:0", transformationPattern="JSONPATH:$.tC"]
Type number : ShellyPlusHT_RSSI "Shelly Plus HT1 RSSI" [ stateTopic="shellyplusht-7c87ce6bd1b0/status/wifi", transformationPattern="JSONPATH:$.rssi"]
}
}
mqtt.items
Group:Number:SUM ShellyPlusHT "Shelly Plus H&T Bedroom (MQTT)" <settings> ["Sensor"]
Number ShellyPlusHT_Humidity "Bedroom MQTT Humidity [%.0f %%]" <humidity> (ShellyPlusHT) ["Humidity","Measurement"] { channel="mqtt:topic:mosquitto:ShellyPlusHT:ShellyPlusHT_Humidity" }
Number ShellyPlusHT_Temperature "Bedroom MQTT Temperatur [%.1f]" <temperature> (ShellyPlusHT) ["Temperature","Measurement"] { channel="mqtt:topic:mosquitto:ShellyPlusHT:ShellyPlusHT_Temperature" }
Number ShellyPlusHT_RSSI "Bedroom MQTT rssi [%.0f]" <cwifi> (ShellyPlusHT) ["Frequency"] { channel="mqtt:topic:mosquitto:ShellyPlusHT:ShellyPlusHT_RSSI" }
Number ShellyPlusHT_Battery "Bedroom MQTT Battery [%.0f %%]" <batterylevel> (ShellyPlusHT) ["Battery","Measurement"] { channel="mqtt:topic:mosquitto:ShellyPlusHT:ShellyPlusHT_Battery" }