Good evening community,
I am running an old version of openhabian with 10 Xiaomi aqara humidity sensors and two ikea tradfri outlets so far, which works nicely. Everything is connected using a CC2531 stick, zigbee2mqtt, mosquitto as the mqtt broker and a maria db for persistence. There are some rules which work and send notifications when I want them to.
A few days ago I decided to invest in a Xiaomi SRTS-A01 Thermostat, which is Zigbee capable. I successfully registered the thermostat at the coordinator. (At least I think I did. The device shows in the yaml file and I have provided a common name to it and did a restart afterwards. Since then the thermostat shows the “connected” indicator.)
I did some reading to find out how to control the device, as so far the most complicated thing was triggering one of the ikea outlets. I found out, that the thermostat can be controlled by zigbee2mqtt as described here: Xiaomi SRTS-A01 control via MQTT | Zigbee2MQTT
The message structure is like this: climate (occupied_heating_setpoint, local_temperature, system_mode, preset), sensor, calibrated, lock (state), switch (state), window_open, away_preset_temperature, voltage, battery, linkquality
However, I have trouble controlling this device. So far I cannot even get it to report its battery state, which was an easy task for the Aqara temperature sensors.
I did the following:
- I registered the device. It showed up in the file /opt/zigbee2mqtt/data/configuration.yaml.
- I gave it a friendly name and restarted the os.
- I created a new generic MQTT Thing and assigned it to my existing MQTT Bridge.
- I created a new channel in the thing and configured it based on what I have read.
- I created a new entry on my page to be able to set a temperature (with a setpoint control) and linked it to the item.
The result is: The device doesn’t react at all.
This is my thing in text:
UID: mqtt:topic:aa0181d1ad:138991ddae
label: Aqara Thermostat 1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:aa0181d1ad
location: Kinderbadezimmer
channels:
- id: Aqara_Thermostat_1_Battery
channelTypeUID: mqtt:number
label: Aquara Thermostat 1 Batteriestand
description: ""
configuration:
stateTopic: zigbee2mqtt/THERMOSTAT1
transformationPattern: JSONPATH:$.battery
unit: "%"
- id: Aqara_Thermostat_Heating_Setpoint
channelTypeUID: mqtt:number
label: Aquara Thermostat Zieltemperatur
description: ""
configuration:
postCommand: false
unit: °C
min: 5
formatBeforePublish: '{\"occupied_heating_setpoint\" : \"%s\"}'
max: 30
commandTopic: zigbee2mqtt/THERMOSTAT1/set
stateTopic: zigbee2mqtt/THERMOSTAT1/get
transformationPattern: JSONPATH:$.climate.occupied_heating_setpoint
My problem is, that (for whatever reason) I cannot use mosquitto_sub to subscribe to the topic of the thermostat, so that I can validate it is actually sending / receiving something. Whenever I try to do this the response is “Connection Refused: not authorised.”. The command I used is “sudo mosquitto_sub -v -t /#”.
From here I can go two routes:
One would involve bing lucky and having one of you reply, that she / he has already done what I am trying to do and has noticed a mistake I made.
Another would be to tackle the issue with the missing rights to subscribe to topics with mosquitto_sub. I tend to analyse the communication there first, as the issue might be related to a communication problem in the first place, which would render messing around with openhab configs useless. However, I have done quite some trial and error here and I am getting more and more frustrated.
Does anyone have an idea of what string I can pull (and how)? What could be the reson why I cannot subscribe to topics with mosquitto_sub? How can I find out?
I’d really love to know what is going wrong here. Any ideas are greatly appreciated!
Edit:
I tried to allow anonymous subscribing with mosquitto_sub, but subscribing to “/#” or “/zigbee2mqtt/#” did not print anything. As I know the communication for all my other devices is working I think what I see is not what is actually going across. Strange…
Best
Carsten
- Platform information:
- Hardware: Raspberry Pi 4B+ 8GB RAM
- OS: Openhabian 3.0.0
- Java Runtime Environment: which java platform is used and what version
- openHAB version: see above