Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

gBridge and Tasmota: Action topic works, status topic does not #12

Closed
ruhrgebietler opened this issue Nov 7, 2018 · 5 comments
Closed
Assignees

Comments

@ruhrgebietler
Copy link

Hi Peter,

great work with gBridge, I really do enjoy the experience!

Here's a problem that came up when I integrated my Tasmota-enabled Sonoff S20 power plugs with gBridge. I have a similar setup as the user in #11 and my problem might also have to do with the interpretation of topics between Tasmota and gBridge.

Here's my basis setup:
Tasmota-enabled device <--MQTT-unencrypted--> Mosquitto-Bridge <--MQTT-TLS--> gBridge <---> Google Home

Setup

Here are my configs:

Tasmota

Topic = wallsocket
FullTopic = gBridge/uXX/%prefix%/%topic%/

As mentioned in #11 the prefix can be cmnd or stat and there is also the suffix POWER. Therefore, the resulting topics of my Tasmota are gBridge/uXX/cmnd/wallsocket/POWER and gBridge/uXX/stat/wallsocket/POWER as verified in the log of Tasmota and in the log of the Mosquitto bridge.

Mosquitto

connection kappelt-gbridge
address mqtt.gbridge.kappelt.net:8883
bridge_attempt_unsubscribe true
bridge_protocol_version mqttv31
cleansession true
remote_username gbridge-uXX
remote_password YYY

topic gBridge/uXX/+/+/POWER both 0 "" ""
bridge_capath /etc/ssl/certs/
bridge_tls_version tlsv1.2

Nothing spectacular here. Compared to the section on bridge configuration in the gBridge Docs I only changed the topic to match my topic format.

gBridge

Light with on/off trait
ActionTopic = gBridge/uXX/cmnd/wallsocket/POWER
StatusTopic = gBridge/uXX/stat/wallsocket/POWER

gBridge was configured to match the Tasmota topics. I hope that I interpreted it correctly that cmnd is the action topic and stat is the status topic, see https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Overview

Google Home
Has been linked with gBridge and sees the device.

Problem

The setup described above seems to work just fine. Google Home sees the device in gBridge. The bridge also works and successfully connecty the Tasmota to gBridge. I can toggle the light in the Google Home app or via voice commands.

However, Google Home always reports the light as being turned on. I can toggle it off but as soon as i close the Home app and reopen the device it is again shown as switched on. Therefore, I think the issue is with the status topic.

Possible things that could be wrong:

  • I did not define the status topic in gBridge correctly? However, after re-reading https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Overview I do think that I got it right.
  • gBridge does not interpret the result of the status topic correctly? The gBridge Docs state that for the onoff trait, the values 0, off, false, as well as 1, on, true are allowed. However, In the logs of my Tasmota it says MQT: gBridge/uXX/stat/wallsocket/POWER = OFF. I know that topics are case senstive. But are results also case-sensitive?
  • Something else entirely since I am kinda new to the the MQTT protocol.

Do you know what could be the issue? Can you suggest ways how I can better debug what went wrong?

Thanks in advance!

@peterkappelt
Copy link
Member

peterkappelt commented Nov 8, 2018

"Ruhrgebietler" hört sich Deutsch an, oder?

Yep, the values are case-sensitive. This is not an issue with MQTT itself, but with gBridge. Thats likely the issue with Tasmota.

I'm going to implement a first fix (making the values case-insensitive) this weekend.

@peterkappelt peterkappelt self-assigned this Nov 8, 2018
@ruhrgebietler
Copy link
Author

Thanks for the quick reply! I'll report back when your fix is deployed.

PS: Ja, ich bin aus dem Ruhrpott :-)

@peterkappelt
Copy link
Member

Fix is implemented, now uppercase values for the OnOff trait are supported.
Please re-open the issue if the problem persists.

@ruhrgebietler
Copy link
Author

I can report back that the issue is resolved. Much appreciated!

@kaju666
Copy link

kaju666 commented Jan 17, 2019

@peterkappelt hi
i tried with many configurations and still cant make it work :(
is ther any logs for gbridge? mosquito is connecting but its not working in goolge home, any reaction.
congig

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants