Advertisement
dckiller

Body Miscale Card Basic

Apr 17th, 2021
1,613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.22 KB | None | 0 0
  1. cards:
  2. - cards:
  3. - elements:
  4. - type: conditional
  5. conditions:
  6. - entity: input_boolean.bodyscale_aurelien_info_toggle
  7. state: 'on'
  8. elements:
  9. - entity: bodymiscale.aurelien
  10. type: state-label
  11. attribute: weight
  12. prefix: 'Poids: '
  13. suffix: ' kg'
  14. style:
  15. top: 45%
  16. right: 1%
  17. color: white
  18. transform: 'translate(0%,-50%)'
  19. pointer-events: none
  20. font-size: 15px
  21. border-right-style: solid
  22. border-color: 'rgb(34, 154, 210)'
  23. - entity: bodymiscale.aurelien
  24. type: state-label
  25. attribute: height
  26. prefix: 'Taille: '
  27. suffix: ' cm'
  28. style:
  29. top: 55%
  30. right: 1%
  31. color: white
  32. transform: 'translate(0%,-50%)'
  33. pointer-events: none
  34. font-size: 15px
  35. border-right-style: solid
  36. border-color: 'rgb(34, 154, 210)'
  37. - entity: bodymiscale.aurelien
  38. type: state-label
  39. attribute: age
  40. prefix: 'Age: '
  41. suffix: ' ans'
  42. style:
  43. top: 65%
  44. right: 1%
  45. color: white
  46. transform: 'translate(0%,-50%)'
  47. pointer-events: none
  48. font-size: 15px
  49. border-right-style: solid
  50. border-color: 'rgb(34, 154, 210)'
  51. - entity: bodymiscale.aurelien
  52. type: state-label
  53. attribute: gender
  54. prefix: 'Genre: '
  55. style:
  56. top: 75%
  57. right: 1%
  58. color: white
  59. transform: 'translate(0%,-50%)'
  60. pointer-events: none
  61. font-size: 15px
  62. border-right-style: solid
  63. border-color: 'rgb(34, 154, 210)'
  64. - type: conditional
  65. conditions:
  66. - entity: input_boolean.bodyscale_siham_info_toggle
  67. state: 'on'
  68. elements:
  69. - entity: bodymiscale.siham
  70. type: state-label
  71. attribute: weight
  72. prefix: 'Poids: '
  73. suffix: ' kg'
  74. style:
  75. top: 45%
  76. right: 1%
  77. color: white
  78. transform: 'translate(0%,-50%)'
  79. pointer-events: none
  80. font-size: 15px
  81. border-right-style: solid
  82. border-color: 'rgb(34, 154, 210)'
  83. - entity: bodymiscale.siham
  84. type: state-label
  85. attribute: height
  86. prefix: 'Taille: '
  87. suffix: ' cm'
  88. style:
  89. top: 55%
  90. right: 1%
  91. color: white
  92. transform: 'translate(0%,-50%)'
  93. pointer-events: none
  94. font-size: 15px
  95. border-right-style: solid
  96. border-color: 'rgb(34, 154, 210)'
  97. - entity: bodymiscale.siham
  98. type: state-label
  99. attribute: age
  100. prefix: 'Age: '
  101. suffix: ' ans'
  102. style:
  103. top: 65%
  104. right: 1%
  105. color: white
  106. transform: 'translate(0%,-50%)'
  107. pointer-events: none
  108. font-size: 15px
  109. border-right-style: solid
  110. border-color: 'rgb(34, 154, 210)'
  111. - entity: bodymiscale.siham
  112. type: state-label
  113. attribute: gender
  114. prefix: 'Genre: '
  115. style:
  116. top: 75%
  117. right: 1%
  118. color: white
  119. transform: 'translate(0%,-50%)'
  120. pointer-events: none
  121. font-size: 15px
  122. border-right-style: solid
  123. border-color: 'rgb(34, 154, 210)'
  124. - entity: input_boolean.bodyscale_aurelien_info_toggle
  125. icon: 'mdi:alpha-a-circle'
  126. style:
  127. top: 85%
  128. left: 25%
  129. transform: 'translate(-50%, 0) scale(1.15, 1.15)'
  130. '--paper-item-icon-color': white
  131. '--paper-item-icon-active-color': 'rgb(34, 154, 210)'
  132. tap_action:
  133. action: toggle
  134. title: Aurélien
  135. type: state-icon
  136. - entity: input_boolean.bodyscale_siham_info_toggle
  137. icon: 'mdi:alpha-s-circle'
  138. style:
  139. top: 85%
  140. left: 75%
  141. transform: 'translate(-50%, 0) scale(1.15, 1.15)'
  142. '--paper-item-icon-color': white
  143. '--paper-item-icon-active-color': 'rgb(34, 154, 210)'
  144. tap_action:
  145. action: toggle
  146. title: Siham
  147. type: state-icon
  148. image: /local/bodyscale/miscale2.jpg?v=2
  149. type: picture-elements
  150. - card:
  151. entities:
  152. - entities:
  153. - attribute: Water
  154. entity: bodymiscale.aurelien
  155. unit: '%'
  156. icon: 'file:water'
  157. style: |
  158. :host {
  159. --paper-item-icon-color:
  160. {% set water = state_attr('bodymiscale.aurelien', 'Water') | float %}
  161. {% if 0 < water < 55 %}orange;
  162. {% elif 55.01 <= water <= 65.1 %}green;
  163. {% else %}darkgreen;
  164. {% endif %};
  165. }
  166. name: Eau
  167. type: 'custom:multiple-entity-row'
  168. - attribute: Visceral fat
  169. entity: bodymiscale.aurelien
  170. icon: 'file:visceral_fat'
  171. style: |
  172. :host {
  173. --paper-item-icon-color:
  174. {% set visceral_fat = state_attr('bodymiscale.aurelien', 'Visceral fat') | float %}
  175. {% if 0 < visceral_fat < 10 %}green;
  176. {% elif 10.01 <= visceral_fat <= 15 %}orange;
  177. {% else %}orangered;
  178. {% endif %};
  179. }
  180. name: Graisse viscérale
  181. type: 'custom:multiple-entity-row'
  182. - attribute: Body fat
  183. entity: bodymiscale.aurelien
  184. unit: '%'
  185. icon: 'file:body_fat'
  186. style: |
  187. :host {
  188. --paper-item-icon-color:
  189. {% set body_fat = state_attr('bodymiscale.aurelien', 'Body fat') | float %}
  190. {% if 0 < body_fat < 12 %}blue;
  191. {% elif 12.01 <= body_fat <= 18 %}royalblue;
  192. {% elif 18.01 <= body_fat <= 23 %}green;
  193. {% elif 23.01 <= body_fat <= 28 %}orange;
  194. {% else %}orangered;
  195. {% endif %};
  196. }
  197. name: Graisse corporelle
  198. type: 'custom:multiple-entity-row'
  199. - attribute: BMI
  200. entity: bodymiscale.aurelien
  201. icon: 'file:bmi'
  202. style: |
  203. :host {
  204. --paper-item-icon-color:
  205. {% set bmi = state_attr('bodymiscale.aurelien', 'BMI') | float %}
  206. {% if 0 < bmi < 18.4 %}blue;
  207. {% elif 18.5 <= bmi <= 25 %}green;
  208. {% elif 25.01 <= bmi <= 28 %}orange;
  209. {% elif 28.01 <= bmi <= 32 %}orangered;
  210. {% else %}red;
  211. {% endif %};
  212. }
  213. name: IMC
  214. type: 'custom:multiple-entity-row'
  215. - attribute: Muscle mass
  216. entity: bodymiscale.aurelien
  217. unit: kg
  218. icon: 'file:muscle_mass'
  219. style: |
  220. :host {
  221. --paper-item-icon-color:
  222. {% set muscle_mass = state_attr('bodymiscale.aurelien', 'Muscle mass') | float %}
  223. {% if 0 < muscle_mass < 49.40 %}orangered;
  224. {% elif 49.41 <= muscle_mass <= 59.50 %}green;
  225. {% else %}darkgreen;
  226. {% endif %};
  227. }
  228. name: Muscle
  229. type: 'custom:multiple-entity-row'
  230. - attribute: Protein
  231. entity: bodymiscale.aurelien
  232. unit: '%'
  233. icon: 'file:protein'
  234. style: |
  235. :host {
  236. --paper-item-icon-color:
  237. {% set protein = state_attr('bodymiscale.aurelien', 'Protein') | float %}
  238. {% if 0 < protein < 16 %}orangered;
  239. {% elif 16.01 <= protein <= 20 %}green;
  240. {% else %}darkgreen;
  241. {% endif %};
  242. }
  243. name: Protéine
  244. type: 'custom:multiple-entity-row'
  245. - attribute: Basal metabolism
  246. entity: bodymiscale.aurelien
  247. unit: kcal
  248. icon: 'file:basal_metabolism'
  249. style: |
  250. :host {
  251. --paper-item-icon-color: green;
  252. }
  253. name: Métabolisme de base
  254. type: 'custom:multiple-entity-row'
  255. - attribute: Bone mass
  256. entity: bodymiscale.aurelien
  257. unit: kg
  258. icon: 'file:bone_mass'
  259. style: |
  260. :host {
  261. --paper-item-icon-color:
  262. {% set bone_mass = state_attr('bodymiscale.aurelien', 'Bone mass') | float %}
  263. {% if 0 < bone_mass < 2 %}orangered;
  264. {% elif 2.01 <= bone_mass <= 4.20 %}green;
  265. {% else %}darkgreen;
  266. {% endif %};
  267. }
  268. name: Masse osseuse
  269. type: 'custom:multiple-entity-row'
  270. - attribute: Metabolic age
  271. entity: bodymiscale.aurelien
  272. unit: ans
  273. icon: 'file:metabolic_age'
  274. style: |
  275. :host {
  276. --paper-item-icon-color: green
  277. }
  278. name: Age corporel
  279. type: 'custom:multiple-entity-row'
  280. - attribute: Ideal
  281. entity: bodymiscale.aurelien
  282. unit: kg
  283. icon: 'file:ideal'
  284. style: |
  285. :host {
  286. --paper-item-icon-color:
  287. {% set ideal = state_attr('bodymiscale.aurelien', 'weight') | float %}
  288. {% if 0 < ideal < 57.30 %}blue;
  289. {% elif 57.31 <= ideal <= 77.40 %}green;
  290. {% elif 77.41 <= ideal <= 86.70 %}orange;
  291. {% elif 86.71 <= ideal <= 99.10 %}orangered;
  292. {% else %}red;
  293. {% endif %};
  294. }
  295. name: Poids idéal
  296. type: 'custom:multiple-entity-row'
  297. - attribute: Body type
  298. entity: bodymiscale.aurelien
  299. icon: 'file:body_type'
  300. style: |
  301. :host {
  302. --paper-item-icon-color:
  303. {% set body_type = state_attr('bodymiscale.aurelien', 'Body type') %}
  304. {% if body_type == "Skinny" %}blue;
  305. {% elif body_type == "Balanced-skinny" %}royalblue;
  306. {% elif body_type == "Skinny-muscular" %}royalblue;
  307. {% elif body_type == "Balanced" %}green;
  308. {% elif body_type == "Balanced-muscular" %}green;
  309. {% elif body_type == "Lack-exerscise" %}orange;
  310. {% elif body_type == "Thick-set" %}orangered;
  311. {% elif body_type == "Obese" %}red;
  312. {% elif body_type == "Overweight" %}red;
  313. {% else %}white;
  314. {% endif %};
  315. }
  316. name: Corpulence
  317. type: 'custom:multiple-entity-row'
  318. head: bodymiscale.aurelien
  319. type: 'custom:fold-entity-row'
  320. show_header_toggle: false
  321. title: Aurélien Score du corps
  322. type: entities
  323. conditions:
  324. - entity: input_boolean.bodyscale_aurelien_info_toggle
  325. state: 'on'
  326. type: conditional
  327. - card:
  328. entities:
  329. - entities:
  330. - attribute: Water
  331. entity: bodymiscale.siham
  332. icon: 'file:water'
  333. unit: '%'
  334. style: |
  335. :host {
  336. --paper-item-icon-color:
  337. {% set water = state_attr('bodymiscale.siham', 'Water') | float %}
  338. {% if 0 < water < 45 %}orange;
  339. {% elif 45.01 <= water <= 60.1 %}green;
  340. {% else %}darkgreen;
  341. {% endif %};
  342. }
  343. name: Eau
  344. type: 'custom:multiple-entity-row'
  345. - attribute: Visceral fat
  346. entity: bodymiscale.siham
  347. icon: 'file:visceral_fat'
  348. style: |
  349. :host {
  350. --paper-item-icon-color:
  351. {% set visceral_fat = state_attr('bodymiscale.siham', 'Visceral fat') | float %}
  352. {% if 0 < visceral_fat < 10 %}green;
  353. {% elif 10.01 <= visceral_fat <= 15 %}orange;
  354. {% else %}orangered;
  355. {% endif %};
  356. }
  357. name: Graisse viscérale
  358. type: 'custom:multiple-entity-row'
  359. - attribute: Body fat
  360. entity: bodymiscale.siham
  361. unit: '%'
  362. icon: 'file:body_fat'
  363. style: |
  364. :host {
  365. --paper-item-icon-color:
  366. {% set body_fat = state_attr('bodymiscale.siham', 'Body fat') | float %}
  367. {% if 0 < body_fat < 12 %}blue;
  368. {% elif 12.01 <= body_fat <= 18 %}royalblue;
  369. {% elif 18.01 <= body_fat <= 23 %}green;
  370. {% elif 23.01 <= body_fat <= 28 %}orange;
  371. {% else %}orangered;
  372. {% endif %};
  373. }
  374. name: Graisse corporelle
  375. type: 'custom:multiple-entity-row'
  376. - attribute: BMI
  377. entity: bodymiscale.siham
  378. icon: 'file:bmi'
  379. style: |
  380. :host {
  381. --paper-item-icon-color:
  382. {% set bmi = state_attr('bodymiscale.siham', 'BMI') | float %}
  383. {% if 0 < bmi < 18.4 %}blue;
  384. {% elif 18.5 <= bmi <= 25 %}green;
  385. {% elif 25.01 <= bmi <= 28 %}orange;
  386. {% elif 28.01 <= bmi <= 32 %}orangered;
  387. {% else %}red;
  388. {% endif %};
  389. }
  390. name: IMC
  391. type: 'custom:multiple-entity-row'
  392. - attribute: Muscle mass
  393. entity: bodymiscale.siham
  394. unit: kg
  395. icon: 'file:muscle_mass'
  396. style: |
  397. :host {
  398. --paper-item-icon-color:
  399. {% set muscle_mass = state_attr('bodymiscale.siham', 'Muscle mass') | float %}
  400. {% if 0 < muscle_mass < 36.50 %}orangered;
  401. {% elif 36.51 <= muscle_mass <= 42.60 %}green;
  402. {% else %}darkgreen;
  403. {% endif %};
  404. }
  405. name: Muscle
  406. type: 'custom:multiple-entity-row'
  407. - attribute: Protein
  408. entity: bodymiscale.siham
  409. unit: '%'
  410. icon: 'file:protein'
  411. style: |
  412. :host {
  413. --paper-item-icon-color:
  414. {% set protein = state_attr('bodymiscale.siham', 'Protein') | float %}
  415. {% if 0 < protein < 16 %}orangered;
  416. {% elif 16.01 <= protein <= 20 %}green;
  417. {% else %}darkgreen;
  418. {% endif %};
  419. }
  420. name: Protéine
  421. type: 'custom:multiple-entity-row'
  422. - attribute: Basal metabolism
  423. entity: bodymiscale.siham
  424. unit: kcal
  425. icon: 'file:basal_metabolism'
  426. style: |
  427. :host {
  428. --paper-item-icon-color: green;
  429. }
  430. name: Métabolisme de base
  431. type: 'custom:multiple-entity-row'
  432. - attribute: Bone mass
  433. entity: bodymiscale.siham
  434. unit: kg
  435. icon: 'file:bone_mass'
  436. style: |
  437. :host {
  438. --paper-item-icon-color:
  439. {% set bone_mass = state_attr('bodymiscale.siham', 'Bone mass') | float %}
  440. {% if 0 < bone_mass < 2 %}orangered;
  441. {% elif 2.01 <= bone_mass <= 4.20 %}green;
  442. {% else %}darkgreen;
  443. {% endif %};
  444. }
  445. name: Masse osseuse
  446. type: 'custom:multiple-entity-row'
  447. - attribute: Metabolic age
  448. entity: bodymiscale.siham
  449. unit: ans
  450. icon: 'file:metabolic_age'
  451. style: |
  452. :host {
  453. --paper-item-icon-color: green
  454. }
  455. name: Age corporel
  456. type: 'custom:multiple-entity-row'
  457. - attribute: Ideal
  458. entity: bodymiscale.siham
  459. unit: kg
  460. icon: 'file:ideal'
  461. style: |
  462. :host {
  463. --paper-item-icon-color:
  464. {% set ideal = state_attr('bodymiscale.siham', 'weight') | float %}
  465. {% if 0 < ideal < 51 %}blue;
  466. {% elif 51.01 <= ideal <= 69 %}green;
  467. {% elif 69.01 <= ideal <= 77 %}orange;
  468. {% elif 77.01 <= ideal <= 88 %}orangered;
  469. {% else %}red;
  470. {% endif %};
  471. }
  472. name: Poids idéal
  473. type: 'custom:multiple-entity-row'
  474. - attribute: Body type
  475. entity: bodymiscale.siham
  476. icon: 'file:body_type'
  477. style: |
  478. :host {
  479. --paper-item-icon-color:
  480. {% set body_type = state_attr('bodymiscale.siham', 'Body type') %}
  481. {% if body_type == 'Skinny' %}blue;
  482. {% elif body_type == 'Balanced-skinny' %}royalblue;
  483. {% elif body_type == 'Skinny-muscular' %}royalblue;
  484. {% elif body_type == 'Balanced' %}green;
  485. {% elif body_type == 'Balanced-muscular' %}green;
  486. {% elif body_type == 'Lack-exerscise' %}orange;
  487. {% elif body_type == 'Thick-set' %}orangered;
  488. {% elif body_type == 'Obese' %}red;
  489. {% elif body_type == 'Overweight' %}red;
  490. {% else %}white;
  491. {% endif %};
  492. name: Corpulence
  493. type: 'custom:multiple-entity-row'
  494. head: bodymiscale.siham
  495. type: 'custom:fold-entity-row'
  496. show_header_toggle: false
  497. title: Siham Score du corps
  498. type: entities
  499. conditions:
  500. - entity: input_boolean.bodyscale_siham_info_toggle
  501. state: 'on'
  502. type: conditional
  503. type: vertical-stack
  504. type: vertical-stack
  505.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement