-
Platform information:
- Hardware: Raspberry Pi 3b+ Processor: BCM2835; Linux 4.19.50-v7+ armv7l
- OS: Raspbian GNU/Linux 10 (buster); Firmware #896
- Java Runtime Environment: (build 11.0.8+10-post-Raspbian-1deb10u1); Version 11.0.8" 2020-07-14
- openHAB version: 2.5.9 Release Build
-
Issue of the topic: Syntax for MQTT publish message
Dear community,
I am stuck with a MQTT item and I am sure you can help me.
I use the standard MQTT embedded broker for my openHAB setup and have the following thing via text file configured:
Bridge mqtt:systemBroker:embedded-mqtt-broker [ host="localhost", secure=false, username="NAME", password="PASSWORD"] {
Thing topic Briefkasten "Briefkasten" {
Channels:
Type switch : TelePeriod "TelePeriod" [commandTopic="cmnd/Briefkasten/TelePeriod", 300="ON", 0="OFF"]
Type switch : DeepSleep "DeepSleep" [commandTopic="cmnd/Briefkasten/DeepSleepTime",300="ON", 0="OFF"]
}
}
I want to change the TelePeriod
and the DeepSleepTimer
values via MQTT with the following items for my Tasmota device:
Switch TelePeriod "TelePeriod" {channel="mqtt:topic:embedded-mqtt-broker:Briefkasten:TelePeriod"}
Switch DeepSleep "DeepSleep" {channel="mqtt:topic:embedded-mqtt-broker:Briefkasten:DeepSleep"}
The first item for TelePeriod
does change the value sucessfully of the Tasmota device correctly when I switch on/off:
The second item, DeepSleep
, does not work. In my Tasmota log I only get “0 when I switch on/off”:
I am able to send a DeepSleepTimer value sucessfully with MQTT.fx, so in general my idea works:
2021-03-18 13:55:42,621 INFO --- PublishController : publish
2021-03-18 13:55:42,621 INFO --- MqttFX ClientModel : attempt to add PublishTopic
2021-03-18 13:55:42,622 INFO --- MqttFX ClientModel : sucessfully published message 300 to topic cmnd/Briefkasten/DeepSleepTime (QoS 0, Retained: false)
2021-03-18 13:55:42,902 INFO --- ReceivedMessagesController : TopicsCollectorService: messageArrived: topic: stat/Briefkasten/RESULT
So I guess that I need to tweak my DeepSleepTimer
channel on the Briefkasten
thing. What would be the best way to simply publish a message like
cmnd/Briefkasten/DeepSleepTime "300"
For now I just used switch item to control relais via MQTT. I am wondering why the TelePeriod
just works “out of the box”.
Thanks for your help and best regards,
Markus