TuyaGateway v2.0 now available

Ok let’s start from the beginning because I don’t take my legs off … I have Hassio installed on NUC under docker, I have the possibility to install Tuyagateway on both NUC and Raspberry. In the first case do I have to install it under docker? In the second one, can I install it “normally”? I add the procedure should this be?

  1. Tuyagateway installation
  2. Modify tuyagateway.conf file with MQTT parameters
  3. Gismocaster installation
  4. Gismocaster setup
    Sorry for the confusion

TuyaGateway and Gismocaster don’t have to be installed in a docker environment. They just require python 3.6 and should be able to communicate to your mqtt broker. The mqtt broker acts as a message-bus between TuyaGateway / Gismocaster / Home Assistant

Nothing when logging in to gismocaster I enter admin: admin and stop, gives me user error

  1. Installed rasberry pi OS on a Raspberry pi Zero
  2. installed Python 3.6
  3. Installed TuyaGateway
  4. Modified tuyagateway.conf (Hassio IP and MQTT user and password)
  5. Installed Gismocaster
  6. added PATH (/home/pi/.locla/bin) to OS
  7. started webserver
  8. admin:admin
  9. error: Please enter the correct username and password for a staff account. Note that both fields may be case-sensitive.

Hey,

Sorry for asking but I don’t really know how the DP Keys (Numbers) are working?
How do I know for which data set I need which key ? I mean Key 1 is for Switching and state of the switch ?? This is what I tried and it seemed to work but how do I get measurments or current power usage ? Are the keys different for each tuya device? I don’t see through D:

Did you run make for gismocaster?

make does the following actions:

    pip3 install -r requirements.txt
	python3 web/manage.py migrate	
	python3 web/manage.py loaddata component topic template topicvalue componentvalue setting
	python3 web/manage.py createsuperuser --username admin --password admin --email [email protected]
	python3 web/manage.py collectstatic

Plz make sure they all exit correctly.

1st key is usually on/off. Other keys are device dependent. Check ha mqtt discovery documentation to see the options for the component type.

No after
python3 web/manage.py migrate
DEBUG [asyncio] Using selector: Epollselector
WARNING [mqtt.mqtt] () Failed to connect to MQTT broker…

Successfully installed apps in docker. Big thank for it, I should buy you a coffee :slight_smile:
Gonna test it next week, so a quick howto ‘Working with Gismo’ will be appreciated.

So you cant really discover the keys you need ? It is kinda try and error or am I wrong ^^

For some devices it is. Some tuya devices don’t return a proper status. But the most will return the status (which holds the available dp keys). TuyaGateway will return all found dp keys to mqtt. See https://github.com/tradeface/tuyagateway/wiki/MQTT-Topics

Ok thanks :slight_smile:

Ehm and I discovered something else. If I change the name of a gismo the old MQTT Retain Message wont gets removed but a new one gets added. So how do I remove the old one in MQTT ?

Fixed it: Just deleted the database file ^^

I have both tuyagateway and gismocaster up and running and (I think) properly communicating with my mqtt broker on HA. But I’m not clear on where to go from here.

For a use case, I have a box of new Tuya lightbulbs that are too new to use tuya-convert on. Where do I go from here? I can put the lamps in discovery mode easily enough, but how do I get them added to tuyagateway? As I understand these lamps, I have to go through some sort of pairing process in order to get them configured on my wifi network. Do I have to pair them with the SmartApp so I can get them on my network and then somehow get the IDs from that before deleting them from the app?

Then I assume I will have to go through the process of creating gizmos and dps in GizmoCaster. Are there any tips on doing that and figuring out the dps? In this case these are RGBWW lamps, the aren’t all that useful with just a single “light on/off” DP.

I really like the idea of this app, but the docs seem to be lacking in anything on getting started beyond getting them up and running in the first place (and there’s an issue with gizmocaster in docker, I opened an issue on that).

1 Like

Hi also i have the same problem, i have hassio under docker on a debian distro in a NUC, and it gives me the same error. Zigbee2Mqtt and Mqtt talks correctly, but tuyagateway / gismocaster, just can’t talk …

In the development branch a some of these issues have been solved. I still need to test it, before it can be merged in to master. You could try cloning that version.

BTW the 1000 of lines of errors are failed connection tries to your mqtt broker. Because the connection settings aren’t setup correctly yet at that point. This is not an issue for correct installation.

Heyy am I doing something wrong while installing it as Service? (sudo make install)

@tuyagateway:~/gismocaster$ systemctl status gismocaster.service
● gismocaster.service - MQTT Devices
   Loaded: error (Reason: Exec format error)
   Active: inactive (dead)

Jul 30 23:43:24 tuyagateway systemd[1]: /etc/systemd/system/gismocaster.service:7: Working directory path '' is not absolute.
Jul 30 23:44:29 tuyagateway systemd[1]: /etc/systemd/system/gismocaster.service:7: Working directory path '' is not absolute.
Jul 30 23:44:53 tuyagateway systemd[1]: /etc/systemd/system/gismocaster.service:7: Working directory path '' is not absolute.

FYI, I’m working on an addon for this, I may have something that can be manually installed today or tomorrow…

Yes I know and I’m looking forward to it :smiley: Already asked a question on github under your post ^^

I can’t tell what went wrong based on that error. As the error mentions the path isn’t set correctly. Pls check if /etc/systemd/system/gismocaster.service line 7 holds the correct path.

Yeah now I get another error. The working directory path was empty.

kevin@tuyagateway:~$ systemctl status gismocaster.service
● gismocaster.service - MQTT Devices
   Loaded: loaded (/etc/systemd/system/gismocaster.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-07-31 00:32:42 CEST; 8s ago
  Process: 2011 ExecStart=/usr/bin/python3 web/manage.py runserver --noreload (code=exited, status=1/FAILURE)
 Main PID: 2011 (code=exited, status=1/FAILURE)

Jul 31 00:32:42 tuyagateway systemd[1]: gismocaster.service: Service hold-off time over, scheduling restart.
Jul 31 00:32:42 tuyagateway systemd[1]: gismocaster.service: Scheduled restart job, restart counter is at 5.
Jul 31 00:32:42 tuyagateway systemd[1]: Stopped MQTT Devices.
Jul 31 00:32:42 tuyagateway systemd[1]: gismocaster.service: Start request repeated too quickly.
Jul 31 00:32:42 tuyagateway systemd[1]: gismocaster.service: Failed with result 'exit-code'.
Jul 31 00:32:42 tuyagateway systemd[1]: Failed to start MQTT Devices.

Fixed it, changed a few thing (IP, User and WorkingDirectory)

Unit]
Description=MQTT Devices
After=network.target

[Service]
ExecStart=/usr/bin/python3 web/manage.py runserver 192.168.178.59:8000 --noreload
WorkingDirectory=/home/kevin/gismocaster
StandardOutput=inherit
StandardError=inherit
Restart=always
User=kevin

[Install]
WantedBy=multi-user.target

Okay, on which OS are you running? Bit strange the path wasn’t filled.