Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya MCU addition #4

Open
jazzmonger opened this issue Nov 11, 2022 · 0 comments
Open

Tuya MCU addition #4

jazzmonger opened this issue Nov 11, 2022 · 0 comments

Comments

@jazzmonger
Copy link

jazzmonger commented Nov 11, 2022

I finally was able to flash my Tuya based wood stove w/ ESPHome and I'm RID of Tuya Cloud. I now have the Tuya MCU component working in ESPHome. That means the device spits out "datapoints" and ESPHome exposes them. I'd like to use your thermostat as it appears it would support modes and ECO settings, but don't know how to control the "heater" as TUYA MCU takes a service request to turn it on and off... ie: Climate: Turn on/off.

Also, my stove has "Data Points". how would I reference them in your add-on?

# Enable logging
logger:
  level: DEBUG
  baud_rate: 0
uart:
  rx_pin: GPIO13
  tx_pin: GPIO15
  baud_rate: 9600
# Register the Tuya MCU connection
tuya:
# 1 - Power on (Heat)
#4 - Mode P1/P2/P3P4
#101 - ECO1/ECO2
#104 - Error Code
#106 Set Temp
#107 - Current Temp
#108 - Pipe Temp
#109 - Protect Temp

climate:
  - platform: tuya
    name: " Shop Test Pellet Stove ESPHome"
    switch_datapoint: 1
    target_temperature_datapoint: 106
    current_temperature_datapoint: 107
    eco_datapoint: 101

Active Attributes I see in dev tools for
[climate.shop_test_pellet_stove_esphome]. These change and update correctly when I push buttons on the stove control panel. The high temps are due to a mixup in F/C, which I also don't know how to fix... other than creating a template sensor that converts C to F.

hvac_modes: off, heat
min_temp: 50
max_temp: 86
target_temp_step: 0.1
preset_modes: none, eco
current_temperature: 163.4
temperature: 147.2
hvac_action: off
preset_mode: eco
friendly_name:  Shop Test Pellet Stove ESPHome
supported_features: 17

Log output from ESPHome:

[17:22:20][C][mdns:100]: mDNS:
[17:22:20][C][mdns:101]: Hostname: test-wood-pellet-stove
[17:22:20][C][ota:089]: Over-The-Air Updates:
[17:22:20][C][ota:090]: Address: 192.168.1.165:8266
[17:22:20][C][api:138]: API Server:
[17:22:20][C][api:139]: Address: 192.168.1.165:6053
[17:22:20][C][api:143]: Using noise encryption: NO
[17:22:20][C][tuya:033]: Tuya:
[17:22:20][C][tuya:048]: Datapoint 1: switch (value: OFF)
[17:22:20][C][tuya:054]: Datapoint 105: enum (value: 0)
[17:22:20][C][tuya:054]: Datapoint 4: enum (value: 0)
[17:22:20][C][tuya:054]: Datapoint 101: enum (value: 0)
[17:22:20][C][tuya:050]: Datapoint 106: int value (value: 66)
[17:22:20][C][tuya:050]: Datapoint 107: int value (value: 72)
[17:22:20][C][tuya:050]: Datapoint 108: int value (value: 394)
[17:22:20][C][tuya:050]: Datapoint 109: int value (value: 104)
[17:22:20][C][tuya:056]: Datapoint 104: bitmask (value: 4)
[17:22:20][C][tuya:062]: GPIO Configuration: status: pin 5, reset: pin 0
[17:22:20][C][tuya:068]: Product: '{"p":"8Dj5zVjGqPSXaUgf","v":"1.0.0","m":0}'
[17:22:24][D][tuya:280]: Datapoint 1 update to OFF
[17:22:25][D][tuya:300]: Datapoint 105 update to 0
[17:22:25][D][tuya:300]: Datapoint 4 update to 0
[17:22:25][D][tuya:300]: Datapoint 101 update to 0
[17:22:25][D][tuya:288]: Datapoint 106 update to 66
[17:22:25][D][tuya:288]: Datapoint 107 update to 72
[17:22:25][D][tuya:288]: Datapoint 108 update to 394
[17:22:25][D][tuya:288]: Datapoint 109 update to 104
[17:22:25][D][tuya:317]: Datapoint 104 update to 0X000004

My datapoint mappings are:
1 - Power on (Heat)
4 - Mode P1/P2/P3P4
101 - ECO1/ECO2
104 - Error Code
106 Set Temp
107 - Current Temp
108 - Pipe Temp
109 - Protect Temp

looking at the log and changing values on the front panel, I get:
dp#4 Mode P1-P4
P1= 0
P2= 1
P3= 2
P4 = 3

dp#101 = ECO mode
ECO1 = 0
ECO2 = 1

Error Codes will be a bit trickier to figure all of them out, but heres what I can find now on the bench:
Datapoint 104 update to 00000000 -> no error, normal operation
Datapoint 104 update to 0X000004 - Esc1, Short in temp sensor 1
Datapoint 104 update to 0X000008 -> Eso1, Open in temp sensor 1
Datapoint 104 update to 0X000001 -< Esc2, Short in temp sensor 2

Datapoint 104 update to 0X000008 -> Eso2 Open in temp sensor 2
Datapoint 104 update to 0X000020 ->Eso3 Open in Room Temp Sensor rospogrigio/localtuya#3

ANY Help here would be MUCH appreciated. I've been battling this wood stove for almost 2 years and I'm finally seeing some progress. - Jeff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant