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

Feature request: predefined temperatures like in the Ember mobile app #45

Closed
ArtBIT opened this issue Jan 24, 2024 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@ArtBIT
Copy link

ArtBIT commented Jan 24, 2024

  • Home Assistant Version (eg. 2023.11):
  • Ember Mug Component Version (eg. 0.8.0):
  • Which device(s) are you using for Bluetooth: ESPHome Proxy

Description

I would like to be able to quickly select temperature from a predefined list of temperatures like in the Ember mobile app.

What I Did

I've managed to achieve this by adding an input_select:

input_select:
  target_temperature:
    name: Ember Mug Target Temperature
    options:
      - Latte - 55⁰C
      - Cappuccino - 56⁰C
      - Coffee - 57⁰C
      - Black Tea - 58.5⁰C
      - Green Tea - 59⁰C
    initial: Black Tea - 58.5⁰C
    icon: mdi:tea

And an automation:

automation:
  - id: mug_target_temperature_changed
    alias: Mug Target Temperature Changed
    trigger:
      platform: state
      entity_id: input_select.target_temperature
    action:
      service: number.set_value
      data:
        value: "{{ states('input_select.target_temperature') | regex_replace(find='[^0-9.]', replace='', ignorecase=False) }}"
      target:
        entity_id: number.ember_mug_target_temp

Even though this custom component is already amazing (and I thank you for making it), this would make it even more awesome imho.

@sopelj sopelj added the enhancement New feature or request label Jan 25, 2024
@sopelj
Copy link
Owner

sopelj commented Jan 25, 2024

Oh that's a great idea! Thanks!
I don't think this would be too hard to add. Although, it would be nice if it were configurable. As these are great defaults, but it would be nice to be able to change them.
I'll do some digging and see if there is a way do make this customisable via config options, otherwise I'll add the static list as you suggested.

@sopelj
Copy link
Owner

sopelj commented Feb 3, 2024

As first draft, what do you think about this. I added a select entity that allow you to choose from preset target temperatures. Choosing a preset will change the target temperature and the preset will be inversly selected based on target temperature. So, for example, if your mug is set to 55⁰C and that is the temp for your "Latte" preset it will be selected. Choosing Cappuccino will change the target temp to 56⁰C.

image

I added the presets you suggested by default, but you can change them iby choosing "Configure" on the automation. I tried to find a prettier way to display this, but this was the best compromise I could find so far. I don't like having to specify the unit here, but it was that or forcing people to use celsius or some gymnastics to figure out if they've been changed by the user.

image

It's available in 1.0.0-beta-1 if you wish to try. However, it is a beta so, there still may be breaking changes.

@ArtBIT
Copy link
Author

ArtBIT commented Feb 3, 2024

Omg, that's perfect. That's exactly what I was hoping for.
At first I was thinking that reverse selecting the preset when I change the temperature is not working, but it turns out there's is only a slight delay.

The mdi:tea makes more sense to me for the select.preset, so I've changed it in the card.

Thank you for this! Great work!

@ArtBIT ArtBIT closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants