Moes BHT-002 Thermostat local control (Tuya based)

Hello Renat,
I have 7 thermostats, I have operated them with the homebridge with minimal problems (although there are some problems, of course). I could not control the thermostats in any way with homeeassistanta localtuya. I could only download tuya with adds-on and add it from there, of course, it doesn’t work like this.
How can I add tuyalan to my homeassitant? You can write starting from 0. what should I do?
Also, I need to control the thermostats on the homekit.

Hello
I have one of this thermostat, I have de local key and device_id
My thermostat is in the app Tuya
I put in HA the integration TUYA and see my thermostat , but with the temperature multiplicates X2

I put directory localtuya in custom_components and write in configuration.yaml this
But I think that the thermostat that I see in HA is other than the localtuya
What can I do for resolve it?

climate:

  • platform: localtuya
    host: 192.168.1.48
    local_key: ‘mykey’
    device_id: ‘myid’
    name: ‘moes’
    scan_interval: 5
    min_temp: 5
    max_temp: 35
    protocol_version: 3.3

Does anyone have a solution for this? I’m stuck in the same point.

Tried to flash BHT-002 series 3, BHT-002GBLW Series 3/16A- with tuya-convert. Device did not appear with the intermediate firmware. Can someone please help me since many of you have done this.

smarthack-psk.log
https://justpaste.it/4qewo

I have done so many tasmotaising using TuyaConvert or Tasmotizer (UART). So if you are an experienced HAee in that area, I can confirm that you can get one of these BHT-002 devices converted in less than 5 mins using TuyaConvert (without soldering). Of course, the special thanks goes to @fashberg. Now the device is visible and available in HA, using a few Zigbee Temperature sensors I have got around the house, I have to put a logic in place to control the heating of the whole house in a smart way :wink: . If you know where I can start (e.g. a blueprint, or example etc) that would be much appreciated in advance.

hello here.

i found good project localtuya https://github.com/rospogrigio/localtuya
at this moment localtuya doesn’t support “climate”. but exist branch with “climate” support https://github.com/rospogrigio/localtuya/tree/climate_platform . unfortunately it in development and doesn’t work for BHT-002.
i did some changes for supporting BHT-002. supporting of other climate devices may be broken. here is release https://github.com/ArtistAOP/localtuya/releases/tag/climate-v.1.1.1
it checked with my thermostat Moes BHT-002GBLW

example of installation:

PS: full instruciton of localtuya https://github.com/rospogrigio/localtuya/blob/master/README.md

full list of “dp”

  • 1 - enable-disable
  • 2 - doubled target temperature
  • 3 - doubled current temperature (internal or external sensor it regard to your settings on device)
  • 4 - 0 - auto mode; 1 - hand mode
  • 5 - eco mode
  • 6 - input blocking
  • 102 - doubled current temperature of external sensor
  • 104 - dont know. always “true” for me
12 Likes

Hey man, thanks for your climate branch of local tuya. Now I have it working locally without a problem!
So… everything is working but I’m getting this error message on the log:

