Cannot get Tuya Integration to work

I have an Inkbird 4T which is based on Tuya, however, I cannot get it to show up in HA.

I have it setup in my TuyaSmart App and can see it fine.

I added the Tuya integration via: Configuration > + > Tuya, Added the login details

I have restarted HA but don’t see any devices, I have enabled debug logging and can see:

020-09-13 07:25:51 DEBUG (MainThread) [homeassistant.components.tuya] Pull devices from Tuya

Any tips on how i can troubleshoot this further?

Not all Tuya devices are supported by the Tuya integration.

1 Like

Thanks @francisp

Do you know if there is a way to add others or test the integration?

I was able to test the integration by adding a scene to the Tuya App and that showed up in HA.

But was not able to add the device I wanted to

FYI getting the same result with a Tuya smoke alarm, works fine in the Tuya app but nothing shown in HA. Will have to try Tuya convert I guess.

I just tried this today as well with the IBBQ-4T temp probe and got the same results. I’m assuming the issue is that the Tuya integration currently only supports climate, cover, fan, light, scene and switch. I tried adding it manually as an air conditioner to see if it would get picked up as a climate device type but still got the same results.

Did either of you ever attempt tuya convert? I’m really tempted to although I’m a bit nervous about bricking it.

I ended up using tuyapi and publishing the data to HA using MQTT. It works but it’s not straightforward… You need a process constantly running to poll the IBBQ and upload the data.

Works with Inkbird iBBQ-4T

2 Likes

My iBBQ-4T arrived today and of course I immediately tried adding it to my HA instance; could you perhaps give me a pointer on how you set yours up?

Install tuyapi to get secret key, install localtuya via hacs, then add localtuya integration.

You can look at this for lovelace and automations:

Thanks so much, I´ve now read up on setting up localtuya and how to configure the tuya iot account. :+1:
But could you perhaps also tell me which device type you used in the Tuya Smart app / the Smartlife app to add the Inkbird? Kitchen applicances -> WiFi food probe? Or did you have success with the “automatic scan”? So far I was unable to add the inkbird to either app, only the “inkbird pro” app works for me, but I don’t think I can add that to the tuya iot account. :thinking:

So just to give an update, I got everything working now, thanks @jfdgauthier :pray:

To get the Inkbird iBBQ-4T into HA I had to:

  1. Re-pair it with the “TuyaSmart” app as a “Food Probe (Wi-Fi)”, making sure not to block the device from the internet (stupid me, I really should not be working on smart devices so late at night).
  2. Follow along YouTube tutorials like this one for example on how to create a developer account at tuya and adding your device, and also watch this one on many potential issues that lie ahead
  3. Since I couldn’t get the “get device details” API to work due to my browser blocking cross-origin resource sharing I then used the tuya-api wizard, as detailed here and finally was able to get the proper local key.
  4. When adding the iBBQ-4T to localtuya, make sure to have a look back at the TuyaSmart app again, so that you can quickly understand which broadcasted ID maps to which service (i.e. “107” is the first temperature probe) and make sure to (a) add a scaling factor of 0.01 and (b) use ºF as unit_of_measurement such that HA can convert a broadcasted “8640” to 86,4ºF and then auto-convert this to 30.22ºC in the background :partying_face:
2 Likes

Hi @Asmus really useful update, any chance you could post your yaml?

Hey @jaytee, I didn’t use a manual .yaml-style entry here but rather added the device using the “config flow” approach as described here on the localtuya github page. The main advantage doing it like this was that I didn’t know beforehand which services had which “ID”, so being able to see and select e.g. “ID 107” together with a value of e.g. “8640” from a dropdown helped me to figure out which service is which.

I’d suggest you give it a try this way (config flow) and let me know whether this works for you; else I think I could also delete and re-add my device to create some screenshots for you, if needed :sweat_smile:

Also of interest: once you get everything going, I’d suggest changing the loglevel for the localtuya component as it will spam your log files whenever your thermometer is offline (which is most of the time, I suppose). This approach is documented here and you’ll likely want to set it to at least critical (i.e. use custom_components.localtuya: critical ), as it throws “ERROR” level messages whenever the device is offline.

