Homekit Infused 5 (HKI) v2023.1.3

Hi, is there someway to debug why a view isn’t loading? I am following the examples from your personal HKI… I have a Climate and Security views that are working great. I copied your media_media_view and updated it for my entities. It won’t show up. I then tried to simplify to debug with the following, and nothing shows up. I’m probably doing something stupid. Any suggestions?

    # Media Players
  test_media:
    media_players:
      - title: Alexa
        entities:
          - media_player.front_office
  test_media: # This part is also the path of the view
    media_players:

Please check if your path in your browser matches the name set here, so in your case https://ha.yourdomain.com/homekit-infused/test_media

https://10.0.0.140:8124/homekit-infused/test_media gives an error; nothing found. I don’t even see a link/button on the main view to navigate to that.

Thanks

Stupid question, but did you restart after the change?

Sure did, several times… and not a stupid question… I’ve forgotten that before :slight_smile:

Ok, well then I would probably need more code to look upon (sharing your view_config.yaml would give all the information I need to look at).

If you prefer to do this privately you can either send it via a PM or join our discord server (link at the top of this thread or on my repo).

no worries, here it is… thanks! It’s very alpha-- in work… commenting a lot of your stuff out so I can get to a starting point to customize my own.

view_config: # For examples check out https://github.com/jimz011/homekit-infused/tree/4.x.x-personal

# Home
  home:
    title: greeting
    show_in_navbar: true
    show_in_menu: false
    columns:
      buttons: 4
    persons:
      - columns: 2
        square: true
        entities:
          - entity: person.tammy
            text_color: white
            image_path: /local/images/tammy.jpg
            phone_battery_sensor: sensor.tammy_s_phone_battery_level
            travel_time_to_home: sensor.tammy_s_phone_travel_time
      #      travel_time_to_work: sensor.reistijd_stephanie_work
      #      path: tammys_location
          - entity: person.jim
            alignment: right
            text_color: white
            image_path: /local/images/jim.jpg
            phone_battery_sensor: sensor.jims_iphone_battery_level
            travel_time_to_home: sensor.jims_iphone_travel_time
      #      travel_time_to_work: sensor.reistijd_jimmy_work
      #      path: jims_location
    simple_weather:
      - entity: weather.pirateweather
        city_name: Fort Worth
    favorites:
      show_title: false

  menu:
    show_in_navbar: true
    show_in_menu: false
    icon: mdi:apps
    subtitle: "[[[ return `Homekit Infused Version: ${states['sensor.hki_current_version'].state}`; ]]]"
    search:
    favorites:
    menu:
    columns:
      buttons: 4
    hki_menu:

######### GENERIC VIEWS ####################################################################################################

# Climate
  climate:
    subtitle: "[[[ return `The current average temperature is ${states['sensor.main_floor_temperature'].state}` ]]]"  #avg temp.
    columns:
      thermostats: 4
      graphs: 4
    icon: mdi:thermometer
    show_in_favorites: true
    button_badge: sensor.main_floor_temperature  #make an average sensor.  Add current climate
    button_label: "[[[ if (states['sensor.current_climate_entities_on'].state == 0) return `Thermostats Off`; else return `${states['sensor.current_climate_entities_on'].state} Thermostats On`; ]]]"
    climate:
      controls:
        title: Controls
      thermostats:
        - title: Thermostats
          entities:
            - climate.main_floor
            - climate.bedroom
    devices:
      - title: Fans
        entities:
          - entity: fan.artemis
            type: fan
    graphs:
      - title: Temperature
        type: button
        line_color: cyan
        entities:
          - sensor.main_floor_temperature
          - sensor.bedroom_temperature
          - sensor.blink_front_porch_left_temperature
          - sensor.blink_front_door_right_temperature
          - sensor.blink_side_entrance_temperature
          - sensor.blink_deck_temperature
      - title: Humidity
        type: button
        line_color: purple
        entities:
          - sensor.bedroom_humidity
          - sensor.main_floor_humidity
  #    - title: Pressure
  #      type: button
  #      line_color: orange
  #      entities:
  #        - sensor.slaapkamer_3
  #        - sensor.badkamer_3

  # Security
  security:
    subtitle: "[[[ return `Alarm ${states['alarm_control_panel.home_fort_worth_alarm'].state}`; ]]]"
    columns:
      cameras: 1
      buttons: 4
    icon: mdi:cctv
    show_in_favorites: true
    button_badge: sensor.current_binary_sensors_on
    button_label: "[[[ return `Alarm ${states['alarm_control_panel.home_fort_worth_alarm'].state}`; ]]]"
    cameras:
      - title: Blink Camera's
        entities:
          - camera.blink_front_porch_left
          - camera.blink_front_porch_right
          - camera.blink_side_entrance
          - camera.blink_deck
      - title: Ring Camera
        entities:
          - camera.front_door_snapshot
    devices:
      - title: Motion
        entities:   #RENAME THESE
          - binary_sensor.front_door_motion
          - binary_sensor.front_door_motion_2
          - binary_sensor.hallway_motion
          - binary_sensor.bedroom_motion
          - binary_sensor.blink_front_porch_left_motion_detected
          - binary_sensor.blink_front_porch_right_motion_detected
          - binary_sensor.blink_side_entrance_motion_detected
          - binary_sensor.blink_deck_motion_detected
      - title: Doors
        entities:  #RENAME THESE
          - binary_sensor.back_door-
          - binary_sensor.kitchen_door
          - binary_sensor.side_door
