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

DDF - Add GiEXperience SMART Water Valve #6947

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

BEskandari
Copy link
Contributor

close #6944

Copy link
Contributor

github-actions bot commented Jun 2, 2024

Hey @BEskandari, thanks for your pull request!

Tip

Modified bundles can be downloaded here.
Relative expire date

DDF Bundles changes

Modified

  • tuya/_TZE200_TS0601_water_valve.json : Smart water valve ✔️

Validation

Tip

Everything is fine !

🕞 Updated for commit 5963c4c

@manup
Copy link
Member

manup commented Jun 2, 2024

@SwoopX @ebaauw I'm not so sure here if the usage of config/duration config/delay is appropriate for this device type?

(besides the JSON needs to be reformatted to "standard" format)

@manup manup requested review from SwoopX and ebaauw June 2, 2024 17:04
@SwoopX
Copy link
Collaborator

SwoopX commented Jun 2, 2024

Well, it's a little bit mixed up for my personal taste and somehow a good example that even the best attempts for reasonable recycling of resource items can hit the limits quite quickly. Strickly speaking, items and device types available do not really fit the device at hand. Not sure if a 0x0702 consuption devices would be expected by anyone here 🤔 Tricky...

Copy link
Collaborator

@ebaauw ebaauw left a comment

Choose a reason for hiding this comment

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

Hm, tricky. Added quite a few comments in the code.

"default": 0
},
{
"name": "config/duration",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we have anything for last irrigation duration. I don't think it should be on the sensors resource, but on the lights resource instead, where you handle the on/off state. Also, it should be a state item, as it's not configurable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The DDF was created through @BabaIsYou advice (see #6944). I was able to make the device working (on/off) and have added also some printscreen of eve app on the issue request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see I'm already quoted on that issue.

To get remaining duration in Eve (and even in Apple's Home app), expose the device as a Valve accessory. Homebridge deCONZ does expect state/ontime to support that, though. Never tried to combine that with consumption, though.

}
},
{
"name": "state/consumption",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using ZHAConsumption's for water consumption (rather than electricity) is new for me, but seems logical. However, I don't think it's a good idea to abuse state/consumption. Instead, we should be using state/measured_value and the corresponding cap items to indicate the substance (water), quantity (volume), and unit (litres or m3?), as well as min/max values.
Typically state/consumption reports the life time consumption (since last factory reset), not the consumption during last run.

"fn": "tuya"
}
}, {
"name": "config/mode",
Copy link
Collaborator

Choose a reason for hiding this comment

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

config/mode (and similar like config/devicemode etc) is becoming a nightmare. I think we really need a cap resource to list the possible modes (value and description?).

"name": "state/lastupdated"
},
{
"name": "config/delay",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using config/delay for a cycle interval doesn't seem right. Closest we have resembling this is the schedule on thermostats, but that's way too elaborate for this.

}
},
{
"name": "state/seconds_remaining",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We expose (writeonly) state/ontime on lights resources to set the target "duration" for the light to be on (this sends an On with Timed Off command). I think that could be used here, to set the irrigation duration, but it should be on the On/Off Output lights resource.
We don't (yet?) expose the OnTime attribute (the currently remaining "duration", which counts down to 0s, before the light turns off). The issue is that it's not reportable and there's no way to force the API to issue a Read Attributes right now, so the value will always be outdated hopelessly (by minutes at least). Unless the water valve sends push notifications for the remaining time, it doesn't make sense to expose seconds_remaining. Also, it should be exposed on the lights resource, because that's where you control the on/off state. Maybe expose the expected end time instead? Although, we don't have anything for that either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GiEXperience SMART Water Valve (_TZE200_a7sghmms)
4 participants