Hi esphome community.
I have no experience in reading that kind of doc and understand nothing to it : the manual Is someone could help me ?
I have a heater (thor irp 100 wifi) with a wifi module (tywe1s). it connect to a mcu “abov mc96f6432Q” thrue rx/tx interface, as i understand on :
rx_pin: GPIO13 U1RX
tx_pin: GPIO15 U1TX
FYI the IO2 on the backof the board correspond to the U0TX tywe1s
the 0TX on the backof the board correspond to the IO1 tywe1s (question why IO1 is wired to something ??)
IO0 is grounded during boot to enable tywe1s flash mode
I flashed the esphome firmware (i had to solder directly on the tywe1s as connection on the thorben board are bad indicated as here Tuya TYWE1S flash help) and recover information in the debug console thrue homeassistant.
My code to recover datas is:
uart:
id: uart_bus
rx_pin: GPIO13
tx_pin: GPIO15
baud_rate: 9600
debug:
direction: RX
dummy_receiver: true
after:
delimiter: "\r\n"
sequence:
- lambda: |-
UARTDebug::log_string(direction, bytes);
id(power_heater_livingroom).publish_state( (float) bytes[4] );
id(temp_heater_livingroom).publish_state( ((float) bytes[69])+((float) bytes[70])/10 );
ESP_LOGD("uart debug lambda", "Response data size. %d bytes : %s", bytes.size(), bytes);
sensor:
- platform: template
id: "temp_heater_livingroom"
unit_of_measurement: "°C"
name: "Temperatura_heater_livingroom"
when i press a button on my heater it returns me that:
FA: don't know (is this the address of the master or the client ? )
46: seems to be the data length (without header and CRC)
09: don't know (really dont understand wha shoud it be)
01: 01 powered 00 switched off
00: mode (00 day, 01 temp-1, 02 temp-2, 03 night, 04 freez, 05 dont know, 06 personnal progr, 07 progr1,08 progr2, 09 progr3, 0A progr4 )
Next is the personal programation of the heater. Each set of 9 bytes is a week day and each set of 3 digit in in each day is representation of the selected mode from 00 to 04 during each hour of the day. (111 day, 110 temp-1, 100 temp-2, 001 night, 000 freez, 011 dont know, 010 dont know)
00:00:00:00:00:00:00:00:00:
00:00:00:00:00:00:00:00:00:
00:00:00:00:00:00:00:00:00:
00:00:00:00:00:00:00:00:00:
00:00:00:00:00:00:00:00:00:
00:00:00:00:00:00:00:00:00:
00:00:00:00:00:00:00:00:00:
0E: divided by 2 is the current setted base temperature in ·c (as precision is half degre )
0E: mesured temperature unit in degree ·c
05: mesured temperature decimal in degree ·c (value 00 or 05 as precision is half degree)
00: dont know (is this part of the checksum?)
6B checksum as summ in hex of all bytes mod FF
ok So i understood that the rx0/tx0 is required to flash the esp8266 and read the log
Now i want to push datas to the heater .
I haded that to my code but heater is not responding: one power button and 3 static temperature to set 7 15 and 19.
switch:
- platform: template
id: "power_heater_livingroom"
name: "Power_heater_livingroom"
turn_on_action:
- uart.write: [0xFA, 0x46, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0x00, 0x6B]
turn_off_action:
- uart.write: [0xFA, 0x46, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xFF, 0xFF, 0x00, 0x6A]
button:
- platform: template
name: "7°C_heater_livingroom"
# icon: "mdi:emoticon-outline"
on_press:
- uart.write: [0xFA, 0x46, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x59]
# id2 - target_temp_C
- platform: template
name: "15°C_heater_livingroom"
# icon: "mdi:emoticon-outline"
on_press:
- uart.write: [0xFA, 0x46, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x69]
# id2 - target_temp_C
- platform: template
name: "19°C_heater_livingroom"
# icon: "mdi:emoticon-outline"
on_press:
- uart.write: [0xFA, 0x46, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x71]
- platform: template
name: "productinf"
# icon: "mdi:emoticon-outline"
on_press:
- uart.write: [0x55, 0xAA, 0x00, 0x01, 0x00, 0x00, 0x00]