{"id":3174,"date":"2021-12-20T21:48:47","date_gmt":"2021-12-20T21:48:47","guid":{"rendered":"https:\/\/martinsentech.no\/?p=3174"},"modified":"2025-09-05T19:46:38","modified_gmt":"2025-09-05T19:46:38","slug":"home-assistnat-roller-shutter-preset-buttons","status":"publish","type":"post","link":"https:\/\/martinsentech.no\/index.php\/2021\/12\/20\/home-assistnat-roller-shutter-preset-buttons\/","title":{"rendered":"Home Assistnat &#8211; Roller Shutter &#038; Preset buttons"},"content":{"rendered":"\n<p>Form my window Roller Shutters I wanted to have possibility of manual Up &amp; Down control, Slider control and Preset Buttons. I also wanted to have both Roller Shutters in same section, without any shadow or spacer in between.<\/p>\n<p>I searched forums and FB Groups and I found some pieces of code hare and there but nothing worked as I wanted to.<\/p>\n<p>I then found custom:vertical-stack-in-card and everything changed.<\/p>\n<p>To achieve what you see on the pictures I used:<\/p>\n<ul>\n<li>custom:vertical-stack-in-card<br><a href=\"https:\/home\/user\/pub\/martinsentech\/github.com\/ofekashery\/vertical-stack-in-card\">https:\/home\/user\/pub\/martinsentech\/github.com\/ofekashery\/vertical-stack-in-card<\/a><\/li>\n<li>custom:button-card<br><a href=\"https:\/home\/user\/pub\/martinsentech\/github.com\/custom-cards\/button-card\">https:\/home\/user\/pub\/martinsentech\/github.com\/custom-cards\/button-card<\/a><\/li>\n<li>tile card<br><a href=\"https:\/home\/user\/pub\/martinsentech\/www.home-assistant.io\/dashboards\/tile\/\">https:\/home\/user\/pub\/martinsentech\/www.home-assistant.io\/dashboards\/tile\/<\/a><\/li>\n<\/ul>\n<p>The code for everything is:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;yaml&quot;,&quot;mime&quot;:&quot;text\/yaml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;YAML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;yaml&quot;}\">type: custom:vertical-stack-in-card\ncards:\n  - type: vertical-stack\n    cards:\n      - features:\n          - type: cover-position\n        type: tile\n        entity: cover.living_room_shutter_3\n        name: Living Room Left Window\n      - type: horizontal-stack\n        cards:\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 0\n                entity_id: cover.living_room_shutter_3\n            entity: cover.living_room_shutter_3\n            name: Close\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_3', 'current_position', 0) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 25\n                entity_id: cover.living_room_shutter_3\n            entity: cover.living_room_shutter_3\n            name: 25%\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_3', 'current_position', 25) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 50\n                entity_id: cover.living_room_shutter_3\n            entity: cover.living_room_shutter_3\n            name: 50%\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_3', 'current_position', 50) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 65\n                entity_id: cover.living_room_shutter_3\n            entity: cover.living_room_shutter_3\n            name: 65%\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_3', 'current_position', 75) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 100\n                entity_id: cover.living_room_shutter_3\n            entity: cover.living_room_shutter_3\n            name: Open\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_3', 'current_position', 100) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n  - type: vertical-stack\n    cards:\n      - features:\n          - type: cover-position\n        type: tile\n        entity: cover.living_room_shutter_4\n        name: Living Room Right Window\n      - type: horizontal-stack\n        cards:\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 0\n                entity_id: cover.living_room_shutter_4\n            entity: cover.living_room_shutter_4\n            name: Close\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_4', 'current_position', 0) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 25\n                entity_id: cover.living_room_shutter_4\n            entity: cover.living_room_shutter_4\n            name: 25%\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_4', 'current_position', 25) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 50\n                entity_id: cover.living_room_shutter_4\n            entity: cover.living_room_shutter_4\n            name: 50%\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_4', 'current_position', 50) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 65\n                entity_id: cover.living_room_shutter_4\n            entity: cover.living_room_shutter_4\n            name: 65%\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_4', 'current_position', 75) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n          - type: custom:button-card\n            tap_action:\n              action: call-service\n              service: cover.set_cover_position\n              service_data:\n                position: 100\n                entity_id: cover.living_room_shutter_4\n            entity: cover.living_room_shutter_4\n            name: Open\n            show_icon: false\n            card_mod:\n              style: |\n                ha-card {\n                  --ha-card-background: \n                  {% if is_state_attr('cover.living_room_shutter_4', 'current_position', 100) %}\n                    purple;\n                    color: white;\n                  {% endif %}\n                }\n            styles:\n              card:\n                - border: 0px 0px 0px 0px\n                - border-radius: 0%\n                - box-shadow: 0px 0px 0px 0px\n<\/pre><\/div>\n\n\n\n<p>Below is a Light Mode screenshot from my phone.<\/p>\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_9907652\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"770\" src=\"https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Light-1024x773.jpg\" class=\"attachment-large size-large\" alt=\"\" srcset=\"https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Light-1024x773.jpg 1024w, https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Light-300x226.jpg 300w, https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Light-768x580.jpg 768w, https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Light-600x453.jpg 600w, https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Light.jpg 1080w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style>\n#image_9907652 {\n  width: 100%;\n}\n<\/style>\n\t<\/div>\n\t\n","protected":false},"excerpt":{"rendered":"<p>Form my window Roller Shutters I wanted to have possibility of manual Up &#038; Down control, Slider control and Preset Buttons. I also wanted to have both Roller Shutters in same section, without any shadow or spacer in between.<\/p>\n","protected":false},"author":1,"featured_media":3552,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[77],"tags":[],"class_list":["post-3174","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-smart-house"],"jetpack_featured_media_url":"https:\/\/martinsentech.no\/wp-content\/uploads\/2021\/12\/Roller_Shutter_With_Preset_Buttons-Dark.jpg","_links":{"self":[{"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/posts\/3174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/comments?post=3174"}],"version-history":[{"count":15,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/posts\/3174\/revisions"}],"predecessor-version":[{"id":3633,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/posts\/3174\/revisions\/3633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/media\/3552"}],"wp:attachment":[{"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/media?parent=3174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/categories?post=3174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/martinsentech.no\/index.php\/wp-json\/wp\/v2\/tags?post=3174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}