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 bluetooth dual water timer #1890

Merged
merged 14 commits into from
May 25, 2024

Conversation

AdrianGarside
Copy link
Contributor

@AdrianGarside AdrianGarside commented May 6, 2024

Add dual water timer bought on Amazon (and visually there's a number of brands selling the exact same one).
https://www.amazon.com/gp/product/B0D13W939Y/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&th=1

image

@AdrianGarside AdrianGarside marked this pull request as ready for review May 7, 2024 04:57
@AdrianGarside
Copy link
Contributor Author

Should I make the last runtime / current spray time just attributes on the valve states sensors? They probably won't be that useful but attributes are much more of a pain to get at / use in automations.

@make-all
Copy link
Owner

make-all commented May 8, 2024

The schedule values do not appear very useful, and should be moved to attributes, but current and last runtime appear to be more useful.

@AdrianGarside
Copy link
Contributor Author

AdrianGarside commented May 8, 2024

Is there a better way to present the durations? In the screenshot in the PR, valve 1 ran for 2s. After scaling to minutes it gets rescaled by home assistant back into seconds for display but with an introduced error. The spray time is scaled the same way but since it was full minutes there was no rounding but it gets presented in an inconsistent way. If I set a precision manually on either they become (for e.g) 0.03 min. Setting precision to 0 in the yaml gives:
image

Precisions of 2 & 0 respectively may be the best:
image
It would be nice if there was a way for home assistant to either be consistent and show it as MM:SS or be smart and show sub-minute values as seconds and then switch to either MM:SS or MM.xx minutes.

@make-all
Copy link
Owner

make-all commented May 8, 2024

You shouldn't need to scale sensors with a class of duration. Just set the unit to s, and let HA take care of formating

@AdrianGarside
Copy link
Contributor Author

AdrianGarside commented May 9, 2024

You shouldn't need to scale sensors with a class of duration. Just set the unit to s, and let HA take care of formating

Then everything becomes seconds, which isn't great when the runtime will typically be more consumable in minutes:
image

My personal ideal would be consistency so get the MM:SS display for both of these:
image

Some of the changes I was trying weren't taking full effect when simply reloading with a new config. This is the result when I add from scratch with seconds (no scaling) and class: duration:
image

That's what you suggested and I think that's the best that can be done.

@AdrianGarside
Copy link
Contributor Author

@make-all I think this is ready to go.

@make-all make-all merged commit a3594a6 into make-all:main May 25, 2024
4 checks passed
@AdrianGarside
Copy link
Contributor Author

@make-all removing the mode: box lines changes the entity config to:
image
Which is much less easy to use to set an accurate time than the way it presents with that setting (in PR description).

@make-all
Copy link
Owner

This can be changed in the UI if the user prefers a different representation of the number entities. Unless there is a good reason for it, the default should follow standard HA policy

timlaing pushed a commit to timlaing/tuya-local that referenced this pull request Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants