Skip to content
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

Add Tuya Smart Water Timer #95053

Merged
merged 18 commits into from Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/tuya/const.py
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions homeassistant/components/tuya/select.py
Expand Up @@ -75,6 +75,16 @@
icon="mdi:thermometer-lines",
),
),
# Smart Water Timer
"sfkzq": (
# Irrigation will not be run within this set delay period
SelectEntityDescription(
syepes marked this conversation as resolved.
Show resolved Hide resolved
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": (
Expand Down
12 changes: 12 additions & 0 deletions homeassistant/components/tuya/sensor.py
Expand Up @@ -517,6 +517,18 @@ class TuyaSensorEntityDescription(SensorEntityDescription):
),
*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,
Expand Down
16 changes: 16 additions & 0 deletions homeassistant/components/tuya/strings.json
Expand Up @@ -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": {
Expand Down Expand Up @@ -556,6 +569,9 @@
"water_level": {
"name": "Water level"
},
"total_watering_time": {
"name": "Total watering time"
},
"filter_utilization": {
"name": "Filter utilization"
},
Expand Down
8 changes: 8 additions & 0 deletions homeassistant/components/tuya/switch.py
Expand Up @@ -430,6 +430,14 @@
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": (
Expand Down