Add Tuya Smart Water Timer (#95053)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Sebastian YEPES 2023-11-29 09:48:45 +01:00 committed by GitHub
parent 6a87876729
commit a3bad54583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 0 deletions

View file

@ -338,6 +338,7 @@ class DPCode(StrEnum):
TEMP_VALUE_V2 = "temp_value_v2"
TEMPER_ALARM = "temper_alarm" # Tamper alarm
TIME_TOTAL = "time_total"
TIME_USE = "time_use" # Total seconds of irrigation
TOTAL_CLEAN_AREA = "total_clean_area"
TOTAL_CLEAN_COUNT = "total_clean_count"
TOTAL_CLEAN_TIME = "total_clean_time"
@ -362,6 +363,7 @@ class DPCode(StrEnum):
WATER_RESET = "water_reset" # Resetting of water usage days
WATER_SET = "water_set" # Water level
WATERSENSOR_STATE = "watersensor_state"
WEATHER_DELAY = "weather_delay"
WET = "wet" # Humidification
WINDOW_CHECK = "window_check"
WINDOW_STATE = "window_state"

View file

@ -75,6 +75,16 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
icon="mdi:thermometer-lines",
),
),
# Smart Water Timer
"sfkzq": (
# Irrigation will not be run within this set delay period
SelectEntityDescription(
key=DPCode.WEATHER_DELAY,
translation_key="weather_delay",
icon="mdi:weather-cloudy-clock",
entity_category=EntityCategory.CONFIG,
),
),
# Siren Alarm
# https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu
"sgbj": (

View file

@ -517,6 +517,18 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
*BATTERY_SENSORS,
),
# Smart Water Timer
"sfkzq": (
# Total seconds of irrigation. Read-write value; the device appears to ignore the write action (maybe firmware bug)
TuyaSensorEntityDescription(
key=DPCode.TIME_USE,
translation_key="total_watering_time",
icon="mdi:history",
state_class=SensorStateClass.TOTAL_INCREASING,
entity_category=EntityCategory.DIAGNOSTIC,
),
*BATTERY_SENSORS,
),
# Water Detector
# https://developer.tuya.com/en/docs/iot/categorysj?id=Kaiuz3iub2sli
"sj": BATTERY_SENSORS,

View file

@ -421,6 +421,19 @@
"4": "Mood 4",
"5": "Mood 5"
}
},
"weather_delay": {
"name": "Weather delay",
"state": {
"cancel": "Cancel",
"24h": "24h",
"48h": "48h",
"72h": "72h",
"96h": "96h",
"120h": "120h",
"144h": "144h",
"168h": "168h"
}
}
},
"sensor": {
@ -556,6 +569,9 @@
"water_level": {
"name": "Water level"
},
"total_watering_time": {
"name": "Total watering time"
},
"filter_utilization": {
"name": "Filter utilization"
},

View file

@ -430,6 +430,14 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
entity_category=EntityCategory.CONFIG,
),
),
# Smart Water Timer
"sfkzq": (
SwitchEntityDescription(
key=DPCode.SWITCH,
translation_key="switch",
icon="mdi:sprinkler-variant",
),
),
# Siren Alarm
# https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu
"sgbj": (