I have checked and re checked. Read and re read the tasmota wiki. Run any of these commands in the Sonoff web log (ip address of sonoff/cs) to glean info that might help. Edited my items file 100 times. tested connections between OH and Mosquitto, used MQTTlens and client-tools to verify connections.
The light WILL NOT TURN ON!!!
Mosquitto and MQTTlens receive status updates from the Sonoff subscribed to:
mosquitto_sub -h localhost -t ‘diana/cord1/#’ -v and diana/cord1/# - respectively
lights.items
Switch Cord1 "Trav's-lamp" { mqtt=">[mosquitto:cmnd/diana/cord1/POWER:command:*:default], <[mosquitto:stat/diana/cord1/POWER:state:default]" }
mosquitto.conf
pid_file /var/run/lib/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
connection_messages true
allow_anonymous true
mqtt.cfg
mosquitto.url=tcp://localhost:1883
mosquitto.clientId=openhabian
mosquitto.qos=1
mosquitto.retain=true
mosquitto.async=false
Sonoff settings
Host (domus1)
192.168.1.200
Port (1883)
1883
Client Id (DVES_970D9F)
Cord1
User (DVES_USER)
openhabian
Password
•
Topic = %topic% (sonoff)
cord1
Full Topic (%prefix%/%topic%/)
diana/cord1/
the sonoff web log
00:00:00 APP: Project sonoff Cord1 (Topic cord1, Fallback Cord1, GroupTopic sonoffs) Version 5.5.2
00:00:00 Wifi: Connecting to AP1 Travalon in mode 11N as Cord1...
00:00:04 Wifi: Connected
00:00:04 HTTP: Webserver active on Cord1 with IP address 192.168.1.202
00:00:04 UPnP: Multicast (re)joined
00:00:06 MQTT: Attempting connection...
08:02:15 MQTT: Connected
08:02:15 MQTT: diana/cord1/LWT = Online (retained)
08:02:15 MQTT: diana/cord1/cmnd/POWER =
08:02:15 MQTT: diana/cord1/INFO1 = {"Module":"Sonoff Basic", "Version":"5.5.2", "FallbackTopic":"Cord1", "GroupTopic":"sonoffs"}
08:02:15 MQTT: diana/cord1/INFO2 = {"WebserverMode":"Admin", "Hostname":"Cord1", "IPaddress":"192.168.1.202"}
08:02:15 MQTT: diana/cord1/INFO3 = {"Started":"Software/System restart"}
08:02:16 MQTT: diana/cord1/UPTIME = {"Time":"2017-08-20T08:02:16", "Uptime":1}
08:02:16 UPnP: Multicast (re)joined
08:02:17 MQTT: diana/cord1/RESULT = {"POWER":"OFF"}
08:02:17 MQTT: diana/cord1/POWER = OFF
08:02:24 MQTT: diana/cord1/STATE = {"Time":"2017-08-20T08:02:24", "Uptime":1, "Vcc":3.251, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"Travalon", "RSSI":100, "APMac":"30:5A:3A:A0:4A:18"}}
08:07:24 MQTT: diana/cord1/STATE = {"Time":"2017-08-20T08:07:24", "Uptime":1, "Vcc":3.248, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"Travalon", "RSSI":100, "APMac":"30:5A:3A:A0:4A:18"}}
#If I type power on or off in the web log console, below is the result in the web logs.
08:08:40 CMND: power on
08:08:40 MQTT: diana/cord1/RESULT = {"POWER":"ON"}
08:08:40 MQTT: diana/cord1/POWER = ON
08:08:46 CMND: power off
08:08:47 MQTT: diana/cord1/RESULT = {"POWER":"OFF"}
08:08:47 MQTT: diana/cord1/POWER = OFF
and results for for same commands
openhabian@openHABianPi:/etc/mosquitto$ mosquitto_sub -h localhost -t 'diana/cord1/#' -v
diana/cord1/LWT Online
diana/cord1/STATE {"Time":"2017-08-20T08:02:24", "Uptime":1, "Vcc":3.251, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"Travalon", "RSSI":100, "APMac":"30:5A:3A:A0:4A:18"}}
diana/cord1/STATE {"Time":"2017-08-20T08:07:24", "Uptime":1, "Vcc":3.248, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"Travalon", "RSSI":100, "APMac":"30:5A:3A:A0:4A:18"}}
diana/cord1/RESULT {"POWER":"ON"}
diana/cord1/POWER ON
diana/cord1/RESULT {"POWER":"OFF"}
diana/cord1/POWER OFF
if I toggle from an alternate automation solution UI i get:
:/etc/mosquitto$ mosquitto_sub -h localhost -t 'diana/cord1/#' -v
diana/cord1/STATE {"Time":"2017-08-20T08:12:24", "Uptime":1, "Vcc":3.250, "POWER":"OFF", "Wifi":{"AP":1, "SSID":"Travalon", "RSSI":100, "APMac":"30:5A:3A:A0:4A:18"}}
diana/cord1/power off
diana/cord1/power on
diana/cord1/power off
diana/cord1/power on
If I toggle from HABpanel I get nothing.
All this tells me OH connects to Mosquitto
[02:33:10] openhabian@openHABianPi:/etc/mosquitto$ mosquitto_sub -u openhab -P habopen -t openhab/#
ON
As well as my other clients, HA, MQTTlens, client-tools on different machines.
Mosquitto receives publications, (not from HABpanel) and passes them on.
Except TO the Sonoff.
An excerpt from Tasmotas MQTT features page:
Sonoff responds to the following MQTT commands using MQTT Topic for cmnd/sonoff/<command> and MQTT Message/Payload for <parameter>:
The relay can be controlled with cmnd/sonoff/power on, cmnd/sonoff/power off or cmnd/sonoff/power toggle. Sonoff will send a MQTT status message like stat/sonoff/POWER ON.
The power state message can be sent with the retain flag set. Enable this with cmnd/sonoff/PowerRetain on.
PLEASE…what am I missing?