Integration with Sunbean WIFI Heated Mattress Pad

Just wanted to pass on my thanks to all who have contributed to this thread. I’m still working through some of the idiosyncrasies (like pre-heat vs on vs power level) BUT good Lord you saved me years!

I’m not seeing anything with a bit of searching showing ESPHome supporting the WBR3. Everything i’m seeing still requires replacing the WBR3 with an ESP. Any links?

Edit: Found a pull request that hasn’t been approved @ LibreTiny/RTL8710CM, etc. by nmschulte · Pull Request #7861 · esphome/esphome · GitHub

https://docs.libretiny.eu/docs/status/supported/#tuya-inc

On this page the WBR3 has a little information icon next to it (unfortunately can’t copy/paste the text) that brings up a tool tip specifying you can flash it as a generic-rtl8720cf-2mb-992k board, unless I misunderstand what the tool tip means.

Maybe this is out of date now, but when I try to install this through YAML, it complains about “platform: switch” and claims only “platform: binary sensor” is allowed.

Took me a bit to figure out the new formatting for local tuya template. And had to add a letter in front of the level numbers to avoid the “Failed to perform the action…” error.

Here’s a working template yaml config
Paste into a file located here:
/homeassistant/custom_components/localtuya/templates/Sunbeam_Bedding_Dual_-_S2.yaml

- switch:
    id: '1'
    friendly_name: Master Power
    entity_category: None
    restore_on_reconnect: false
    is_passive_entity: false
    platform: switch
- switch:
    id: '14'
    friendly_name: Side A Power
    entity_category: None
    restore_on_reconnect: false
    is_passive_entity: false
    platform: switch
- switch:
    id: '15'
    friendly_name: Side B Power
    entity_category: None
    restore_on_reconnect: false
    is_passive_entity: false
    platform: switch
- switch:
    id: '8'
    friendly_name: Master Preheat Power
    entity_category: None
    restore_on_reconnect: false
    is_passive_entity: false
    platform: switch
- switch:
    id: '24'
    friendly_name: Side A Preheat
    entity_category: None
    restore_on_reconnect: false
    is_passive_entity: false
    platform: switch
- switch:
    id: '25'
    friendly_name: Side B Preheat
    entity_category: None
    restore_on_reconnect: false
    is_passive_entity: false
    platform: switch
- select:
    id: '4'
    friendly_name: Master Heat Level
    entity_category: config
    select_options:
      level_1: L1
      level_2: L2
      level_3: L3
      level_4: L4
      level_5: L5
      level_6: L6
      level_7: L7
      level_8: L8
      level_9: L9
      level_10: L10
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- select:
    id: '20'
    friendly_name: Side A Heat Level
    entity_category: config
    select_options:
      level_1: L1
      level_2: L2
      level_3: L3
      level_4: L4
      level_5: L5
      level_6: L6
      level_7: L7
      level_8: L8
      level_9: L9
      level_10: L10
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- select:
    id: '21'
    friendly_name: Side B Heat Level
    entity_category: config
    select_options:
      level_1: L1
      level_2: L2
      level_3: L3
      level_4: L4
      level_5: L5
      level_6: L6
      level_7: L7
      level_8: L8
      level_9: L9
      level_10: L10
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- select:
    id: '26'
    friendly_name: Side A Set Timer
    entity_category: config
    select_options:
      30m: 0.5 hours
      1h: 1 hour
      1h30m: 1.5 hours
      2h: 2 hours
      2h30m: 2.5 hours
      3h: 3 hours
      3h30m: 3.5 hours
      4h: 4 hours
      4h30m: 4.5 hours
      5h: 5 hours
      5h30m: 5.5 hours
      6h: 6 hours
      6h30m: 6.5 hours
      7h: 7 hours
      7h30m: 7.5 hours
      8h: 8 hours
      8h30m: 8.5 hours
      9h: 9 hours
      9h30m: 9.5 hours
      10h: 10 hours
      Stay_On: 24 hours
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- select:
    id: '27'
    friendly_name: Side B Set Timer
    entity_category: config
    select_options:
      30m: 0.5 hours
      1h: 1 hour
      1h30m: 1.5 hours
      2h: 2 hours
      2h30m: 2.5 hours
      3h: 3 hours
      3h30m: 3.5 hours
      4h: 4 hours
      4h30m: 4.5 hours
      5h: 5 hours
      5h30m: 5.5 hours
      6h: 6 hours
      6h30m: 6.5 hours
      7h: 7 hours
      7h30m: 7.5 hours
      8h: 8 hours
      8h30m: 8.5 hours
      9h: 9 hours
      9h30m: 9.5 hours
      10h: 10 hours
      Stay_On: 24 hours
    restore_on_reconnect: false
    is_passive_entity: false
    platform: select
- sensor:
    id: '28'
    friendly_name: Side A Auto Off Timer
    entity_category: diagnostic
    unit_of_measurement: seconds
    platform: sensor
- sensor:
    id: '29'
    friendly_name: Side B Auto Off Timer
    entity_category: diagnostic
    unit_of_measurement: seconds
    platform: sensor

5 Likes

I just went through the process of adding an ESP-12 to the controller board and getting it working with ESPHome. I documented the process here if it helps anyone.

Important note: I found that the mains neutral is connected directly to the low voltage ground plane. So you must never plug the device in while connected to any external low voltage components, such as a UART adapter! I fried mine while trying to dump the config on the WBR3.

2 Likes

Thank you @nevets27 , you saved me so much work!

I just purchased a single-sided mattress pad, and as this is the only place I could find documentation of the data points for LocalTuya, I wanted to pull together what I have been able to work out thanks to other posts in this conversation and some trial and error on my own.

13 Seems to always report 0

14 Master Power

20 Heat Level — It’s valid inputs are “level_1;level_2;level_3;level_4;level_5;level_6;level_7;level_8;level_9;level_10”

24 Pre-Heat — This will activate the preheat function and power on the mattress pad, regardless of the Master Power setting

26 Auto-off Timer — Note that “Stay_On” is simply 24 hours “30m;1h;1h30m;2h;2h30m;3h;3h30m;4h;4h30m;5h;5h30m;6h;6h30m;7h;7h30m;8h;8h30m;9h;9h30m;10h;Stay_On”

28 Auto-off Countdown — A value in seconds that shows how long until the Auto-off timer reaches zero

102 Pre-heat Timer — A countdown in seconds until the mattress pad switches from full-power to the set temperature level

103 Safety State — This either reports “45_Minutes_Before” or “User_Confirmation” and shows the state of the safety confirmation.

Normally, if the mattress pad is powered on remotely, someone must physically press a confirmation button on the controller within 45 minutes; otherwise, the mattress pad will limit itself to a heat level of 4. However, if the unit is powered up by interacting with any control other than the Master Power switch, it bypasses that limit and allows you to set the heat level to whatever you prefer without then needing to interact with the controller.