Re: MQTT Konfiguration OH3.4.4
Verfasst: 4. Jun 2023 20:21
ja, das Testsystem starte ich gefühlt alle 5 Minuten
Code: Alles auswählen
Bridge mqtt:broker:myMQTTBroker [
host="192.168.180.30",
secure=false
]
Thing mqtt:topic:myMQTTBroker:tasmota_01 (mqtt:broker:myMQTTBroker) "" [
availabilityTopic="tele/tasmota/LWT",
payloadAvailable="Online",
payloadNotAvailable="Offline"
] {
Channels:
Type switch : PowerSwitch "Power Switch" [
stateTopic="stat/tasmota_01/POWER",
commandTopic="cmnd/tasmota_01/POWER"
]
// Sonoff Pow (read current wattage; for read and switch on-state see above)
Type number : Tasmota_01Power [
stateTopic="tele/tasmota_01/SENSOR",
transformationPattern="JSONPATH:$.ENERGY.Power"
]
}
Code: Alles auswählen
Bridge mqtt:broker:broker "MQTT Broker" [
host="192.168.180.30",
secure=false
] {
Thing topic tasmota_01 "Tasmota Steckdose 1" [
availabilityTopic="tele/tasmota/LWT",
payloadAvailable="Online",
payloadNotAvailable="Offline"
] {
Channels:
Type switch : ch1 "Schalter 1" [ stateTopic="stat/tasmota_01/POWER", commandTopic="cmnd/tasmota_01/POWER" ]
Type number : pow1 "Leistung 1" [ stateTopic="tele/tasmota_01/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Power", unit="W" ]
}
}
Code: Alles auswählen
Switch tasmota01Switch "Tasmota 1" {channel="mqtt:topic:broker:tasmota_01:ch1"}
Number:Power tasmota01Power "Tasmota 1 Power" {channel="mqtt:topic:broker:tasmota_01:pow1"}
und im events.log:2023-06-05 09:45:24.639 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '192.168.180.30'. Next attempt in 60000ms
2023-06-05 09:45:24.647 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '192.168.180.30' with clientid 6da59219-601a-42f1-a696-7f908655a1ad
2023-06-05 09:45:24.645 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker' changed from OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.180.30:1883 to OFFLINE
2023-06-05 09:45:24.704 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:broker:broker' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /192.168.180.30:1883
Code: Alles auswählen
listener 1883
allow_anonymous true
sondern so:Type switch : ch1 "Schalter 1" [ stateTopic="stat/tasmota_01/POWER", commandTopic="cmd/tasmota_01/POWER" ]
zumindest bei mir war das die Lösung für einen: Smart WIFI Socket A1T von nousType switch : ch1 "Schalter 1" [ stateTopic="stat/tasmota_01/POWER", commandTopic="tasmota_01/cmnd/POWER, on="ON", off="OFF" ]