Topic consolidation

HI all,

New to the family and as such I am going over old post to try and educate myself before posting new questions.

My smart home started buy buying various products from a number of suppliers in Australia which I used the app from each respective manufacturer. Then I grew impatient with what I could do with the cloud solutions available and how I needed a spaghetti field of sites to try and make a solution.

So I found openhab and started my journey and then found that my current smart home gadgets are all white label Tuya. Awesome, dump the individual vendor systems and merge all of my gadgets into one with Tuya, so I have a quick win. So now I have one app controlling my legacy devices.

However that now leaves OpenHab and Tuya, So I started searching that topic and it is as we have all found a rabbit warren of information. Even in our community here topics are started and automatically closed. So what we have is no consolidation of Tuya topics. Given Tuya is a large white label producer it would be nice to know how many people are migrating from Tuya to OH.

Eventually I would like to change everything over from cloud to local control for when we have no internet, however why bite off more than I can chew when I am learning the OH framework.

I feel your pain, but consolidating topics is tricky. A lot of the conversations span months or even years, and the people involved come and go. The best-managed topics are when one person (often a binding developer) maintains an ongoing thread to discuss it.

This is compounded by people not bothering to search the community before posting anew. So, I commend you for wanting to catch up before posting questions that have been asked.

With all this in mind, don’t fear to ask questions that have been asked before. All that we ask is for people to show that they’ve made a reasonable effort. So, make it clear that you’ve looked through the documentation and tried a few different searches, and give more detail rather than less.

Now, Tuya is particularly tricky, because there are multiple ways to tackle it. Moreover, since there’s no binding at this time, there’s no documentation that collects all of the information into one place. I’m hopeful that a developer will eventually take it on, but that’s the nature of volunteerism.

Flashing Tasmota was a popular way of gaining direct control over Tuya devices, as you could often do it over WiFi with Tuya-convert. However, Tuya started releasing firmware in 2019 that prevents over-the-air flashing, and in 2020 started using non-ESP8266 chips that aren’t compatible with Tasmota at all.

If your older Tuyas haven’t had firmware updates then you might be able to flash them over the air, but it’ll probably be a mixed bag. You can also open up your devices and try to flash them over USB, but that’s more challenging. I tried it on one device, but then I remembered that I hate soldering.

You’re probably better off trying one of the other methods that goes through Tuya’s cloud, since it will cover all of your stuff in one go. Whatever the case, you’ll also need to figure out how MQTT works.

Here’s a recent tutorial that should be generally applicable for Tuya devices. I haven’t tried it, but I bookmarked it in case I ever decide to try it with my one Tuya device that couldn’t be flashed with Tasmota.


1 Like

:joy: Its like forcing kids to eat vegetables

Hi Tara welcome to openHAB I to am from Australia and have an allergy to the cloud.

How I do it is flash the device with TASMOTA depending on the device this can mean opening it up and using a flashing device to install software.

Here is me telling the Kogan kettle to behave

With any control system you are limited by how the TUYA vendor allows you to access the device. They are designed for people to use with their apps and not really dev friendly which is why TASMOTA was born.

I wonder if you add tuya devices to google home and then you could link the same item in openHAB.

Do you want to try linking through the cloud or just reprogram devices?
What devices do you have?

Note from TUYA MQTT Developer

!!! Important Note !!!

This project is currently in maintainance mode. No further enhancements to this project are planned and will not be planned for the future unless someone out there is interested in becoming the new > maintainer. Please do not open issues to request new features, new device support, etc, as they will likely be closed with no comment. I will try to support existing functionality, but even this will likely be on a very limited basis. If you are interested in maintaining this project, please post here.

I have decided to step away from this project as I’ve made the personal decision to rid myself of any Tuya Wifi based devices (I’m down to only 4 at this point, and they are all easy to replace or at least flash with Tasmota). This decision was made due to the fact that Tuya continues to make it more and more difficult to control their devices locally. While I don’t blame them for this, these devices were only interesting to me because of this local control and thus I can no longer meet my personal goals with Tuya devices (at least the Wifi ones) so I will no longer be purchasing/using them going forward.

1 Like

Thank you for your feedback. I was happy to get them all on one app so that was a big start.

I asked Another question on the forum about network ping issues which then helped make sense of the things page. So after watching more youtube videos I now have a test page that is monitoring the core network assets at home and the network latency to our ISP.

