jimz011 / homekit-infused

Homekit Infused 5 2023
https://jimz011.github.io/homekit-infused/
Other
878 stars 137 forks source link

[Question] Regarding alternative tap Thermostats #149

Closed henrikrox closed 2 years ago

henrikrox commented 2 years ago

Prior to 2022.4.0 i changed the behaviour of thermostats in base folder here

hki-base/templates/button/thermostats.yaml

# card
type: custom:button-card
template: 
  - style-default
name: {{ name }}
aspect_ratio: {{ aspect_ratio|default('1/1') }}
entity: {{ entity }}
label: "[[[ if (states['{{entity}}'].state == 'heat_cool') return `${states['{{entity}}'].attributes.target_temp_low}° - ${states['{{entity}}'].attributes.target_temp_high}°`; if (states['{{entity}}'].state == 'heat') return `${states['{{entity}}'].attributes.temperature}°`; if (states['{{entity}}'].state == 'cool') return `${states['{{entity}}'].attributes.temperature}°`; else return `--` ]]]"
lock:
  enabled: {{ lock|default('false') }}
  unlock: tap
show_icon: false
show_name: true
show_label: true
show_state: true
tap_action:
  action: more-info

I want when i tap the thermostat, more info comes up, not toggling it on or off.

From looking at release notes from 2022.4.0 this is now moved to configuration, however the possible options was not well documented

You can reverse the default tap/hold action behaviour by setting action: alternative for this entire stack at once

Whats the correct yaml representation here

  my_view:
    addons:
      thermostat:
         action: 
            tap: more-info 

or something?

jimz011 commented 2 years ago

try this:

  my_view:
    addons:
      thermostat:
        - title: My thermostats
          action: alternative
          entities:
            - climate.livingroom
henrikrox commented 2 years ago

@jimz011

That sort of works, but i really want the more-info, as i find the wheel not that great for fine adjusting. with tap_action: more info you get this image

with alternative i get this, i know i can press settings on the bottom right, but its an extra step

image

jimz011 commented 2 years ago

Ah I understand what you mean, currently this is not available. I will keep it in mind though.

For what it is worth, the thermostat addon will be merged with the button addon, so that you can have thermostats, buttons, graphs, etc in the same stack. This also means that the thermostat will gain most of the options available to the button addon.

henrikrox commented 2 years ago

ok will look into it, heres what i changed on the old backup files i have before updating to 2022.4.0.

Screenshot 2022-04-20 115807

If that is helpful in anyway.

You can close it if you want, if this is not a planned feature.

jimz011 commented 2 years ago

well, merging it with the button addon means it will get all those features (including custom tap/hold actions)

henrikrox commented 2 years ago

i fixed it for me

i didnt know it was changed to templates/button/hki-thermostats.yaml

tap_action:
  action: more-info
  haptic: light
hold_action: 
  action: fire-dom-event
  browser_mod:
    command: call-service
    service: browser_mod.popup
    service_data:
      title: ' '
      deviceID:
        - this
      style:
        .: |
          :host {
            --mdc-theme-surface: rgba(0,0,0,0);
            --secondary-background-color: rgba(0,0,0,0);
            --ha-card-background: rgba(0,0,0,0);
            --mdc-dialog-scrim-color: rgba(0,0,0,0.9);
            --mdc-dialog-min-height: 100%;
            --mdc-dialog-min-width: 100%;
            --mdc-dialog-max-width: 100%;
            --paper-slider-knob-color: #FFFFFF !important;
            --paper-slider-active-color: #dedede !important;
            --switch-checked-button-color: #FFFFFF !important;
            --switch-unchecked-button-color: #FFFFFF !important;
            --switch-checked-track-color: green !important;
            --switch-unchecked-track-color: red !important;
          }
          app-header, app-toolbar {
            background-color: rgba(0,0,0,0.0) !important;
          }
          mwc-icon-button {
            color: #FFF;
          }
      card:
        type: custom:thermostat-popup-card
        entity: {{ entity }}
        fullscreen: false
        settings: true
        settingsPosition: bottom
        settingsCard:
          type: custom:more-info-card
          cardOptions:
            entity: {{ entity }}
  haptic: heavy

This bypasses the action:alternative, just need to keep it in mind, each time i update

henrikrox commented 2 years ago

will close the issue, thanks for the help

jimz011 commented 2 years ago

@henrikrox This feature has been added in 2022.4.1, you can update within the next hour!