TuyaGateway v2.0 now available

This time I used the add-on, reinstalled all twice same warning… Can the fact that I’m under docker influence?

I can’t tell… are all the needed ports open? Can you connect with e.g. telnet from your docker to mqtt-broker? Did you configure the mqtt settings in both GC and TG correctly?

First step taken checked the doors both 1883 and 8111 are open

same warning

WARNING [mqtt.mqtt] () Failed to connect to MQTT Broker Setting matching query does not exist.

the addon have no setting, it takes them directly from hassio, and they work because i use it for zigbee2mqtt

I would try standing it up by itself if you have somewhere else to run it just to make sure it isn’t a problem with the addon. It should be getting the settings from HA though.

You should see something like this as almost the first line in the add-on log:

2020-07-31 17:24:22,499 INFO     (Thread-1) [tuyagateway.configure] MQTT Connection state: Connection successful for topic tuyagateway/# 

I had already tried with the normal installation and it gave me the same problem, either by installing it where I have HA, or by using a raspberry pi ZERO

[12:08:09] INFO: Start GismoCaster daemon
2020-08-02 12:08:10,359 DEBUG (Thread-1) [paho.mqtt.client] Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b’’
2020-08-02 12:08:11,173 DEBUG (Thread-1) [paho.mqtt.client] Received CONNACK (0, 0)
2020-08-02 12:08:11,173 INFO (Thread-1) [tuyagateway.configure] MQTT Connection state: Connection successful for topic tuyagateway/#
2020-08-02 12:08:11,174 DEBUG (Thread-1) [paho.mqtt.client] Sending SUBSCRIBE (d0, m1) [(b’homeassistant/#‘, 0), (b’tuyagateway/#’, 0)]
2020-08-02 12:08:11,175 DEBUG (Thread-1) [paho.mqtt.client] Received SUBACK
2020-08-02 10:08:11,303 DEBUG [asyncio] Using selector: EpollSelector
2020-08-02 10:08:11,315 WARNING [mqtt.mqtt] () Failed to connect to MQTT Broker Setting matching query does not exist.

Is it normal for SUBACK to return without codes?

My HA config:

External Url: https://xxxxxxx.duckdns.org:8123
Internal Url: http://192.168.1.xxx:8123

Anyway for completeness I have the installation of HA in docker under Debian in a NUC

what else can I check? Since the add-on takes the mqtt settings directly from the Mosquitto addon?

I’m using @sjthespian Add-on and it appears that GismoCaster loses it’s MQTT settings after the Add-on is restarted. The other settings (gizmos, models, etc) are saved, but all the MQTT settings return to default. That to be expected? Username changes back to “addon” and password is a long random string.

Have a lot if issues with it staying connected to the broker and Devices dropping offline and online rapidly. Also trying to track Energy Usage from a tuya plug, but I can’t seem to get the stats from the plug and in GismoCaster, the settings get stripped out after saving and changed to ------------. See screenshot

When monitoring mqtt though “mosquitto_sub -h localhost -u user -P pass -v -t ‘#’”, sometimes I see the state coming through twice…

tuya/xxxxxxxxxxxxxxxxxxx/1/command ON
tuya/xxxxxxxxxxxxxxxxxxx/1/state ON
tuya/xxxxxxxxxxxxxxxxxxx/1/state ON
tuya/xxxxxxxxxxxxxxxxxxx/1/command OFF
tuya/xxxxxxxxxxxxxxxxxxx/1/state OFF
tuya/xxxxxxxxxxxxxxxxxxx/1/state OFF
tuya/xxxxxxxxxxxxxxxxxxx/1/command ON
tuya/xxxxxxxxxxxxxxxxxxx/1/state ON
tuya/xxxxxxxxxxxxxxxxxxx/1/state ON
tuya/xxxxxxxxxxxxxxxxxxx/1/command OFF
tuya/xxxxxxxxxxxxxxxxxxx/1/state OFF
tuya/xxxxxxxxxxxxxxxxxxx/1/state OFF

Thanks

When I start TuyaGateway in the log of the Broker Mosquitto appears:

1596399506: New connection from 172.30.33.12 on port 1883.
1596399506: New client connected from 172.30.33.12 as auto-F5DE481D-52F4-0D74-7227-9C94E3DB9552 (p2, c1, k60, u’addons’).

The add-on is designed to be “auto-configuring”. It will automatically set both TuyaGateway and GismoCaster to use the MQTT settings from HA, or if those can’t be read, it will use the configuration from the add-on.

Are you trying to configure it to use a separate MQTT broker, or is it not setting the values properly automatically?

I’ve tried both the MQTT Broker Addon/Integration and the mqtt config in the configuration.yaml. Gismo MQTT settings keep reverting to…

gismo_mqtt

Like in the previous post from @echopage, the log shows a connection coming from the user “addons”

Also getting flooded in the mosquitto_sub with device availability offline for devices/entities that have been deleted in HA and in GismoCaster. << Reinstalling the MQTT Broker Addon fixed this

Those look like the values that are coming from the HA itself. If you’re running mosquitto HA is passing those values to the startups script for the add-on and they are being used to configure both the TuyaGateway and the GismoCaster.

Is there some reason you don’t want to use those? What MQTT broker are you using? I can add an “override” setting that will force it to use the settings in the TuyaGateway add-on configuration tab, but I’m not clear on why you don’t want to use the ones that are auto-configured by HA.

I’m using the Mosquito Broker from the Supervisor > Official Add-on store. I’m not sure where the username “addons” is coming from. I configured a different username and pass in the Mosquito Broker. I have no preference to how the TuyaGateway & GismoCaster get their MQTT config, the way you have it setup seems like it should be the easiest. It just felt like that might have been the cause of some of my issues since some of them seemed to go away, at least for a little while, once I updated the MQTT Settings in GismoCaster to match what I configured in the Mosquito Broker. So, the Configuration under the Tuya Gateway addon has no affect?

Anyone know if there’s a detailed guide to GismoCaster? The only thing I’ve been able to get to work decently is a single smart plug without Energy Monitoring.

You do not have to configure anything if you have installed the official Supervisor Addon neither in the Addon or in GismoCaster. It should configure everything by itself.

About the GismoCaster Guide, currently there is no real documentation but you can read this thread carefully and discover everything by yourself. You just have to figure out the DP keys from your tuya device, how you do that was mentioned in a thread earlier.
Or just use the TuyaAPI: https://github.com/TuyaAPI/cli
It can discover everything you need :slight_smile:

The way the add-on is currently written, if you have Mosquitto installed there is no way to override the automatically configured MQTT settings. If HA gives it a username/password/host/port it uses those instead of what is on the configuration page. That’s why the username is “addon”.

However, you shouldn’t need to set anything as those are generated by HA so should work for connecting both TuyaGateway and GismoCaster to MQTT.

I have all the DP Keys that I pulled from a Rooted Android device. I have also used the localtuya add-on from here… (Tuya LOCAL with energy monitoring and without tuya-convert)

Problem I’m having with it is once I got to about 10-15 devices added, turning devices on and off would randomly take 10-20 seconds or just timeout. Started getting errors in the logs that it was having issues communicating with devices. But if I only had around 5 devices connected through localtuya, the same devices that were having issue started working properly.

Can you post some logs of that on https://github.com/TradeFace/tuyagateway/issues. I did testing with about 25 switches, switching them all at once without problems. Local tuya has several problems. For 1 it uses pytuya which uses a slow poll to get status updates from the devices (e.g. manual handling)

Finally Hallelujia, uninstalled Mosquitto e TuyaGateway, reinstalled et volià Gismocaster start!

Now the fun begins, insert the sockets, the sockets with energy usage, the water sensor, the smoke sensor …

2 Likes

gismocaster is giving me wrong username and password after I have restarted add-on

edit: it works fine, I just need to wait to clear all the error by it self.

For those who had troubles logging in with admin:admin into GismoCaster once installed the addon, you might need to re-initialize the DB, this is not handled too well by the run.sh of the addon, so in such case you should delete the /web/var/db dir (inside the container) to make it reinit.

Great work. I installed the add-on en the GismoCaster website 1.0.1 is up and running.
I also have the keys of my tuya vacuum (thanks to the site mentioned in this topic)

but I struggle with adding it in the gismocaster.
I think I need screens or a video to watch what kind of data is expected because I don’t understand it 100% :stuck_out_tongue: maybe a little to technical for me.

Installed TuyaGateway and GismoCaster via HA supervisor. Install seems fine. Unable to login to GismoCaster with admin:admin.

Several others note this issue, fix is unclear to me.

Thanks