- Platform information:
- Hardware: Raspberry Pi 3 Model B Plus Rev 1.3
- OS: Raspbian GNU/Linux 9 (stretch)
- Java Runtime Environment: openjdk version “1.8.0_152”
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation) - openHAB version: openHAB 2.4.0~20181018164807-1 (Build #1399)
- Issue of the topic:
I am trying to control Sonoff tasmota basic switch by openhab.
When I use following command I am able to toggle same goes for on off commands
mosquitto_pub -h 192.168.1.3 -t "cmnd/sonoff_tubelight/power" -m "toggle"
but it is not working for configured items and sitemaps.
- Items configuration related to the issue
Switch sonoff_tubelight "Hall Light" <light> (LR,gLight) { mqtt=">[broker:cmnd/sonoff_tubelight/power:command:*:default],<[broker:stat/sonoff_tubelight/power:state:default]" }
- Sitemap configuration related to the issue
sitemap home label="Auto"
{
Frame label="Hall light"
{
Switch item=sonoff_tubelight
}
}
}
- Services configuration related to the issue
Tasmota configuration
- logs
When I toggle via GUI I can below logs but nothing in [mosquitto_sub -h 192.168.1.3 -v -t “#”]
2018-10-24 00:36:23.444 [ome.event.ItemCommandEvent] - Item 'sonoff_tubelight' received command OFF
2018-10-24 00:36:23.476 [vent.ItemStateChangedEvent] - sonoff_tubelight changed from ON to OFF
2018-10-24 00:36:24.656 [ome.event.ItemCommandEvent] - Item 'sonoff_tubelight' received command ON
2018-10-24 00:36:24.679 [vent.ItemStateChangedEvent] - sonoff_tubelight changed from OFF to ON
2018-10-24 00:36:25.689 [ome.event.ItemCommandEvent] - Item 'sonoff_tubelight' received command OFF
2018-10-24 00:36:25.700 [vent.ItemStateChangedEvent] - sonoff_tubelight changed from ON to OFF
2018-10-24 00:36:26.260 [ome.event.ItemCommandEvent] - Item 'sonoff_tubelight' received command ON
2018-10-24 00:36:26.269 [vent.ItemStateChangedEvent] - sonoff_tubelight changed from OFF to ON
When I toggle via " mosquitto_pub -h 192.168.1.3 -t “cmnd/sonoff_tubelight/power” -m “toggle” but nothing in logs
cmnd/sonoff_tubelight/power toggle
stat/sonoff_tubelight/RESULT {"POWER":"OFF"}
stat/sonoff_tubelight/POWER OFF
Mosquitto Version
mosquitto --help
mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000)
mosquitto is an MQTT v3.1 broker.
cat /var/lib/openhab2/config/org/openhab/mqtt.config
broker.url="tcp://192.168.1.3:1883"
service.pid="org.openhab.mqtt"
cat /etc/openhab2/services/mqtt.cfg
#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
broker.url=tcp://192.168.1.3:1883
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
#<broker>.clientId=<clientId>
# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
#<broker>.allowLongerClientIds=false
# Optional. User id to authenticate with the broker.
#<broker>.user=<user>
# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>
# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>
# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
#<broker>.retain=<retain>
# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
#<broker>.async=<async>
# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>
I am unable to find why it is happening. Please tell me if any more logs required to identify this issue.