Cannot get Tuya Integration to work

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

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