View difference between Paste ID: rsw0hV8K and kXaby8kS
SHOW: | | - or go back to the newest paste.
1
###################################################################################
2
###################################################### SZABLONY CUSTOM-BUTTON-CARD:
3
4
button_card_templates:
5
	#################### wspólne
6
	default:
7
	  styles:
8
		card:
9
		- background-color: var(--card-background-color)
10
		- background-size: cover
11
		- border: none
12
		- margin: none
13
		- box-shadow: none	
14
15
	#################### sensor pojedyńczy
16
	single_sensor:
17
	  show_label: true
18
	  styles:
19
		card:
20
		- padding: 4px
21
		- font-size: 1em
22
		grid:
23
		- grid-template-areas: '"n n" "i l"'
24
		- grid-template-columns: 35% 65%
25
		- grid-template-rows: 1fr 1fr
26
		name:
27
		- align-self: center
28
		- justify-self: center
29
		- color: var(--secondary-text-color)
30
		- padding-bottom: 5px
31
		icon:
32
		- color: var(--state-icon-color)
33
		- width: 50%
34
		label:
35
		- align-self: middle
36
		- justify-self: start
37
		- font-size: 1.2em
38
	  label: >
39
		[[[
40
		  var temps = `${entity.state}`;
41
		  var tempu = `${entity.attributes.unit_of_measurement}`;
42
		  return `<span>` + (isNaN(temps) ? '?' : temps) + ` ` + tempu + `</span>`;
43
		]]]
44
45
	#################### sensor podwójny z dużą ikoną główną
46
	double_sensor_icon:
47
	  template: single_sensor
48
	  show_label: false
49
	  styles:
50
		grid:
51
		- grid-template-areas: '"n n" "i asensor" "i bsensor"'
52
		- grid-template-columns: 40% 60%
53
		- grid-template-rows: 1fr 1fr 1fr
54
		icon:
55
		- width: 50%
56
		custom_fields:
57
		  asensor:
58
		  - align-self: start
59
		  - justify-self: start
60
		  - font-size: 1em
61
		  bsensor:
62
		  - align-self: start
63
		  - justify-self: start
64
	  custom_fields:
65
		asensor: >
66
		  [[[
67
			var temps = `${entity.state}`;
68
			var tempu = `${entity.attributes.unit_of_measurement}`;
69
			var tempi = `${entity.attributes.icon}`;
70
			return `<ha-icon icon="` + tempi + `" style="width: 1.5em; color: var(--state-icon-color)"></ha-icon> <span>` + ` ` + (isNaN(temps) ? '?' : temps) + (tempu ? tempu : '') + `</span>`;
71
		  ]]]
72
73
	#################### sensor podwójny z popupem
74
	double_sensor_popup:
75
	  template: double_sensor_icon
76
	  tap_action:
77
		action: fire-dom-event
78
		browser_mod:
79
		  command: popup
80
		  card:
81
			type: vertical-stack
82
83
###################################################################################
84
############################################## KOD NA BUTTON Z POPUPEM W LOWELASIE:
85
86
#################### gabinet
87
    - name: Gabinet
88
      type: custom:button-card
89
      template: double_sensor_popup
90-
      style: &round_card |
90+
91-
        ha-card {
91+
92-
          border-radius: 12px !important;
92+
93-
          box-shadow: 
93+
94-
            {% if is_state('sun.sun', 'below_horizon') %}
94+
95-
              0px 0px 5px 1px rgba(0,0,0,0.25);
95+
96-
            {% else %}
96+
97-
              0px 0px 5px 1px rgba(0,0,0,0.25);
97+
98-
            {% endif %}
98+
99-
        }
99+
100-
        ha-card.type-custom-simple-thermostat header {
100+
101-
          padding: calc(var(--st-spacing, var(--st-default-spacing)) * 3) calc(var(--st-spacing, var(--st-default-spacing)) * 4) calc(var(--st-spacing, var(--st-default-spacing)) * 1)
101+
102-
        }
102+
103-
        ha-card div.no-header {
103+
104-
          padding-top: 2px !important;
104+
105-
        }
105+
106-
        ha-card div.no-header div.entity {
106+
107-
          margin-bottom: 2px !important;
107+
108-
          font-size: 0.9em !important;
108+
109-
        }
109+
110-
        ha-card header.clickable {
110+
111-
          padding-top: 10px !important;
111+
112-
          padding-bottom: 0 !important
112+
113-
        }
113+
114-
        ha-card section.body {
114+
115-
          padding-top: 0 !important;
115+
116-
          padding-bottom: 0 !important;
116+
117-
        }
117+
118-
        ha-card div.heading {
118+
119-
          margin-top: 0 !important;
119+
120-
        }
120+
121-
        ha-card .state--small {
121+
122-
          margin-bottom: 0 !important;
122+
123-
        }
123+
124
              show:
125
                points: false
126
                extrema: true
127
                fill: fade
