OpenHAB2.5.9-1 (openHabian 1.6)
RPi 3B+
Hi,
This is my first tries in home automation. I’m trying to make it working,for 2 d3 days now. I must have reflased/reinstalled at leat 15 times in the last days, still with no success.
I have a problem with MQTT…
I am trying to configure as much as posisble via configurations files (I know… I like it the hard way!). Here is what I have configured:
I have installed mosquitto through openhabian-config, with a password
I have a static IP address on my RPi of 192.168.2.100
addons.cfg:
…
binding = mqtt, network
…
mqtt-things.things:
Bridge mqtt:broker:MQTTBroker “Mosquitto MQTT Broker” [
host=“192.168.2.100”,
secure=true,
username=“openhabian”,
password=“secretPwd”,
port=1883,
qos=0,
retain=false,
clientid=“openHAB-mqtt-bridge.things”,
keep_alive_time=30000,
reconnect_time=60000
]
Sonoffs.things:
Thing mqtt:topic:SonoffS31_FFFoyerLamp “FF Foyer Lamp” (mqtt:broker:MQTTBroker) @ “Sonoff S31” {
Channels:
Type string : reachable “Reachable” [ stateTopic=“tele/FF_Foyer_Lamp/LWT” ]
Type switch : switch “Power” [
stateTopic=“stat/FF_Foyer_Lamp/POWER”,
commandTopic=“cmnd/FF_Foyer_Lamp/power”,
ON=“ON”,
OFF=“OFF”
]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/FF_Foyer_Lamp/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
Type number : powerLoad "Instantaneous Power" [ stateTopic="tele/FF_Foyer_Lamp/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Power"]
Type number : voltage "Voltage" [ stateTopic="tele/FF_Foyer_Lamp/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Voltage"]
Type number : energyTotal "Energy Total (kWh)" [ stateTopic="tele/FF_Foyer_Lamp/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Total"]
}
MQTT server seems to be working just fine (from what I can understand), as I can see my sonoff switch in MQTT explorer (BTW… this is a must have . Awesome software), and I can interact with the switch throuogh MQTT explorer
My Problem…
i keep getting tht in the log viewer…
==> /var/log/openhab2/openhab.log <==
2020-10-17 20:31:24.673 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to ‘192.168.2.100’. Next attempt in 60000ms
2020-10-17 20:31:24.687 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘192.168.2.100’ with clientid bf018795-5cd0-469c-80c1-3a023f133057
==> /var/log/openhab2/events.log <==
2020-10-17 20:31:24.679 [hingStatusInfoChangedEvent] - ‘mqtt:broker:368MosquittoBroker’ changed from OFFLINE (COMMUNICATION_ERROR): java.io.IOException: Connection reset by peer to OFFLINE
2020-10-17 20:31:24.747 [hingStatusInfoChangedEvent] - ‘mqtt:broker:368MosquittoBroker’ changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): java.io.IOException: Connection reset by peer
and it loops, bringing the same 2 messages over and over
help me please. This really seems like an awesome programm and I can’t wait to start playing with my new toy!