Comments (6)
BTW, I also have one more minor update that I'll push in the next day or two that provides a method of specifying the protocol version explicitly for those that do want to continue to use a specific IP. To keep the changes to a minimum I'm simply overloading the old "socket/lightbulb" topic level that is no loger used/required in the newer code base. This allows to reuse this field to specify the protocol version instead. This way it will have zero impact on existing users and be super easy for future users that don't want to or otherwise can't leverage device discovery.
from tuya-mqtt.
@TheAgentK I have coded up an attempt to implement support for 3.3 protocol using the tuyapi 5.1.1 code released a few days ago. There was a challenge in that, to use the 3.3 protocol when not leveraging auto discovery, the API requires explicitly specifying the protocol version. I wasn't really sure how to do that without changing the topic structure.
Instead, I decided to hack in device discovery support, which required minimal changes and I think is useful anyway since it allows you to specify only two items (id and key) so even if IP changes via DHCP the topics will stay consistent. To do this with minimum changes I modified the code to accept "discover" in place of the IP address. I suppose it would also be possible to use something like 0.0.0.0 or 255.255.255.255, but I wanted it to be really clear what the setting meant.
https://github.com/tsightler/tuya-mqtt
If you have other thoughts on how to implement with explicit IP I'm happy to take a stab at it. I've actually been wanting to add support for Home Assistant style MQTT discovery but to do that ideally you want to be able to provide device names so I'm thinking perhaps the best option might be a devices.json file with ID/key/IP/protocol_ver/device_name, so that might be an option, however, I wasn't sure if you were interested in such patches. I'm happy to fork a Home Assistant specific branch if not.
from tuya-mqtt.
I just gave your fork a try @tsightler and now have mqtt access to a couple of new Tuya based generic switches I purchased. Great solution until tuya-convert works with the new firmware. ESPHome would be the ideal solution but until then I might try and build a hassio add-on for it for my Home Assistant environment.
from tuya-mqtt.
Thanks for giving it a spin @rudders. It should be easy enough to make it a hassio addon. Based on what @TheAgentK wants to do I'll consider forking a hassio version and maintaining it if I go forward with the HA discovery support.
from tuya-mqtt.
I was a bit optimistic about my available time but will have a crack at some time and pull in your latest - i think this is a great solution for local tuya control for HA but I don't have the coding skills to do it properly I fear. Nice work BTW!
from tuya-mqtt.
Released 2.1.0 which has 3.3 support.
from tuya-mqtt.
Related Issues (20)
- Empty Data Returned After Publishing get-states HOT 3
- TypeError: Cannot set property 'updated' of undefined HOT 9
- Problem installing on Synology RS914 HOT 32
- Home Assistant integration how? HOT 2
- tuya-mqtt publishes states only when app is opened. HOT 22
- What mqtt broker HOT 3
- Disconnected from device and never connects again ... HOT 6
- Samples for nodejs script HOT 9
- New Maintainer Needed HOT 4
- Not sure when you went into Maintenance mode HOT 3
- Command Syntax for friendly topics HOT 3
- Setting switch state of a smart switch (custom template) HOT 11
- zombe state reconnecting issue? HOT 1
- Switch w/ Energy: DPS values reported only once at tuya-mqtt startup HOT 3
- Sudenly wrong responses from tuya device HOT 1
- tuya-mqtt not working (OpenHab) HOT 7
- Tuya bulb stopped working from tuya-cli, tuja-mqtt HOT 9
- Devices behind zigbee gateway available with tuya-cli but not tuya-mqtt HOT 1
- Different names after service restart HOT 9
- tuya-mqtt crushing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuya-mqtt.