Cannot get Tuya Integration to work

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

Huge thank you to everyone who has posted above. I bought myself one of these and following this thread has helped me to get everything set up and running in HA. I do have a couple of questions that hopefully you can help me with:

I set up the power switch, temperature scale, backlight and ringer in HA and the status is being reported. Has anyone worked out how to control these settings using HA rather than just report on them?

Once I have finished setting it up in HA (using LocalTuya) is it safe to remove it from the Smart Life app and can it be connected to the official Inkbird app instead?

Thanks

No, sorry, have not tried these. I guess the only one I would find interesting enough here would be figuring out how to calibrate the temperature offset, but I also have not looked at this yet. Since I use Homeassistant notifications I don’t really care about the built-in ringer (or backlight, for that matter) :wink:

I don’t think that´s possible, I assume it would generate a new localkey (due to the need of resetting the device) but feel free to try it out! Worst that can happen is that you have to re-integrate it back with the Tuya service again. Once you do that 4-5 times it also won’t feel as annoyingly complicated :wink:

1 Like

@Asmus is correct, if you re-pair with any of the apps (Inkbird or Tuya) then a new localkey is generated. That being said, if you use the Bluestacks approach you can pair with, and continue to use, the Inkbird Pro app which contains the same functionality as the Inkbird BBQ 4T app.

3 Likes

@jaytee @Asmus

Thanks both. It would be useful if I could get the unit to make a sound either using HA or one of the apps so I’m going to give that Bluestacks method a go using the Inkbird Pro app, thanks for your help :slight_smile:

Here are the Inkbird IBBQ-4T values I figured out while implementing via config flow if it helps anyone:

Value 1     TRUE/False      Unknown
Value 19    c/f             Farenhight/Celcius
Value 101   0-100           Battery %
Value 102   0,30,3601       Screen Timeout in seconds, (or 0 or 3601)
Value 104   True/FALSE      Mute
Value 105   0               Unknown
Value 107   7541            Probe 1 Temp
Value 108   7631            Probe 2 Temp
Value 109   7631            Probe 3 Temp
Value 110   7771            Probe 4 Temp
Value 111   0               Unknown

6 Likes

@DDomnick This is great information. I purchased the IBBQ-4BW during Prime Days and I’m now utilizing your information as the basis for my configuration.
The IBBQ-4BW has the following DPS values:

Friendly Name	  Platform	           DPS	Unit of Measure	Device Class	Scaling Factor
ibbq_power	      binary_sensor	       1		            power	
ibbq_		                           13			
ibbq_wifi_on_off  switch	           19			
ibbq_battery	  sensor	           101	%	            battery      	1
ibbq_timout		                       102			                        1
ibbq_sound	      switch	           104			
ibbq_probe_1	  sensor	           107	ºF	            temperature	    0.01
ibbq_probe_2	  sensor	           108	ºF	            temperature	    0.01
ibbq_probe_3	  sensor	           109	ºF	            temperature	    0.01
ibbq_probe_4	  sensor	           110	ºF	            temperature	    0.01
ibbq_light	      light	               111			
ibbq_wifi_signal  sensor	           112	dBm	            signal_strength	
ibbq_		                           116			
ibbq_		                           117			
ibbq_		                           118			
ibbq_		                           119			

I believe that DPS 13 is bluetooth signal but the current value is 303300608. Not sure how to setup DPS 102 in localtuya as it is the value for the light to turn off. DPS 116-119 have no current values and I haven’t been able get them to change.

1 Like

Tuya has published official Integration! Now you are welcomed to join beta test. For people who share their valuable opinions will get a bigger gift. We are delighted to get feedback from you all to provide better experience on Tuya IoT Platform.Try it now!!
Tuya Official Integration Beta Test
Tuya home-assistant integration Github Repo

Tuya has published official Integration! Now you are welcomed to join beta test.
With Tuya official Home Assistant integration, you can:

-Use Home Assistant to link up with 310,000 (Powered by Tuya) smart devices
-Develop your own driver for New device integration
-Use 1000+ APIs in Tuya cloud and voice control integration like Google Assistant and Alexa
Try it now!!
Tuya Official Integration Beta Test
Tuya home-assistant integration Github Repo

Value 111 on the iBBQ-4T is a bitmask showing which probes are connected. This is the function I use in node.js to work it out with an example:

// Determine which probes are connected
function whichProbes(decVal) {
  // 15 = no probes
  // P1/2/3/4 = 1/2/4/8
  var binVal = (15 - decVal).toString(2)
  var reverseVal = binVal.split("");
  reverseVal = reverseVal.reverse();
  return reverseVal;
}

Eg.
111 returns 3
15 - 3 = 12
12 decimal = 1100 binary
Reverse it = 0011
0011 = Probe1 off, probe2 off, probe3 on, probe4 on

Hope that helps

I can vouch for this method too. I wanted to keep using the Inkbird Pro app so went and found the last old version which kept the device key in the clear. You get a new key each time you pair, but with Bluestacks you can find the key quickly.

Great info! Thanks!

Can confirm it works great with InkBird Pro v2.8.5, BlueStacks, BSTweaker and MWT TuyaKeyExtractor for getting the localkey. (HOW TO - Get All Local Tuya Keys (ALL KEYS, SIMPLE, NO SOLDERING) - YouTube)
And you can still use the recent version of the InkBird Pro app (settings are in sync to)

InkBird Pro v2.8.5 mirror: InkBird Pro APK | APKDownload.com

2 Likes

I looked some time back for an API or a way to get the data to Node-Red/MQTT but had no success. Happily, since then I started using Home Assistant. When I searched for adding it to HA, I found this and it works! Thank you, everyone!

Thanks everyone for all the hard work and effort. Just added this to my instance and it still works. For me, I used the InkBird APK with rooted bluestacks & special thanks to LiquidBlackNL for the link – had a terrible time searching for it.
I am mirroring the apk as well now in case it gets lost to time
Google Drive Link / Mirror for InkBird version 2.8.5
Personal Website Link / Mirror for InkBird version 2.8.5

1 Like