junkfix / numberbox-card

Replace input_number sliders with plus and minus buttons
109 stars 9 forks source link

Toggle Switch #72

Closed nochlab1 closed 1 year ago

nochlab1 commented 1 year ago

Hi is it possible to add a option to have a toggle on the switch so i can control the temp on turn it n and off Thanks

mathieu-mp commented 1 year ago

Hi, Such a great work, I use it for months now... It should be core !!! I would love to have a toggle button too, or how can we achieve that ?

htmltiger commented 1 year ago

It is possible to create with a switch when you use type: horizontal-stack

130059 Overview – Home Assistant

type: vertical-stack
title: Downstairs Heating
cards:
  - type: horizontal-stack
    cards:
      - type: custom:bignumber-card
        title: Current Temp
        entity: sensor.downstairs_c_temp
        info: sensor.downstairs_temp
        scale: 25px
        unit: ''
      - type: horizontal-stack
        cards:
          - type: button
            tap_action:
              action: more-info
            entity: sensor.downstairs_timerui
            show_name: false
            show_state: true
            show_icon: true
            icon: mdi:timelapse
            icon_height: 32px
            style: |
              :host { --paper-item-icon-color:#ccc; }
          - type: button
            tap_action:
              action: more-info
            entity: binary_sensor.downstairs_flame
            show_name: true
            show_state: false
            icon_height: 32px
            name: Status
            hold_action:
              action: none
            style: >
              ha-card {font-size:0.8rem !important;} :host {
              --paper-item-icon-active-color:#c00; --paper-item-icon-color:#ccc;
               }
          - type: button
            tap_action:
              action: toggle
            entity: switch.heat_auto_downstairs
            show_name: true
            icon_height: 32px
            name: Auto
            style: |
              ha-card {font-size:0.8rem !important;}
  - type: horizontal-stack
    cards:
      - type: entities
        entities:
          - type: custom:numberbox-card
            entity: climate.downstairs_heating
            name: false
            border: false
            initial: 0
            icon: false
            state: temperature
            service: set_temperature
            param: temperature
            min: 0
            max: 50
            step: 0.5
            style: >
              .grid{display:block!important} .grid-left{padding:0 !important;text-align:center!important}
               h3{font-size:40px !important}
              .body{display:block!important}
              .body::after{text-align:center;font-size:12px;content:"Set Temperature";display:block!important}
      - type: entities
        entities:
          - type: custom:numberbox-card
            entity: number.down_timer
            name: false
            border: false
            initial: 0
            icon: false
            style: >
              .grid{display:block!important} .grid-left{padding:0 !important;text-align:center!important}
               h3{font-size:40px !important}
              .body{display:block!important}
              .body::after{text-align:center;font-size:12px;content:"Timer";display:block!important}
        style: >
          .card-header{display:block!important;line-height:var(--ha-card-header-font-size, 35px) !important}
  - type: entities
    entities:
      - entity: sensor.downstairs_on_today
        name: Heat On Today
        icon: mdi:chart-line
    style: |
      .card-content{padding:0 16px !important}
  - type: horizontal-stack
    cards:
      - type: custom:apexcharts-card
        ...
ildar170975 commented 1 year ago

In short - no need to overload this great card with unusual options which may be easily added in a nearby card in a stack.

nochlab1 commented 1 year ago

The thing is i am using it in a entities card I made a simple page where it just had everything listed for 1 room makes it a little easier to control everything so now i have 2 separate lines if it would have a switch i would only need 1 one

htmltiger commented 1 year ago

Please try 4.6 update

nochlab1 commented 1 year ago

Thank you It Works!!!