I have a problem with Tuya TS011F_plug_1 - it’s with original soft.
State switch is not properly working - I can get a proper state, but it seems commandTopic is not sending data.
In general - states of the rest channels are readable and properly updated.
Channel configuration:
id: state
channelTypeUID: mqtt:switch
label: state
description: null
configuration:
commandTopic: zigbee2mqtt/zigbee_gn/set/state
stateTopic: zigbee2mqtt/zigbee_gn/state
off: OFF
on: ON
We need more information. What’s in the logs? In particular errors in openhab.log and the relevant entries in events.log.
When posting code or logs, please use code fences.
```
code goes here
```
What specifically is not working? No MQTT message is sent at all? The format of the message sent is incorrect? The end device is not reading the message?
It’s another problem - I don’t see anything in logs for mqtt.
I’ve tried to set logging for all MQTT bundles to DEBUG in karaf but it’s still no info.
I have some old pax.logging file - can it cause it?
If it’s not the standard one than yes, Karaf is updating a logging config that it can’t read.
But you should at least be seeing events on the Item in events.log. You should be seeing the Things come ONLINE or go OFFLINE as they are initialized or encounter an error.
Any error should appear in the logs no matter what.
I think that I don’t have events.log enabled
When I’m checking /var/log/openhab it doesn’t exist.
It thought, everything should go to openhab.log but it seems it’s not
Edit:
I finally ‘update’ logging events
What I got
2023-02-02 18:12:10.373 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'gniazdkoSzafa' received command OFF
2023-02-02 18:12:10.375 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'gniazdkoSzafa' predicted to become OFF
2023-02-02 18:12:10.380 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'gniazdkoSzafa' changed from ON to OFF
2023-02-02 18:12:13.134 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'gniazdkoSzafa' changed from OFF to ON
Update to the latest snap 4.0.0~S3299-1 didn’t help
I’ve changed logging:
openHAB Add-ons :: Bundles :: MQTT Broker Binding
openHAB Add-ons :: Bundles :: MQTT Things and Channels
openHAB Core :: Bundles :: MQTT Transport
to DEBUG, but I still don’t see information from MQTT like:
..[mqtt.generic.AbstractMQTTThingHandler] - Successfully published value...
openhab> list | grep -i mqtt
236 x Active x 80 x 1.2.2 x hivemq-mqtt-client
267 x Active x 80 x 3.4.0.202212140352 x openHAB Add-ons :: Bundles :: MQTT Broker Binding
268 x Active x 81 x 3.4.0.202212140422 x openHAB Add-ons :: Bundles :: MQTT EspMilightHub
269 x Active x 81 x 3.4.0.202212140422 x openHAB Add-ons :: Bundles :: MQTT Things and Channels
270 x Active x 82 x 3.4.0.202212140423 x openHAB Add-ons :: Bundles :: MQTT HomeAssistant Convention
271 x Active x 82 x 3.4.0.202212140423 x openHAB Add-ons :: Bundles :: MQTT Homie Convention
290 x Active x 80 x 3.4.0.202212131823 x openHAB Core :: Bundles :: MQTT Transport
Use mosquitto_sub -u <user> -P <pwd> -v -t zigbee2mqtt/# | grep zigbee_gn to sniff relevant MQTT messages.
FWIW, the channel configuration of my TS011F_plug_1:
channels:
- id: Switch
channelTypeUID: mqtt:switch
label: Switch
description: ""
configuration:
commandTopic: zigbee2mqtt/0xa4c1387f88XXXXXX/set/state
stateTopic: zigbee2mqtt/0xa4c1387f88XXXXXX
transformationPattern: JSONPATH:$.state
- id: Power
channelTypeUID: mqtt:number
label: Power
description: ""
configuration:
stateTopic: zigbee2mqtt/0xa4c1387f88XXXXXX
transformationPattern: JSONPATH:$.power
unit: W
- id: Current
channelTypeUID: mqtt:number
label: Current
description: ""
configuration:
stateTopic: zigbee2mqtt/0xa4c1387f88XXXXXX
transformationPattern: JSONPATH:$.current
unit: A
- id: Voltage
channelTypeUID: mqtt:number
label: Voltage
description: ""
configuration:
stateTopic: zigbee2mqtt/0xa4c1387f88XXXXXX
transformationPattern: JSONPATH:$.voltage
unit: V
- id: Energy
channelTypeUID: mqtt:number
label: Energy
description: ""
configuration:
stateTopic: zigbee2mqtt/0xa4c1387f88XXXXXX
transformationPattern: JSONPATH:$.energy
unit: kWh
As I mention I couldn’t find any mqtt notifications regarding sending a message. Do I need to install any additional bundles or configure a thing ? Mosquitto bridge is rather set properly - values are readable.
Manual publishing with mosquitto_pub is working fine.
Try setting up a new minimal Thing:
Settings → Things → [+] → MQTT Binding → Generic MQTT Thing, connect it to your MQTT Bridge and add and configure an ON/OFF channel for your plug.
But you said that in an ambiguous way. You imply you’ve only tried looking at logs. I’m asking about what’s seen on the broker using MQTTExplorer or mosquitto_sub or the like.