128
              color_thresholds_transition: smooth
129
              color_thresholds:
130
              - value: 17
131
                color: "#00d9d9"
132
              - value: 22
133
                color: "#ff8000"
134
              - value: 27
135
                color: "#ff2626"
136
            - type: custom:mini-graph-card
137
              name: "Wilgotność"
138
              entities:
139
              - sensor.2_off_humidity
140
              - entity: sensor.0_cfg_nightime
141
                color: "#444444"
142
                show_line: false
143-
              style: &popup_padding |
143+
144-
                ha-card {
144+
145-
                  padding: 10px !important;
145+
146-
                  border-radius: 12px !important;
146+
147-
                  box-shadow: 
147+
148-
                    {% if is_state('sun.sun', 'below_horizon') %}
148+
149-
                      0px 0px 5px 1px rgba(0,0,0,0.25);
149+
150-
                    {% else %}
150+
151-
                      0px 0px 5px 1px rgba(0,0,0,0.25);
151+
152-
                    {% endif %}
152+
153-
                }
153+
154-
                ha-card div.current {
154+
155-
                  margin-bottom: 5em !important;
155+
156-
                }
156+
157
              color_thresholds_transition: hard
158
              color_thresholds:
159
              - value: 0
160
                color: "#f4b400"
161
              - value: 40
162
                color: "#0DA035"
163
              - value: 60
164
                color: "#DF4C1E"
165
166
167
###################################################################################
168
###################################### DODATKOWA KARTA Z WYKRESEM TEMP. NA ZEWNĄTRZ
169
  - type: horizontal-stack
170
    cards:
171
    - name: Na dworze
172
      type: custom:mini-graph-card
173
      entities:
174
      - entity: sensor.0_out_feel_temperature
175
        name: Odczuwalna
176
      - entity: sensor.0_out_average_temperature
177
        name: Temperatura
178
        show_state: true
179
        show_graph: false
180
      - entity: sensor.4_out_humidity
181
        name: Wilgotność
182
        show_state: true
183
        show_graph: false
184
      - entity: sensor.0_cfg_nightime
185-
              style: *popup_padding
185+
186
        show_line: false
187
        show_points: false
188
        show_legend: false
189
        y_axis: secondary
190
      show:
191
        legend: false
192
        points: false
193
      tap_action:
194
        action: fire-dom-event
195
        browser_mod:
196
          command: popup
197
          title: Pogoda
198
          card:
199
            #################### pogoda popup
200
            type: vertical-stack
201
            cards:
202
            - type: custom:weather-card
203
              entity: weather.0_wth_summary
204
              current: true
205
              details: true
206
              forecast: true
207
              hourly_forecast: false
208
              number_of_forecasts: 5
209
            - name: "Średnia 3-dniowa"
210
              type: custom:mini-graph-card
211
              entities:
212
              - sensor.0_out_average_3d_temperature
213
              - entity: sensor.0_cfg_nightime
214
                color: "#444444"
215
                show_line: false
216
                show_points: false
217
                show_legend: false
218
                y_axis: secondary
219
              group: true
220
              hours_to_show: 168
221-
      style: *round_card
221+
222
              points_per_hour: 1
223
              hour24: true
224
              decimals: 1
225
              animate: true
226
              show:
227
                points: false
228
                extrema: false
229
                fill: fade
230
              color_thresholds_transition: smooth
231
              color_thresholds:
232
              - value: 13
233
                color: "#00d9d9"
234
              - value: 18
235
                color: "#ff8000"
236
              - value: 20
237
                color: "#ff2626"
238
            - type: custom:sun-card
239
              language: pl
240
            - type: entities
241
              show_header_toggle: false
242
              entities:
243
              - sensor.0_out_season
244
              - binary_sensor.0_out_heating
245
              - sensor.0_out_max_24h_temperature
246
              - sensor.0_out_min_24h_temperature
247
      font_size: 80
248
      align_icon: left
249
      icon: mdi:home-group
250
      hours_to_show: 24
251
      hour24: true
252
      decimals: 1
253-
              style: &popup_padding |
253+
254-
                ha-card {
254+
255-
                  padding: 10px !important;
255+
256-
                  border-radius: 12px !important;
256+
257-
                  box-shadow: 
257+
258-
                    {% if is_state('sun.sun', 'below_horizon') %}
258+
259-
                      0px 0px 5px 1px rgba(0,0,0,0.25);
259+
260-
                    {% else %}
260+
261-
                      0px 0px 5px 1px rgba(0,0,0,0.25);
261+
262-
                    {% endif %}
262+
263-
                }
263+
264-
                ha-card div.current {
264+
265-
                  margin-bottom: 5em !important;
265+
266-
                }
266+
267
      - value: 20
268
        color: "#eab856"
269
      - value: 25
270
        color: "#df915d"
271
      - value: 30
272
        color: "#d2694b"
273
      - value: 35
274-
              style: *popup_padding
274+