#      - title: Windows
#        entities:
#          - binary_sensor.kleine_kamerraam
#          - binary_sensor.keukenraam
#          - binary_sensor.bijkeukenraam
      - title: Smoke/CO Detectors
        entities: #RENAME THESE
          - binary_sensor.first_alert_smoke_alarm_1
          - binary_sensor.first_alert_smoke_alarm_2

    # Media Players
  test_media:
    media_players:
      - title: Alexa
        entities:
          - media_player.front_office

Well it seems absolutely fine to me, so not sure why it doesn’t work. But your code looks absolutely fine to me. I even tested it myself on my own setup with your mediaplayer code (I obviously edited the entity). It works fine. It even shows inside of the menu (note that the frontpage shortcuts are NOT considered the menu, the menu can be accessed by pressing the menu button). Does it not show for you there either?

Can you at least get to the page at all? If yes then I should mention that only dark themes will show them properly for now (srry a bug). Light themes will show a white rectangle instead with a title above the rectangle. If no? Then remove everything except for the home/menu views and just add the media_test view and see if that works. You might want to add the following line to make it a bit easier for you since that will create a shortcut on the home page.

  test_media:
    show_in_favorites: true
    media_players:
      - title: Alexa
        entities:
          - media_player.front_office

Ah! It does show in the Menu, but not on the main page where climate, security, etc. shows. Also do have the but with light themes :). Is it only supposed to show in the menu?

Thanks!

I updated my config to my full media player config… and now nothing shows up again under Menu… really weird. Here’s the code. I commented out most of the players to try and debug.

  media_media_players:
    title: Media
#    subtitle: "[[[ if (states['sensor.media_players_playing'].state == 'Playing') return `A media player is playing right now`; else return `All mediaplayers have stopped playing`; ]]]"
    columns:
      buttons: 4
    icon: mdi:plex
#    button_badge: sensor.media_players_playing
    view_selector:
      columns: 3
      aspect_ratio: 3/1
      elements:
        - name: Alexa
          icon: mdi:animation-play
          path: media_media_players
          this_view: true
    media_players:
      - title: Alexa
        entities:
          - media_player.living_room

When using the view selector you will have to add that same addon to multiple views. Because of this HKI will not add these to the menu, since that would create a menu entry for each sub view you have created (at least that is what its intended to do).

To solve this problem, make sure to set show_in_menu: true on at least one view. Make it the view that will be opened by default when clicking on that item. Ofc if you want each of those views to showup in the menu, add the line to all views.

To solve the problem of a weird title in the menu button, use the title line for that view.

Got it, thanks. Is there any way to have the Media Player show up on the main view as well instead of just the menu?

Really love your framework… looking forward to customizing after I learn the ins and outs!

Jim

use the favorites addon, it is enabled on the frontpage by default unless you commented it.

Add show_in_favorites: true to your view.

Ah… well that’s obvious now :slight_smile: I had stuck in my head that ‘menu’ meant the menu you navigate to by hitting the navigation bar… duh… thanks! It’s so clear now!

HI , I want to increase the size of the button ( light , device … ) but I don’t know where is the parameter …
THX to all for your help

:slight_smile: another little question, in the notification section , in light tab , the text "… light is on " is in English. is it possible to put the text in French ? thx for your help

Yes you can fully change each name or given word. You will have to do it yourself though.

You can find perfect examples within my personal config (link in the first post).

The button size can be changed by either setting a maximum number of buttons in a row (e.g. 2) by using the columns addon. You can also change button size by using aspect_ratio within the devices addon.

This doesn’t always work as expected unfortunately, but I am currently reworking HKI to fix a lot of these issues. This will unfortunately take some time, so dont expect it this month, but maybe next month March. However the current version is pretty stable, so dont hesitate to use it already.

I have a question regarding grid templating… as described in docs I used the following view:

 home_temp:
   layout:
     type: custom:grid-layout
     options:
       - grid-template-columns: auto 30px 25%
         grid-template-rows: auto
         grid-template-areas: |
           "header header header"
           "main . sidebar"
           "footer footer footer"

How I can assign addons to different places (i.e., main, sidebar, etc…)?

As reported in this link (from the documentation), I tried by adding the following statement both to standard addons and custom cards (the newer ones) but I had no success

        view_layout:
          grid-area: sidebar

Any hints?
Thanks

This has not yet been implemented, though good news, this is planned.
If you desperately need it now, it is available but only with the custom addon.

Not in hurry… thanks for quick answer, I’ll wait for a release.
But just to understand when you refer to custom addons you mean it is already implemented in current master version, or you refer to a development version? Because I tried with no success with a custom card like this:

- title: customcard
  cards:
    - type: markdown
      content: text 1
      view_layout:
          grid-area: sidebar
    - type: markdown
      content: text2
      view_layout:
          grid-area: footer

and even with

      grid:
        grid-area: sidebar

but no luck in both cases