Covid has put a lot of pressure on our home network when my wife moved her professional office to our home from her employers office and with her recent promotion to management level the pressure is on me to keep the network up and stable.

As we say in the IT world, my hello world OH2 project is now complete, now time to get my hands dirty.

1 Like

:rofl: :rofl: :rofl:
omg that is funny

or Alexa
my one tuya device (actually two spot light bulbs) was found by Alexa and then can be controlled with openHAB but requires cloud (obviously)

thank you, yes I have linked my Tuya instance with Google and Alexa, yes I have both because well I like having options.

OK what tuya devices I have, wifi lights, smart plugs and a few IR sensors.

My long term goal is to replace a lot of the smart technology I now use with single board processes so I will have complete control over the code. So I will probably just flash an ardiuno clone or a wemos board, because well that is easier than ripping something apart.

It really depends on the device and what you are controlling. I fine it easer to disassemble things and reprogram. Some you can just hold while programming and others need soldering.

I have reprogramed

and other mirabella devices.

Tasmota Documentation - Tasmota Is a good 3rd party software

Tasmota Supported Devices Repository is a good resource to determine compatibility

1 Like

Thanks, my eventual aim is to do a lot more myself. Another project I am working on is building my CNC laser/router from a cheap kit. So I have added switches all over it and wrote custom software for an arduino clone to monitor the hardware and give feedback to the CNC control board.

I have a demo wemos talking to my mosquitto server and that is working well, so I am now getting OH2 to chat to my wemos via mqtt.

I used to work as a mainframe computer operator in banks and government.

I will have fun reading over the documentation.

I also purchased some of my hardware from KMart.

Is this done through the Google Device Access Console? I haven’t been paying attention to that discussion so I don’t know how far it’s progressed.

1 Like

I have a CNC router too
K6100A with servo motor

I work on this boring stuff [Intralogistics] GENI-belt cross-belt sorter - YouTube

It sounds to me like you have all of the necessary skills to do it all on your own. I recommend Hacking pre built devices as it takes alot less time and you will have more time for other projects.

Here is my reasoning for this.

For my fans I use a
Cost was $30 au each
I (electrician) installed them behind blank wall plate $5
I use double sided tape to attach remote to wall plate for local control
Install time and programming with tasmota about 1hr

I integrated it into openHAB using my usual method of VSCode remote SSH in to edit config files.

Thing creation