1 Like

I stumbled across this YouTube video which uses Bluestacks and an old version of the Tuya Smart Life app to get at the keys. It avoids the need for fiddling with a Tuya account and means you can keep your devices paired with, and continue to use, the Smart Life app if you want.

Which got me thinking, maybe the Inkbird apps work the same way? Turns out they do. I found the same method works with Inkbird Pro version 2.85 (couldn’t find an old version of the dedicated BBQ4T app). So now I have my bbq data exposed in HA and I still get to use the Inkbird app (mainly as a safety net incase something goes wrong with my HA).

p.s @Asmus you’re completely right, using the “config flow” is much easier.

3 Likes

Wow thank you! What an effort (alone doing it, not talking about finding out how to do it :wink: )
Is it somehow possible though, to use the HASS integration AND the BBQ App? Would be nice to get push notifications from the App…

@Bepp Unless you find a different way to obtain the local key (as e.g. @jaytee did above using the Inkbird Pro app) you’re kind of stuck with using the “inofficial” Tuya app, in which case you’re better off just using an automation via the notify integration within Home-Assistant, like:

alias: BBQ temperature watchdog
description: 'Beef, medium rare'
trigger:
  - platform: numeric_state
    entity_id: sensor.inkbird_probe_3
    above: '54'
    for: '00:00:10'
condition: []
action:
  - service: notify.mobile_app_on_my_iphone
    data:
      title: Inkbird iBBQ
      message: >-
        The internal temperature has now reached {{ states.sensor.inkbird_probe_3.state }}ºC!

You could also create a bunch of input_texts to store the goal temperature for each sensor and pull that as the trigger value in the automation above, i.e. you could your own lovelace “frontend” for your thermometer so that you don’t have to edit the automation all the time.

I guess you’ll also want to check out how automation triggers work, such that you can use templating like:

{{ trigger.to_state.name }} too high for {{ trigger.for }}, you've ruined your steak!```

Thanks for your post with details @Asmus :slight_smile:
I had a bit of trouble figuring some things out, so here are my additions in case they help anyone.

  1. I could not get the TuyaSmart app to find my BBQ probe until I removed it from the Inkbird app (at which point the WiFi indicator started flashing and it appeared in the Tuya app).
  2. I already had 1 different device in Local Tuya in HA and thought the “Local Key” was the same for all devices, but it seems to be unique. To get mine, I used the Tuya IoT website: API Explorer > Get the user’s device list, using uid from my previous device. This showed the Local Key I needed.
    I had to redo adding to HA several times… sometimes it didn’t work: “unknown error”; it seemed (at least sometimes) that I could fix this by closing the TuyaSmart app on my phone.
  3. I only had 2 of 4 probes plugged in when I first added the device. No matter what HA restarts and device power cycles I did, I couldn’t get the other two until I removed the device completely, plugged in all 4 probes and added the device again.
  4. The IDs are fairly obvious and match the app, but there’s some there I don’t know. I added the power status, battery level and all 4 probes using Asmus’s suggestions for unit and scaling factor.
  5. When I had to re-add or modify one of the sensors, it would seem to work and then go “unavailable” in HA until I restarted. Not sure if that’s expected behaviour, but I gave it a while and it didn’t come good until restarting.

So, now I have 4 temperature probes… all in F when I want C (My general settings specify the metric system.). If I just change the unit to C, I still see the same number (in F) with a C next to it…
I spent some time trying to figure out this:

And after 3 tries of entering the ° symbol (first one copied from this post), it finally worked. I guess you really have to get the right symbol :expressionless:

Thanks! :slight_smile:

1 Like

Yeah, I definitely also got stuck at some of the points you’ve mentioned above :sweat_smile: Did you use " F " as the unit or " ºF " ? The difference is best explained in this answer, for example.

Thanks for the prompt reply! I edited my post while you were replying (and yes, that post you linked to was one helpful one I found), so you can now see I’ve solved it. The problem was the specific symbol.
° != º
(There must be an easier way.)