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 _TZE204_rzrrjkz2 Smart Sprinkler Timer #7630

Merged
merged 21 commits into from
Jun 20, 2024
47 changes: 47 additions & 0 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8734,6 +8734,53 @@
],
},
},
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this definition to neo.ts

Copy link
Contributor Author

@OgV1 OgV1 Jun 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need to create a new pull request for this?

fingerprint: tuya.fingerprint('TS0601', ['_TZE204_rzrrjkz2']),
model: 'TS0601',
OgV1 marked this conversation as resolved.
Show resolved Hide resolved
vendor: 'Tuya',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
description: 'Smart Sprinkler Timer',
OgV1 marked this conversation as resolved.
Show resolved Hide resolved
onEvent: tuya.onEventSetTime,
configure: tuya.configureMagicPacket,
exposes: [
e.switch(),
Copy link
Owner

@Koenkk Koenkk Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing a lot of exposes here, could you add them? Every datapoint in tuyaDatapoints should have a corresponding expose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Koenkk,

Thank you for the fast respond, really appreciated,

I must say that I'm really new to GitHub and actually have a little knowledge on how to make exposes works.
The data point IDs are extracted from the device in Tuya Cloud Project, as I'm following from this instruction
https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html#_3-understanding-tuya-datapoints

I tried to put a lot of exposes before but it seems to be rejected, that's why I have to remove them.

Could you please provide me any instructions on how to make exposes works?

I can see these information on Device Debugging on Tuya Cloud Project, Not sure if it should help us on developing exposes?

Code | Type | Values -- | -- | -- switch | Boolean | "{true,false}" status | Enum | { "range": [ "off", "auto", "disabled" ] } countdown | Integer | { "unit": "min", "min": 1, "max": 240, "scale": 0, "step": 1 } countdown_left | Integer | { "unit": "min", "min": 1, "max": 240, "scale": 0, "step": 1 } water_current | Integer | { "unit": "gal/min", "min": 0, "max": 1000000000, "scale": 3, "step": 1 } battery_percentage | Integer | { "unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1 } water_total | Integer | { "unit": "gal", "min": 0, "max": 999999999, "scale": 3, "step": 1 } weather_delay | Enum | { "range": [ "24h", "48h", "72h", "cancel" ] } normal_timer | String | { "maxlen": 255 } weather_switch | Boolean | "{true,false}" switch_enabled | Boolean | "{true,false}"

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to put a lot of exposes before but it seems to be rejected, that's why I have to remove them.

What do you mean with "rejected" here?

For examples, please look at e.g. this:

expose

e.numeric('max_temperature_alarm', ea.STATE_SET).withUnit('°C').withValueMin(-20).withValueMax(60)

datapoint:

[10, 'max_temperature_alarm', tuya.valueConverter.divideBy10],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Koenkk,

Thank you again for your contributing, your ZB2MQTT is absolute gold!

I tried to put a lot of exposes before but it seems to be rejected, that's why I have to remove them.

What do you mean with "rejected" here?

In the first version here (I'm still super new to GH not sure how to exact quote the version like you did)
2ef84ed

and it just not pass, then I just tried to remove them, but it's not the big deal, now I understand the concept from what you provided.

Will try to upload the new version.

Best regards

tuya.exposes.batteryState(),
e.switch(),
e.quantitative_watering(),

Check failure on line 8750 in src/devices/tuya.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'quantitative_watering' does not exist on type '{ binary: (name: string, access: number, valueOn: string | boolean, valueOff: string | boolean) => Binary; climate: () => Climate; composite: (name: string, property: string, access: number) => Composite; ... 167 more ...; max_brightness: () => Numeric; }'.
e.flow_switch(),

Check failure on line 8751 in src/devices/tuya.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'flow_switch' does not exist on type '{ binary: (name: string, access: number, valueOn: string | boolean, valueOff: string | boolean) => Binary; climate: () => Climate; composite: (name: string, property: string, access: number) => Composite; ... 167 more ...; max_brightness: () => Numeric; }'.
e.child_lock(),
e.surplus_flow(),

Check failure on line 8753 in src/devices/tuya.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'surplus_flow' does not exist on type '{ binary: (name: string, access: number, valueOn: string | boolean, valueOff: string | boolean) => Binary; climate: () => Climate; composite: (name: string, property: string, access: number) => Composite; ... 167 more ...; max_brightness: () => Numeric; }'.
e.single_watering_duration(),

Check failure on line 8754 in src/devices/tuya.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'single_watering_duration' does not exist on type '{ binary: (name: string, access: number, valueOn: string | boolean, valueOff: string | boolean) => Binary; climate: () => Climate; composite: (name: string, property: string, access: number) => Composite; ... 167 more ...; max_brightness: () => Numeric; }'.
e.interface_refresh(),

Check failure on line 8755 in src/devices/tuya.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'interface_refresh' does not exist on type '{ binary: (name: string, access: number, valueOn: string | boolean, valueOff: string | boolean) => Binary; climate: () => Climate; composite: (name: string, property: string, access: number) => Composite; ... 167 more ...; max_brightness: () => Numeric; }'.
e.single_watering_amount(),

Check failure on line 8756 in src/devices/tuya.ts

View workflow job for this annotation

GitHub Actions / ci

Property 'single_watering_amount' does not exist on type '{ binary: (name: string, access: number, valueOn: string | boolean, valueOff: string | boolean) => Binary; climate: () => Climate; composite: (name: string, property: string, access: number) => Composite; ... 167 more ...; max_brightness: () => Numeric; }'.
],
meta: {
tuyaDatapoints: [
[1, 'switch', tuya.valueConverter.onOff],
OgV1 marked this conversation as resolved.
Show resolved Hide resolved
[3, 'status', tuya.valueConverter.onOff],
[5, 'countdown', tuya.valueConverter.raw],
[6, 'countdownLeft', tuya.valueConverter.raw],
[9, 'water_current', tuya.valueConverter.raw],
[11, 'battery_state', tuya.valueConverter.batteryState],
[15, 'water_total', tuya.valueConverter.raw],
[19, 'fault', tuya.valueConverter.raw],
[37, 'weather_delay', tuya.valueConverter.raw],
[38, 'normal_timer', tuya.valueConverter.raw],
[42, 'switch', tuya.valueConverter.onOff],
[47, 'smart_irrigation', tuya.valueConverter.raw],
[101, 'total_flow_reset_switch', tuya.valueConverter.onOff],
[102, 'quantitative_watering', tuya.valueConverter.raw],
[103, 'flow_switch', tuya.valueConverter.onOff],
[104, 'child_lock', tuya.valueConverter.onOff],
[105, 'surplus_flow', tuya.valueConverter.raw],
[106, 'single_watering_duration', tuya.valueConverter.raw],
[107, 'interface_refresh', tuya.valueConverter.raw],
[108, 'single_watering_amount', tuya.valueConverter.raw],
],
},
},

];

export default definitions;
Expand Down
Loading