Tuya MCU datapoint reporting

Hi!

I have an issue with ME81H thermostat based on Tuya MCU and ESP8266 with ESPHome flashed.

TuyaMCU of thermostat send values of some datapoints only as responce when user change them manually either from thermostat front panel, either from Home Assistant interface of Climate widget. These datapoints does not reported periodically as other datapoints.

This is related to datapoint 1 (Power Switch) and datapoint 16 (Target Temperature). Their values does not delivered into Home Assistant, so Climate widget looks like at figure attached

As you can see on the figure, “Power Switch” and “Target Temperature” are inactive, despite of their real state at thermostat.

Here is part of my configuration file with commented part of proposed solution to report “Power Switch” state when temperature reported.

tuya:
#------------------------------------
#  on_datapoint_update:
#    - sensor_datapoint: 24
#      datapoint_type: int
#      then:
#        - lambda: |-
#            tuya_tuya->send_raw_command(1, DATAPOINT_REPORT);

climate:
  platform: tuya
  name: "Room_1"
  supports_heat: true
  switch_datapoint: 1
  active_state_datapoint: 36
  active_state_heating_value: 0
  target_temperature_datapoint: 16
  current_temperature_datapoint: 24
  target_temperature_multiplier: 1.0
  current_temperature_multiplier: 0.1
  visual:
    temperature_step: 0.5 °C
    min_temperature: 10 °C
    max_temperature: 40 °C

I wonder that class Tuya does not have such public components as

  • send_raw_command();
  • get_datapoint_report(uint8_t datapoint_id).

I’m new to ESPHome and just trying to understand how to implement them.
Please give me some hints how to resolve the issue.

I have the same thermostat with esphome and it works just as weird. Registered the issue on esphome’s git Tuya ME-81H thermostat problem · Issue #3270 · esphome/issues · GitHub

I bet you’d get a quick and knowledgeable response over on the ESPHome Discord server.

Some key devs are super active and helpful over there…

Edited dead link:
Use “join the community” link here.

1 Like

Yep! Got some progress on discord. Hope will return soon with good news!
Thanks for advice :slight_smile:

@plyatov, @Mahko_Mahko
My github issue just completed and the fixes were merged into dev branch.

You can use dev branch of esphome by installing the “ESPHome (dev)” addon.

The working config for the ME-81H thermostat is

tuya:
  id: tuyamcu
  time_id: sntp_time
  status_pin: 
    number: 14
    inverted: true

climate:
  - platform: tuya
    tuya_id: tuyamcu
    name: "Warm floor"
    switch_datapoint: 1
    target_temperature_datapoint: 16
    target_temperature_multiplier: 1.0
    current_temperature_datapoint: 24
    current_temperature_multiplier: 0.1

notice the status_pin: key in tuya config, it is needed to tell thermostat that wifi is connected. More about it in my pull request Tuya status gpio support by bearpawmaxim · Pull Request #3466 · esphome/esphome · GitHub.

Also, have developed the tuya select component, that I’m using for sensor selection (floor/internal/both)

select:
  - platform: "tuya"
    tuya_id: tuyamcu
    name: "Warm floor sensor selection"
    enum_datapoint: 43
    options:
      0: Internal
      1: Floor
      2: Both
1 Like

SsieB is so damn active and helpful over there (jesserockz too).

I don’t know how they keep it up. Guns…

The link to the esphome discord server is invalid. Anyone know what the correct one is?

Try the “join the community” link from here.