diff --git a/configuration.yaml b/configuration.yaml index 0bdcd4b..25251c8 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -60,7 +60,7 @@ scene: !include scenes.yaml homekit: !include homekit.yaml group: !include group.yaml mqtt: !include mqtt.yaml -plant: !include plant.yaml +#plant: !include plant.yaml # +----------------------------------------------------------------------------+ # | This is for the container health check | diff --git a/homeos.yaml b/homeos.yaml index f041b15..6ec929b 100644 --- a/homeos.yaml +++ b/homeos.yaml @@ -59,7 +59,6 @@ homeos_configuration: scene4: &config_scene4 'input_boolean.homeos_scene_morning_coffee' scene4_icon: &config_scene4_icon 'icon_empty' - # Garbage Card Configuration garbage: &config_garbage 'schedule.garbage' recyling: &config_recycling 'schedule.recycle' @@ -73,8 +72,15 @@ homeos_configuration: travel_work: &config_travel_work 'sensor.seb_to_work' -# Plant Card - hum_plant_1: &config_hum_plant_1 'sensor.flower_care_hhccjcy01hhcc_moi_2' +# Plant Card 1 + plant_1: &config_plant_1 'plant.pin_de_norfolks' + hum_plant_1: &config_hum_plant_1 'sensor.pin_de_norfolks_soil_moisture' + min_plant_1: &config_min_plant_1 'number.pin_de_norfolks_min_soil_moisture' + +# Plant Card 2 + plant_2: &config_plant_2 'plant.anthurium_2' + hum_plant_2: &config_hum_plant_2 'sensor.anthurium_soil_moisture_2' + min_plant_2: &config_min_plant_2 'number.anthurium_min_soil_moisture_2' # ============================================================================== # | Do not change code after this box | @@ -383,7 +389,7 @@ views: grid-template-areas: | "weather weather map map map map person_car person_bus" "weather weather map map map map garbage washer" - "weather weather map map map map plant ." + "weather weather map map map map . plant" "calendar calendar map map map map 4 ." "calendar calendar box box scene . 5 ." @@ -606,29 +612,69 @@ views: - sensor.seventeentrack_packages_ready_to_be_picked_up - sensor.seventeentrack_packages_in_transit - # +----------------------------------------------------------------------------+ # | Plant Area Definition | # +----------------------------------------------------------------------------+ + - type: custom:mod-card + view_layout: + grid-area: plant + style: + .: > + :host { + margin: 0px !important; + } + swipe-card: + $: | + .swiper-container { + box-shadow: var(--homeos-card-box-shadow); + border-radius: var(--homeos-card-border-radius); + background-color: var(--homeos-card-background); + backdrop-filter: var(--homeos-card-backdrop-filter); + border-style: var(--homeos-card-border-style); + border-color: var(--homeos-card-border-color); + border-width: var(--homeos-card-border-width); + } + .swiper-pagination { + bottom: 0vw !important; + } + .swiper-pagination-bullet-active { + --swiper-pagination-color: var(--homeos-icon-color-primary) !important; + opacity: 0.6 !important; + width: 0.5vw; + height: 0.5vw; + } + .swiper-pagination-bullets>span { + width: 0.5vw; + height: 0.5vw; + background: var(--homeos-icon-color-primary); + } + card: + type: custom:swipe-card + start_card: 1 + reset_after: 10 + parameters: + effect: cards + spaceBetween: 10 + pagination: + type: "bullets" + clickable: true + cards: + + - type: custom:button-card + entity: *config_hum_plant_1 + variables: + var_custom_name: *config_plant_1 + min_hum: *config_min_plant_1 + template: + - template_plant + + - type: custom:button-card + entity: *config_hum_plant_2 + variables: + var_custom_name: *config_plant_2 + min_hum: *config_min_plant_2 + template: + - template_plant - # - type: custom:mod-card - # view_layout: - # grid-area: plant - # style: | - # ha-card { - # display: contents; - # } - # :host { - # margin: 0px !important; - # } - # card: - # type: custom:swipe-card - # parameters: - # effect: cards - # spaceBetween: 8 - # pagination: - # type: "bullets" - # clickable: true - # cards: - # - type: custom:button-card - # entity: *config_hum_plant_1 \ No newline at end of file + + \ No newline at end of file diff --git a/homeos_module/calendar/calendar_card.yaml b/homeos_module/calendar/calendar_card.yaml index 099ec9e..690c463 100644 --- a/homeos_module/calendar/calendar_card.yaml +++ b/homeos_module/calendar/calendar_card.yaml @@ -79,6 +79,7 @@ custom_fields: showDatePerEvent: true # Show the date next to each event entry hideFinishedEvents: true # if set true will hide any finished events showAllDayHours: true # Show “All Day” text under full day events + showHiddenText: false # Show x hidden events when limited number of events selected europeanDate: true titleLength: 30 fullDayEventText: 'toute la journée' diff --git a/homeos_module/plant/plant_card.yaml b/homeos_module/plant/plant_card.yaml index e69de29..305cf0d 100644 --- a/homeos_module/plant/plant_card.yaml +++ b/homeos_module/plant/plant_card.yaml @@ -0,0 +1,63 @@ +template_plant: + show_entity_picture: false + show_name: false + show_state: true + show_label: true + show_icon: false + styles: + card: + - border-radius: var(--homeos-card-border-radius) + - background: > + [[[ + return 'left top / contain no-repeat fixed url(' + states[variables.var_custom_name].attributes["entity_picture"] + ')' + ]]] + - border-style: none + - height: var(--homeos-card-grid-square) + - width: var(--homeos-card-grid-square) + grid: + - grid-template-areas: | + ". icon custom_name custom_name" + ". s s d" + ". l l ." + - grid-template-columns: 1vw 1vw 6vw 1fr + - grid-template-rows: 2vw 3.5vw 3.8vw + state: + - justify-self: left + - font-size: 2.1vw + - font-weight: 400 + label: + - font-size: 1vw + - white-space: normal + - text-align: left + - align-self: end + + custom_fields: + icon: + - opacity: 0.6 + custom_name: + - font-size: 1vw + - justify-self: left + - opacity: 0.6 + - padding-left: 0.3vw + + label: > + [[[ + if (entity.state <= states[variables.min_hum].state ) { + return 'Arroser maintenant' ; + } + return 'Arroser dans quelques jours'; + ]]] + + custom_fields: + custom_name: > + [[[ return states[variables.var_custom_name].attributes["friendly_name"] ]]] + + icon: > + + + + diff --git a/packages/plant_package.yaml b/packages/plant_package.yaml new file mode 100644 index 0000000..5569870 --- /dev/null +++ b/packages/plant_package.yaml @@ -0,0 +1,23 @@ +plant: + MiFlora_Pin: + name: Pin de Norfolks + sensors: + moisture: sensor.flower_care_hhccjcy01hhcc_moi + temperature: sensor.flower_care_hhccjcy01hhcc_tempc + conductivity: sensor.flower_care_hhccjcy01hhcc_fer + brightness: sensor.flower_care_hhccjcy01hhcc_lux + min_moisture: 15 + min_conductivity: 350 + min_temperature: 5 + + + MiFlora_Anthurium: + name: Anthurium + sensors: + moisture: sensor.flower_care_hhccjcy01hhcc_moi_2 + temperature: sensor.flower_care_hhccjcy01hhcc_tempc_2 + conductivity: sensor.flower_care_hhccjcy01hhcc_fer_2 + brightness: sensor.flower_care_hhccjcy01hhcc_lux_2 + min_moisture: 15 + min_conductivity: 350 + min_temperature: 15 \ No newline at end of file diff --git a/themes/homeos/general_theme.yaml b/themes/homeos/general_theme.yaml index 20197f1..525d911 100644 --- a/themes/homeos/general_theme.yaml +++ b/themes/homeos/general_theme.yaml @@ -24,6 +24,7 @@ homeos: homeos-card-border-radius: 2.5vw homeos-card-box-shadow: 0px 0px 0.5vw 0vw rgba(0,0,0,0.6) homeos-card-border-style: solid + homeos-card-border-width: 1px # +----------------------------------------------------------------------------+ # | Apple Fonts | diff --git a/www/homeos/plant_media/Anthurium.png b/www/homeos/plant_media/Anthurium.png new file mode 100644 index 0000000..08d971f Binary files /dev/null and b/www/homeos/plant_media/Anthurium.png differ diff --git a/www/homeos/plant_media/Norfolk-Pine.png b/www/homeos/plant_media/Norfolk-Pine.png new file mode 100644 index 0000000..78c7efc Binary files /dev/null and b/www/homeos/plant_media/Norfolk-Pine.png differ