2021-01-25 03:04:22 ERROR (SyncWorker_3) [homeassistant.util.json] Failed to serialize to JSON: /config/.storage/core.entity_registry. Bad data at $.data.entities[103].capabilities.hvac_modes={'auto', 'off', 'heat'}(<class 'set'>

2021-01-25 03:04:22 ERROR (MainThread) [homeassistant.helpers.storage] Error writing config for core.entity_registry: Failed to serialize to JSON: /config/.storage/core.entity_registry. Bad data at $.data.entities[103].capabilities.hvac_modes={'auto', 'off', 'heat'}(<class 'set'>

Do you have any idea what may be causing it?

Cheers and thank you again!

tnx for the report. I fix it in the new release climate-v.1.1.2. please update localtuya via HACS. restart HA. if warnings still exist you need re-add your device to HA.

1 Like

It looks like the new release fixed it. Thanks a lot!

One question, in your opinion, do you think it’s possible to check the state of when the thermostat is actually Heating?
In the tuya app, we can see when it’s actually heating. Do you think we could have this as an entity somehow?
I’m really new to the whole home assistant thing, so I cannot tell if that’s possible.

Cheers mate!

I think it impossible. no DP for this (see list above)
DP 104 is something else than “actually Heating status” - it checked by me right now.

In the tuya app, we can see when it’s actually heating

hmm. heating indicator (fire icon) in my app “Smart life” has strange behavior when current and target temperatures different for 0.5 celsius. In app icon is hidden, but actually on the thermostat display heating icon is enabled. i think that “actually Heating status” in App is a fake - simulated locally.

maybe it possible with firmware replacement. i don’t know

I see.
Thanks for the insight.
I guess you’re right about the fire icon. It may very well be simulated. At least I can reproduce it easily following that logic. Should work nicely for what I want.
Unfortunately fo me the firmware swap is beyond my skills since mine has a recent firmware. Because of that, I would need to hard mod it (soldering involved) to be able to replace it. I definitely would no go that far. =)
Thank you again for the integration development. I really appreciate it!
Cheers!

1 Like

Hey Artist,
I’ve just created a branch from your script to add “Eco Mode” Support to the home assistant interface.
It’s working great here on my Dashboard (Overview). You need to jump inside the card to change it, but works.
This is a “hard coded” preset, so to change the default value of 20 degrees Celsius, You need to change it in the Thermostat itself by accessing its Settings menu.
To get to that menu, with the Thermostat Off, press the two left buttons (squares, clock) for 5 second and go navigate (with squares) to section “B” and change from 20 to whatever desired temperature you want to set your “Eco” preset.
If you want to incorporate into any future development you can.
I’m really new to Github (this is my first branching…) I hope I didn’t screw anything from your script. xD

1 Like

Hey Artist…
Thank you very much… excellent working Good job.

Hello Mate!

Thanks for your work. I have one serious problem.

Im using local tuya for about 6 device already, the original localtuya one, if I copy your climate settings into that that is not working with the original localtuya of course, if im using your separated as you written, localtuya will be duplicated. if I delete the old one my 6 device I cannot use. Any idea for this? Thank you!!!

hi. climate-v1.1.2 is branched from the original localtuya master branch Dec 26, 2020. climate-v1.1.2 (climate-v.1.1.1 too) must work with other tuya devices in the same way as the original localtuya project.
are you trying to use climate-v1.1.2 for your other tuya devices?
unfortunately, I have only BHT-002.

I tried it 5 times on different ways to install it but if you had already localtuya it will never work. I dont know why. I change the localtuya folder inside custom_components to yours and restart HA, My LocalTuya devices are still there but if I want to add more a lot of text became unvisible and I cannot select climate, its not there.

a lot of text became unvisible

please provide console logs and screens

climate, its not there

it’s strange. is there config\custom_components\localtuya\climate.py ?
when you replace localtuya are you delete all __pycache__ in folders and subfolders and than restart HA?

also i recommend to you

  • full remove localtuya from HA
  • remove configs for old tuya devices
  • restart HA
  • make sure that no localtuya in HACS or custom_components
  • install climate-v.1.1.2
  • restart HA
  • step by step setup BHT-002
  • setup your old devices from scratch
2 Likes

Sorry I was thinking it will work without deleting all my devices, but no.

I tried the step you recommended and it was working. Im really grateful for your kind answer and Thank you very much for putting this lot of work inside this project. Its really worth it I think so, we are really happy about this! Thanks again and have a nice day my friend.

Hey Artist,

Thank you for this awesome integration, I have my thermostat working perfectly.

One question I have is can you control the schedule from HA? Original code included MQTT but I presume this doesn’t use that?

Thanks

hmm. I don’t know. I think MQTT is for the zigbee version of BHT-002.
also, you can create automation in HA to schedule thermostat temperature.