Berg Glass Panel Heater (TUYA) flash to TASMOTA - full process

Note: I’m updating this post as I fix everything. I still need to fix this:

  • The MQTT Thermostat config isn’t completed
  • No temperature slide or buttons on the Tasmota GUI (don’t know how to do it)

I have flashed TASMOTA on this BERG Heater:

The process should be valid for other similar product, I’m pretty sure, especially for the ones that use the following CHIP: TYWE1S that is an ESP8266 with 2MB flash.

To replace the Tuya firmware open the device (it’s super easy) - the board is the one with the buttons, just remove the screws and the cable (from the other end, the one connected to the relays board. See the following pictures:

You need to use 5 Pins, as per the diagrams above, UOTX, I00, 3V3, UORX and GND, I have soldered pins to do the connection:

Connect the pins to the programmer.

To Backup Current firmware:

  • Connect I00 to GND
  • Connect programmer to USB
  • Start command

I used esptool:

esptool -p PORT -b 460800 read_flash 0 0x200000 flash_contents.bin

esptool -p esptool -p /dev/ttyUSB0 -b 460800 read_flash 0 0x200000 berg_tuya_original.bin

To put the ESP8266 into Programming Mode:

  • Disconnect serial-to-USB adapter and power
  • Connect GP IO0 and GND
  • Connect the serial-to-USB adapter to your computer
  • Flash Tasmota with tasmotizer

Tasmota Configuration

I create this template based on a similar device:

{"NAME":"Berg Panel Heater","GPIO":[0,0,0,0,0,0,0,0,0,108,0,107,0],"FLAG":0,"BASE":54}

Rules to get statuses and to send commands:

rule1
  on tuyareceived#dptype2id4 do publish tele/%topic%/currenttemp %value% endon
  on tuyareceived#dptype1id1 do publish stat/%topic%/active %value% endon
  on tuyareceived#dptype2id3 do publish stat/%topic%/targettemp %value% endon
  on event#settemperature do tuyasend3 21,%value% endon
  on event#settemperature do publish stat/%topic%/targettemp %value% endon
  on power1#state=1 do serialsend5 55aa0001000000 endon
  on mqtt#connected do serialsend5 55aa0001000000 endon

Explanation of the rules:

For example, the rule:

on tuyareceived#dptype2id4 do publish tele/%topic%/currenttemp %value% endon

Publish a MQTT topic with the current temperature, see the logs:

18:44:54.932 DMP: 55 AA 03 07 00 05 07 04 00 01 00 1A
18:44:54.938 MQT: tele/panel_heater_office/RESULT = {"TuyaReceived":{"Data":"55AA0307000507040001001A","Cmnd":7,"CmndData":"0704000100","DpType4Id7":0,"7":{"DpId":7,"DpIdType":4,"DpIdData":"00"}}}
18:44:54.954 TYA: fnId=12 is set for dpId=7
18:58:59.343 RUL: TUYARECEIVED#DPTYPE2ID4 performs 'publish tele/panel_heater_office/currenttemp 20'
18:58:59.346 SRC: Rule
18:58:59.348 CMD: Grp 0, Cmd 'PUBLISH', Idx 1, Len 39, Pld -99, Data 'tele/panel_heater_office/currenttemp 20'
18:58:59.355 MQT: tele/panel_heater_office/currenttemp = 20
18:58:59.367 TYA: fnId=71 is set for dpId=4
18:58:59.369 TYA: RX value 20 from dpId 4 

This is received by the broker (The MQTT tasmota config need to be setup first and can be used for a MQTT climate entity to display the current temperature on a thermostat:

current_temperature_topic: "tele/panel_heater_office/currenttemp"
      current_temperature_template: "{{value_json['TuyaSNS']['Temperature']}}"

See the full Thermostat config later on this post

Enable the rule with

Rule1 1

Using the Console issue this commands:

`TuyaTempSetRes` 0

`TempRes` 0

This set the temperature decimal values correctly (10C instead of 1.0C for instance)

Label the Button on Tasmota WebUI:

backlog webbutton1 Power; webbutton2 ECO; webbutton3 Child Lock

Set the device name:

Backlog Topic panel_heater_office; DeviceName panel_heater_office; FriendlyName1 Panel Heater Office (Tasmota)

Set the Tasmota MQTT configuration and check on HA. tasmota addon and click on the device:

image

Setup for MQTT Thermostat:

mqtt:
  - climate:
      name: "Panel Heater Office"
      unique_id: "esp_panel_heater_office_climate"
      modes:
       - "off"
       - "heat"
      mode_command_topic: "cmnd/panel_heater_office/POWER1"
      mode_command_template: "{{'1' if value == 'heat' else '0'}}"
      mode_state_topic: "stat/panel_heater_office/active"
      mode_state_template: "{{'heat' if value == '1' else 'off'}}"
      current_temperature_topic: "tele/panel_heater_office/currenttemp"
      current_temperature_template: "{{value_json['TuyaSNS']['Temperature']}}"
      temperature_state_topic: "tele/panel_heater_office/SENSOR"
      temperature_state_template: "{{value_json['TuyaSNS']['TempSet']}}"
      min_temp: 12
      max_temp: 25
      precision: 1.0
      temperature_command_topic: "cmnd/panel_heater_office/TUYASEND2" 
      temperature_command_template: "3,{{value|int}}"
      availability_topic: tele/panel_heater_office/LWT
      payload_available: Online
      payload_not_available: Offline"

image