Bridge mqtt:broker:myMQTTBroker [ host ="", secure =false, username ="let", password ="me in" , clientID ="myMQTTClient" ]
    Thing topic fan1 "Dining FAN" [ availabilityTopic="IFANdining/tele/LWT", payloadAvailable="Online", payloadNotAvailable="Offline"] {
        Type switch : Power1   "Dining Light "  [ stateTopic = "IFANdining/stat/POWER", commandTopic = "IFANdining/cmnd/POWER", on="ON", off="OFF" ]
        Type dimmer : fanspeed "Fan Speed"      [ stateTopic = "IFANdining/stat/FANSPEED", transformationPattern = "JSONPATH:$.FanSpeed", commandTopic ="IFANdining/cmnd/FANSPEED", 0="OFF", 1="LOW", 2="MED", 3="HIGH", 2=100  ]


Switch Dining_light "Dining Light" { ga="Light", channel="mqtt:topic:myMQTTBroker:fan1:Power1" }
Dimmer Dining_fan "Dining Fan" { ga="Fan" [ speeds="0=off:zero,1=slow:low:one:on,2=medium:two,3=high:three:100", lang="en", ordered=true, roomHint="Dining" ], channel="mqtt:topic:myMQTTBroker:fan1:fanspeed" }

Rule to set default ON command to 1

rule "Dining Fan on"
  Item Dining_fan received command ON

Because I have Google Home connected to the openHAB cloud connector I can say “Hey google turn the dining fan to high”

You already have some devices that can be hacked to do exactly what you want if you need any help either config base or UI programming let us know.

1 Like

I have been following along on this discussion as well. I don’t have any non hacked devices to test with However with short cuts you may be able to link devices. I was wondering if using the same name would link the items together.

1 Like

I just caught up on the thread, and it’s limited to Google/Nest devices (not including the Nest Protect). So, I don’t think there’s an avenue to share devices from Google Home to openHAB, as is the case with Alexa.

I’m actually tempted to get an Echo Flex just to mess around with this. Is there noticeable lag when you control your bulbs? I know that the reporting to openHAB is slow due to the 10-minute polling period, but that doesn’t really matter if you just want to send commands to devices.

I assume that it has to go through Amazon’s cloud, but that’s no worse than going through Tuya’s cloud.

I have been in the industry since 1985 when I started as a dispatch clerk for National Australia Bank and then worked my way up.

A lot of what is driving my desire is that we are reinventing our business and looking to use automation to take over repetitive or manual task. So my first project is the CNC because I bought a very basic unit to get my fingers wet and now I have added automation so I can run the CNC remotely. That is after I load the material I can go to another room and control the device from there.

So OpenHab is going to give me a good framework for automation going forward and I have a Wemos D1 Mini on my desk running sample code that is talking to my MQTT broker so next is to complete the connection to OH.

I have merged all of my legacy gear into the Tuya app which has given me so much more flexibility over the devices and had my fixed line to the internet repaired. It had a rusty connection in the pit outside of our house.

So going forward, ideally I would like to include my Tuya devices in OpenHab, however if it does not happen then I am not going to be upset because I will replace a lot of that technology with technology that I have built inhouse. So a lot of the lighting will be replaced with low voltage DC lighting.

As for my legacy gear, it will just be used to fill gaps on occasions were I need to switch mains current for a special project.

So at the moment my OH installation is polling the 4 access points in our house and our upstream ISP. It is also giving me the latency on our upstream connection. So for me, network monitoring project, ticked.

What CNC do you have? I was looking for something to play with.
I did CNC years ago and worked for Comeng and made the XPT trains in NSW. Those CNC were 24 meters long! Probably don’t need a CNC that big nowdays. :slight_smile:
I also have Tuya devices but I managed to flash those with Tasmota before Tuya screwed down the OTA process.
All my devices are controlled locally and I don’t have anything relying on the internet.

I have a 2418 CNC however this is the next model up and what I would buy if I a 3018 from Banggood or any other supplier

This will give you an idea of what I have, my bed is a bit smaller.

Here is my CNC

and the control boards

Oh and I so have travelled on those XPT trains to many times to count. My first project to move offline will be my desk lighting. That will be my hello world project.

What is totally funny is how far Google is behind Amazon when it comes to the smart home industry. I started with Google because we use Google cloud services to run our business. However I purchased am Amazon Dot and that opened my eyes to how far ahead Amazon is.

Amazon website needs a lot of improvement however Google does not even have a website for its home projects. If Google has they have not made it easy to find like Amazon.

Do you know who we really need on this project, Andrew Tridgell, yes the legend himself who packet sniffed Microsoft’s protocols to reverse engineer microsoft file sharing and develop Samba.

So if all else fails we just need someone two is a legend at pulling data streams apart.

I have seen Andrew talk at a few meetings I attended, he has a way with words. Yes I am an Andrew Groupie.

1 Like

I now have OH2 talking to my wemos via MQTT in a bidirectional way. Totally happy camper,

I still have some way to go in learning about OH, however I have hit my first milestone.

1 Like

The issue with TUYA is that they change the goal posts and want total control through their api. All data to turn your lights on and off goes through China. I decided to keep it all on my local LAN.

You have MQTT to openHAB sorted however if you need help or reprogramming the TUYA stuff to something else let me know.

Some good points, I will gradually migrate my stuff off cloud based technology to local devices. I do not need to change my wifi config once it is set because every new access point has my standard setup.

We have having a bit of a debate in Australia about renewables and coal power, I am in the home solar PV camp so there has been a push to tax us to export to the grid. So given how fragile our grid is I am happy to play the long game and just rebuild all of my technology so it runs local off my network.

So when I have a fibre internet connection to my house then that will really push me to go off grid.

I think our best hope is that Matter takes off as a standard. That’s the only proposed standard right now that has the backing of Amazon, Apple, Google and the Zigbee Alliance (among others). My hope is that manufacturers will move to support that since it theoretically will give them seamless integration with HomeKit, Alexa and Google right out of the box.

As for reverse engineering the protocols, the world has moved on quite a bit since the days when Samba was developed. Even the cheapest of Chinese manufactures will use off the shelf end-to-end encryption that will make just looking at the packets insufficient. And if they are not using such encryption, you probably don’t want to be using those devices anyway.