mpol
(Mike Polinowski)
December 12, 2019, 10:06am
1
Hi OpenHAB Forum,
I am currently trying to set up a MQTT switch through the Paper UI (OH2.5) and I have the problem that I can update the command topic and switch my device, but I don’t receive an update through the state topic when I send the command from a different program:
I have a state/topic
and command/topic
and the payload {"val":"1"}
or {"val":"0"}
. When I update the command topic to 0, I can see the state topic update to 0 shortly afterwards. But the switch on the paper UI does not reflect this change.
I added the JSONPATH transformation later for incoming messages - as I thought the switch might need the 1/0 value directly. But so far no success.
Does someone have an idea what I am doing wrong?
regards
Mike
vzorglub
(Vincent Regaud)
December 12, 2019, 10:17am
2
Turn the binding and debug mode and show the log when your send a payload on this topic from another MQTT client
@mpol
Are you using 2.5RC1? If so there is a problem with the MQTT
Thanks @rkrisi I missed that bit (jetlag and system upgrade not good idea). Full steps in one place to help others given MQTT is used so much now. (updated with improved karaf command)
sudo systemctl stop openhab2
sudo sudo openhab-cli clean-cache
sudo systemctl start openhab2
Confirmed here that MQTT state updates now failing.
Open the Karaf console:
openhab-cli console
bundle:update org.openhab.core.io.transport.mqtt https://janessa.me/esh/org.openhab.core.io.transport.mqtt-2.5.0-fs.jar
l…
2 Likes
mpol
(Mike Polinowski)
December 12, 2019, 11:16am
4
Thank your for your replies vzorglub and David!
This solved my issue - it works now
pi@raspberrypi:/var/log/openhab2 $ dpkg --list | grep openhab
ii openhab2 2.5.0~RC1-1 all openhab2
pi@raspberrypi:/var/log/openhab2 $ openhab-cli console
Logging in as openhab
Password:
__ _____ ____
____ ____ ___ ____ / / / / | / __ )
/ __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __ |
/ /_/ / /_/ / __/ / / / __ / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/ |_/_____/
/_/ 2.5.0.RC1
Milestone Build
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.
openhab> bundle:update org.openhab.core.io.transport.mqtt https://janessa.me/esh/org.openhab.core.io.transport.mqtt-2.5.0-fs.jar
openhab> logout
pi@raspberrypi:/var/log/openhab2 $ sudo systemctl restart openhab2
pi@raspberrypi:/var/log/openhab2 $ sudo systemctl status openhab2
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-12-12 11:10:45 GMT; 17s ago
Docs: https://www.openhab.org/docs/
https://community.openhab.org
Main PID: 3240 (java)
Tasks: 29 (limit: 2200)
Memory: 78.1M
CGroup: /system.slice/openhab2.service
└─3240 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openha
Dec 12 11:10:45 raspberrypi systemd[1]: Started openHAB 2 - empowering the smart home.
lines 1-12/12 (END)
Rajiv_Dey
(Rajiv Dey)
December 23, 2020, 5:40pm
5
I am facing the same issue with a switch in papeUI in openhab3 I could not find a solution can you explain what solved the issue
mpol
(Mike Polinowski)
December 23, 2020, 8:26pm
6
Hi @Rajiv_Dey
I tested the latest version of the OH3 docker container today and the MQTT binding worked perfectly.
I created an MQTT Thing and added a channel:
Choose an ON/OFF Switch:
And added the STATE and COMMAND topic:
Linked to an item it worked right away.