Giter Site home page Giter Site logo

Comments (6)

tsightler avatar tsightler commented on May 24, 2024 1

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.

tsightler avatar tsightler commented on May 24, 2024

@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.

rudders avatar rudders commented on May 24, 2024

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.

tsightler avatar tsightler commented on May 24, 2024

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.

rudders avatar rudders commented on May 24, 2024

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.

tsightler avatar tsightler commented on May 24, 2024

Released 2.1.0 which has 3.3 support.

from tuya-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.