plyatov
(plyatov)
April 13, 2022, 8:51pm
1
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
@plyatov , @Mahko_Mahko
My github issue just completed and the fixes were merged into dev branch.
opened 07:45PM - 08 May 22 UTC
closed 08:15AM - 17 May 22 UTC
### The problem
Hi all!
Have configured tuya climate integration for ME-81H … thermostat but it behaves abnormally:
1. No datapoints reported in log after "If no further output is received, confirm that this is a supported Tuya device." message.
2. The thermostat itself does not shows the WiFi icon on the screen.
3. The time is not synchronized.
4. When turning on the thermostat, it reports it's status as OFF. After toggling the mode through HA everything becomes normal.
Despite all these errors i can control the target temperature and lock/unlock the thermostat.
Datapoint IDs are obtained from WThermostatBeca, with which it successfully worked before.
### Which version of ESPHome has the issue?
2022.4.0
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2022.5.2
### What platform are you using?
ESP8266
### Board
TYWE3S
### Component causing the issue
tuya
### Example YAML snippet
```yaml
substitutions:
device_name: warm-floor
packages:
device_common: !include .device_common.yaml
esphome:
name: ${device_name}
platform: ESP8266
board: esp01_1m
logger:
baud_rate: 0
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
tuya:
time_id: sntp_time
climate:
- platform: tuya
name: "Warm floor"
switch_datapoint: 1
target_temperature_datapoint: 16
target_temperature_multiplier: 1.0
current_temperature_datapoint: 24
current_temperature_multiplier: 0.1
switch:
- platform: "tuya"
name: "Warm floor lock"
switch_datapoint: 40
```
### Anything in the logs that might be useful for us?
```txt
INFO Reading configuration /config/esphome/warm-floor.yaml...
INFO Starting log output from warm-floor.local using esphome API
INFO Successfully connected to warm-floor.local
[22:29:35][I][app:102]: ESPHome version 2022.4.0 compiled on May 8 2022, 22:11:54
[22:29:35][C][wifi:491]: WiFi:
[22:29:35][C][wifi:353]: Local MAC: ********************
[22:29:35][C][wifi:354]: SSID: *****************
[22:29:35][C][wifi:355]: IP Address: ************
[22:29:35][C][wifi:356]: BSSID: ***************************
[22:29:35][C][wifi:358]: Hostname: 'warm-floor'
[22:29:35][C][wifi:360]: Signal strength: -61 dB ▂▄▆█
[22:29:35][C][wifi:364]: Channel: 11
[22:29:35][C][wifi:365]: Subnet: 255.255.255.0
[22:29:35][C][wifi:366]: Gateway: 192.168.1.1
[22:29:35][C][wifi:367]: DNS1: 192.168.1.1
[22:29:35][C][wifi:368]: DNS2: 0.0.0.0
[22:29:35][C][logger:233]: Logger:
[22:29:35][C][logger:234]: Level: DEBUG
[22:29:35][C][logger:235]: Log Baud Rate: 0
[22:29:35][C][logger:236]: Hardware UART: UART0
[22:29:35][C][uart.arduino_esp8266:102]: UART Bus:
[22:29:35][C][uart.arduino_esp8266:103]: TX Pin: GPIO1
[22:29:35][C][uart.arduino_esp8266:104]: RX Pin: GPIO3
[22:29:35][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[22:29:35][C][uart.arduino_esp8266:108]: Baud Rate: 9600 baud
[22:29:35][C][uart.arduino_esp8266:109]: Data Bits: 8
[22:29:35][C][uart.arduino_esp8266:110]: Parity: NONE
[22:29:35][C][uart.arduino_esp8266:111]: Stop bits: 1
[22:29:35][C][uart.arduino_esp8266:113]: Using hardware serial interface.
[22:29:35][C][uptime.sensor:031]: Uptime Sensor 'warm-floor uptime seconds'
[22:29:35][C][uptime.sensor:031]: State Class: 'total_increasing'
[22:29:35][C][uptime.sensor:031]: Unit of Measurement: 's'
[22:29:35][C][uptime.sensor:031]: Accuracy Decimals: 0
[22:29:35][C][uptime.sensor:031]: Icon: 'mdi:timer-outline'
[22:29:35][C][template.text_sensor:021]: Template Sensor 'warm-floor uptime'
[22:29:35][C][template.text_sensor:021]: Icon: 'mdi:clock-start'
[22:29:35][C][tuya.climate:140]: Tuya Climate 'Warm floor'
[22:29:35][C][tuya.climate:142]: Switch has datapoint ID 1
[22:29:35][C][tuya.climate:146]: Target Temperature has datapoint ID 16
[22:29:35][C][tuya.climate:148]: Current Temperature has datapoint ID 24
[22:29:35][C][tuya.switch:023]: Tuya Switch 'Warm floor lock'
[22:29:35][C][tuya.switch:024]: Switch has datapoint ID 40
[22:29:35][C][captive_portal:088]: Captive Portal:
[22:29:35][C][mdns:084]: mDNS:
[22:29:35][C][mdns:085]: Hostname: warm-floor
[22:29:35][C][ota:085]: Over-The-Air Updates:
[22:29:35][C][ota:086]: Address: warm-floor.local:8266
[22:29:35][C][ota:089]: Using Password.
[22:29:35][C][api:138]: API Server:
[22:29:35][C][api:139]: Address: warm-floor.local:6053
[22:29:35][C][api:143]: Using noise encryption: NO
[22:29:35][C][sntp:050]: SNTP Time:
[22:29:35][C][sntp:051]: Server 1: '0.pool.ntp.org'
[22:29:35][C][sntp:052]: Server 2: '1.pool.ntp.org'
[22:29:35][C][sntp:053]: Server 3: '2.pool.ntp.org'
[22:29:35][C][sntp:054]: Timezone: 'EET-2EEST,M3.5.0/3,M10.5.0/4'
[22:29:35][C][wifi_signal.sensor:009]: WiFi Signal 'warm-floor WiFi Signal'
[22:29:35][C][wifi_signal.sensor:009]: Device Class: 'signal_strength'
[22:29:35][C][wifi_signal.sensor:009]: State Class: 'measurement'
[22:29:35][C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm'
[22:29:35][C][wifi_signal.sensor:009]: Accuracy Decimals: 0
[22:29:35][C][tuya:028]: Tuya:
[22:29:35][C][tuya:030]: Configuration will be reported when setup is complete. Current init_state: 1
[22:29:35][C][tuya:032]: If no further output is received, confirm that this is a supported Tuya device.
[22:29:48][D][tuya:275]: Datapoint 36 update to 1
[22:29:49][D][tuya:263]: Datapoint 24 update to 220
[22:29:49][D][climate:385]: 'Warm floor' - Sending state:
[22:29:49][D][climate:388]: Mode: HEAT
[22:29:49][D][climate:390]: Action: IDLE
[22:29:49][D][climate:408]: Current Temperature: 22.00°C
[22:29:49][D][climate:414]: Target Temperature: 22.00°C
[22:29:49][D][tuya:292]: Datapoint 45 update to 00000000
[22:30:04][D][tuya:275]: Datapoint 36 update to 1
[22:30:04][D][tuya:263]: Datapoint 24 update to 220
[22:30:04][D][climate:385]: 'Warm floor' - Sending state:
[22:30:04][D][climate:388]: Mode: HEAT
[22:30:04][D][climate:390]: Action: IDLE
[22:30:04][D][climate:408]: Current Temperature: 22.00°C
[22:30:04][D][climate:414]: Target Temperature: 22.00°C
[22:30:04][D][tuya:292]: Datapoint 45 update to 00000000
[22:30:05][D][sensor:124]: 'warm-floor WiFi Signal': Sending state -57.00000 dBm with 0 decimals of accuracy
[22:30:09][D][sensor:124]: 'warm-floor uptime seconds': Sending state 1006.13300 s with 0 decimals of accuracy
```
### Additional information
_No response_
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.