After more than a year, I finally have a newly flashed tuya esp module TYWE1S in my pellet stove. It’s working, But the values are all wrong. My device is set for F, and the room temp is actually 60 degrees F, but the log shows it as deg C. target temp is also incorrect.
home assistant thinks the values are coming to it in C and then its converting those values to deg F … I have the target temp set for 60F, not 140F.
60F = 140C
Here’s what’s being reported in the esphome device log:
[21:34:23][D][tuya:280]: Datapoint 1 update to OFF
[21:34:23][D][climate:385]: ' Shop Test Pellet Stove ESPHome' - Sending state:
[21:34:23][D][climate:388]: Mode: OFF
[21:34:23][D][climate:390]: Action: OFF
[21:34:23][D][climate:408]: Current Temperature: 64.00°C << --- it's F, not C!!
[21:34:23][D][climate:414]: Target Temperature: 29.00°C. << --- it's F, not C!!
My ESPHome config file for the stove module contains this:
climate:
- platform: tuya
name: " Shop Test Pellet Stove ESPHome"
switch_datapoint: 1
target_temperature_datapoint: 106
current_temperature_datapoint: 107
And what the sensors report:
Is there a temperature units definition I need somewhere??
Any pointers appreciated.
Brute force method does work, but there has to be an easier way…
In my sensors.yaml file I put this:
- platform: template
sensors:
current_temperature:
friendly_name: "shop test current temp converted"
entity_id: climate.shop_test_pellet_stove_esphome
unit_of_measurement: "°F"
value_template: "{{float(state_attr('climate.shop_test_pellet_stove_esphome','current_temperature')-32)*5/9}}"
Anyone have any ideas?
I’ve tried… I get compile errors no matter which one I use.
climate:
- platform: tuya
name: " Shop Test Pellet Stove ESPHome"
unit_of_measurement: "°F"
switch_datapoint: 1
target_temperature_datapoint: 106
# filters:
# - lambda: return current_temperature_datapoint * (9.0/5.0) + 32.0;
# unit_of_measurement: "°F"
climate.tuya: [source /config/esphome/test-wood-pellet-stove.yaml:29]
platform: tuya
name: Shop Test Pellet Stove ESPHome
[unit_of_measurement] is an invalid option for [climate.tuya]. Please check the indentation.
unit_of_measurement: °F
switch_datapoint: 1
target_temperature_datapoint: 106
Any pointers on where to put it correctly?
Have you tried using the multipiers in the tuya climate:
EDIT: scrap that, you can’t just multiply to get from F to C
Can you post your whole esphome config ?
Yup. You can’t use formulas in the current_temperature_multiplier
Here’s the whole file
esphome:
name: test-wood-pellet-stove
esp8266:
board: esp01_1m
# 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"
# unit_of_measurement: "°F"
switch_datapoint: 1
target_temperature_datapoint: 106
current_temperature_datapoint: 107
api:
ota:
wifi:
ssid: "Shop Wifi"
password: "xxxxx"
power_save_mode: none
# ...
manual_ip:
# Set this to the IP of the ESP
static_ip: 192.168.1.165
# Set this to the IP address of the router. Often ends with .1
gateway: 192.168.1.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
dns1: 8.8.8.8
# Enable Home Assistant API
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test-Wood-Pellet-Stove"
password: "Xxxx"
captive_portal:
I’m sooo close!!
Turns out it was a bug/feature in the Tuya code, they cant decide which… So, this is now in my config file:
external_components:
- source: github://pr#4032
components: tuya
refresh: 0s
climate:
- platform: tuya
reports_fahrenheit: true <<---this is NEW
name: "House Wood Pellet Stove"
switch_datapoint: 1
target_temperature_datapoint: 106
current_temperature_datapoint: 107
And now all is good w/ the world.