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

No Issue | Tip for a Mushroom-Desk-Card #59

Open
guevara777 opened this issue Jun 21, 2023 · 1 comment
Open

No Issue | Tip for a Mushroom-Desk-Card #59

guevara777 opened this issue Jun 21, 2023 · 1 comment

Comments

@guevara777
Copy link

Hi. Thanks to this project i can move my desk up and down with home assistant. awesome.

I've made a card that uses custom:button-card and custom:mushroom-card to create a mushroom-like desk-card.

The card looks like this (with the typical big padding for mushroom cards)
image

or like this (with my smaller paddings around the card)
image

The Buttons on the right side on the card...
1.) turn on the switch.down-entity
2.) turn off the switch.up and switch-down-entity
3.) turn on the swith.up-entity
4.) call the button.sit-entity
5.) call the button.stand-entity

To do this you need:

  • Button-Card
  • Mushroom-Cards
  • the following little script that switches switch.up and switch.down off (for the pause-button)
alias: schreibtisch anhalten
sequence:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
        - switch.up
        - switch.down
mode: single

And this yaml-code

type: custom:button-card
entity: cover.desk
show_name: false
show_state: false
show_icon: false
styles:
  card:
    - overflow: unset
    - padding: 3px
  grid:
    - grid-template-areas: '"mushroom colors"'
    - grid-template-columns: auto 15rem
custom_fields:
  mushroom:
    card:
      type: custom:mushroom-template-card
      entity: '[[[ return entity.entity_id ]]]'
      tap_action:
        action: more-info
      icon_color: blue
      primary: '{{ state_attr(entity,"friendly_name") }}'
      secondary: >-
        {{ states("sensor.desk_height") }} {{
        state_attr("sensor.desk_height","unit_of_measurement") }}
      icon: '{{ state_attr(entity,"icon") }}'
      card_mod:
        style: |
          ha-card {
            padding: 3px 3px 3px 3px !important; #comment this line out if you want the bigger paddings around the card
            text-align: left !important;
            border: none !important;
            box-shadow: none !important;
          }
  colors:
    card:
      type: grid
      columns: 5
      square: false
      cards:
        - type: custom:button-card
          tap_action:
            action: call-service
            service: switch.turn_on
            service_data:
              entity_id: switch.down
          size: 70%
          show_state: false
          show_name: false
          show_icon: true
          icon: mdi:arrow-down
          styles:
            card:
              - padding: 3px
              - height: 40px
              - width: 2.5rem
              - box-shadow: none
              - border: none
              - background: var(--secondary-background-color)
        - type: custom:button-card
          tap_action:
            action: call-service
            service: script.schreibtisch_anhalten
          size: 70%
          show_state: false
          show_name: false
          show_icon: true
          icon: mdi:pause
          styles:
            card:
              - padding: 3px
              - height: 40px
              - width: 2.5rem
              - box-shadow: none
              - border: none
              - background: var(--secondary-background-color)
        - type: custom:button-card
          tap_action:
            action: call-service
            service: switch.turn_on
            service_data:
              entity_id: switch.up
          size: 70%
          show_state: false
          show_name: false
          show_icon: true
          icon: mdi:arrow-up
          styles:
            card:
              - padding: 3px
              - height: 40px
              - width: 2.5rem
              - box-shadow: none
              - border: none
              - background: var(--secondary-background-color)
        - type: custom:button-card
          tap_action:
            action: call-service
            service: button.press
            service_data:
              entity_id: button.sit
          size: 70%
          show_state: false
          show_name: false
          show_icon: true
          icon: mdi:chair-rolling
          styles:
            card:
              - padding: 0px
              - height: 40px
              - width: 2.5rem
              - box-shadow: none
              - border: none
              - background: var(--secondary-background-color)
        - type: custom:button-card
          tap_action:
            action: call-service
            service: button.press
            service_data:
              entity_id: button.stand
          show_state: false
          show_name: false
          show_icon: true
          icon: mdi:human-handsup
          size: 70%
          styles:
            card:
              - padding: 0px
              - height: 100%
              - width: 2.5rem
              - box-shadow: none
              - border: none
              - background: var(--secondary-background-color)
@KrX3D
Copy link

KrX3D commented Aug 18, 2023

thanks for that card. It looks really nice, better than the one i had before

for the pause/stop button:

Since i use a cover in EspHome

cover:
  - platform: template
    # icon: mdi:table-chair
    # icon: mdi-human-male-height-variant
    name: "${device_name} Tisch"
.....

i just added

    stop_action:
      - logger.log: "Executing stop command"
      - switch.turn_on: switch_up
      - switch.turn_on: switch_down

an that stops the movement

i also added it in my config here:

#35

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

No branches or pull requests

2 participants