Skip to content

Add support for Atorch S1TW thermostat/smart socket #3147

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

Merged
merged 6 commits into from
Apr 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
396 changes: 396 additions & 0 deletions custom_components/tuya_local/devices/atorch_s1tw_thermostat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,396 @@
name: Temperature controller with display
products:
- id: rj84vmyhm0dh0jwy
manufacturer: Atorch
model: S1TW
entities:
- entity: climate
translation_key: thermostat
dps:
- id: 101
type: string
name: hvac_mode
mapping:
- dps_val: socket
value: "off"
- dps_val: hot
value: heat
- dps_val: colding
value: cool
- id: 103
type: boolean
name: hvac_action
mapping:
- dps_val: false
value: idle
- dps_val: true
constraint: hvac_mode
conditions:
- dps_val: hot
value: heating
- dps_val: colding
value: cooling
- dps_val: socket
value: "off"
- id: 118
type: string
name: temperature_unit
mapping:
- dps_val: c
value: C
- dps_val: f
value: F
- id: 0
type: integer
name: current_temperature
mapping:
- scale: 10
constraint: temperature_unit
conditions:
- dps_val: c
value_redirect: current_temperature_c
- dps_val: f
value_redirect: current_temperature_f
- id: 102
type: integer
name: current_temperature_c
hidden: true
mapping:
- scale: 10
- id: 124
type: integer
name: current_temperature_f
hidden: true
mapping:
- scale: 10
- id: 0
type: integer
name: target_temp_low
mapping:
- scale: 10
constraint: temperature_unit
conditions:
- dps_val: c
value_redirect: target_temp_low_c
range:
min: -200
max: 1200
- dps_val: f
value_redirect: target_temp_low_f
range:
min: -40
max: 2480
- id: 0
type: integer
name: target_temp_low_c
hidden: true
mapping:
- scale: 10
constraint: hvac_mode
conditions:
- dps_val: hot
value_redirect: heating_temp_low_c
- dps_val: colding
value_redirect: cooling_temp_low_c
- id: 104
type: integer
name: heating_temp_low_c
hidden: true
mapping:
- scale: 10
- id: 105
type: integer
name: cooling_temp_low_c
hidden: true
mapping:
- scale: 10
- id: 0
type: integer
name: target_temp_low_f
hidden: true
mapping:
- scale: 10
constraint: hvac_mode
conditions:
- dps_val: hot
value_redirect: heating_temp_low_f
- dps_val: colding
value_redirect: cooling_temp_low_f
- id: 120
type: integer
name: heating_temp_low_f
hidden: true
mapping:
- scale: 10
- id: 121
type: integer
name: cooling_temp_low_f
hidden: true
mapping:
- scale: 10
- id: 0
type: integer
name: target_temp_high
mapping:
- scale: 10
constraint: temperature_unit
conditions:
- dps_val: c
value_redirect: target_temp_high_c
range:
min: -200
max: 1200
- dps_val: f
value_redirect: target_temp_high_f
range:
min: -40
max: 2480
- id: 0
type: integer
name: target_temp_high_c
hidden: true
mapping:
- scale: 10
constraint: hvac_mode
conditions:
- dps_val: hot
value_redirect: heating_temp_high_c
- dps_val: colding
value_redirect: cooling_temp_high_c
- id: 106
type: integer
name: heating_temp_high_c
hidden: true
mapping:
- scale: 10
- id: 107
type: integer
name: cooling_temp_high_c
hidden: true
mapping:
- scale: 10
- id: 0
type: integer
name: target_temp_high_f
hidden: true
mapping:
- scale: 10
constraint: hvac_mode
conditions:
- dps_val: hot
value_redirect: heating_temp_high_f
- dps_val: colding
value_redirect: cooling_temp_high_f
- id: 122
type: integer
name: heating_temp_high_f
hidden: true
mapping:
- scale: 10
- id: 123
type: integer
name: cooling_temp_high_f
hidden: true
mapping:
- scale: 10
- entity: switch
class: outlet
name: Switch
dps:
- id: 103
type: boolean
name: switch
- entity: sensor
class: temperature
dps:
- id: 102
type: integer
name: sensor
class: measurement
mapping:
- scale: 10
constraint: unit
conditions:
- dps_val: f
value_redirect: temperature_f
- id: 124
type: integer
name: temperature_f
hidden: true
mapping:
- scale: 10
- id: 118
type: string
name: unit
mapping:
- dps_val: c
value: C
- dps_val: f
value: F
- entity: sensor
class: current
dps:
- id: 108
type: integer
name: sensor
unit: A
class: measurement
mapping:
- scale: 1000
- entity: sensor
class: power
dps:
- id: 109
type: integer
name: sensor
unit: W
class: measurement
mapping:
- scale: 100
- entity: sensor
class: voltage
dps:
- id: 110
type: integer
name: sensor
unit: V
class: measurement
mapping:
- scale: 100
- entity: sensor
class: energy
translation_key: energy_consumed
dps:
- id: 111
type: integer
name: sensor
unit: kWh
class: total_increasing
mapping:
- scale: 1000
- entity: number
name: Price
class: monetary
category: config
dps:
- id: 112
type: integer
name: value
range:
min: 0
max: 99999
mapping:
- scale: 100
- entity: number
name: Overvoltage threshold
class: voltage
category: config
dps:
- id: 113
type: integer
name: value
unit: V
range:
min: 0
max: 2750
mapping:
- scale: 10
- entity: number
name: Overcurrent threshold
class: current
category: config
dps:
- id: 114
type: integer
name: value
unit: A
range:
min: 0
max: 1600
mapping:
- scale: 100
- entity: number
name: Overpower threshold
class: power
category: config
dps:
- id: 115
type: integer
name: value
unit: W
range:
min: 0
max: 3680
- entity: lock
translation_key: child_lock
category: config
icon: "mdi:account-lock"
dps:
- id: 116
type: boolean
name: lock
- entity: number
name: Temperature calibration
icon: "mdi:thermometer-lines"
category: config
dps:
- id: 117
type: integer
name: value
unit: °
range:
min: -50
max: 50
mapping:
- scale: 10
- entity: select
translation_key: temperature_unit
category: config
dps:
- id: 118
type: string
name: option
mapping:
- dps_val: c
value: Celsius
- dps_val: f
value: Fahrenheit
- entity: sensor
name: Cost
icon: mdi:cash-multiple
dps:
- id: 125
type: integer
name: sensor
class: total_increasing
mapping:
- scale: 1000
- entity: binary_sensor
name: Sensor detection flag
category: diagnostic
dps:
- id: 126
type: boolean
name: sensor
class: measurement
- entity: sensor
name: Add ele
category: diagnostic
dps:
- id: 127
type: integer
name: sensor
class: measurement
optional: true
- entity: number
name: Reporting interval
class: duration
category: config
dps:
- id: 128
type: integer
name: value
unit: s
range:
min: 1
max: 90