Homekit Infused 5 (HKI) v2023.1.3

well, they are different… Tradfri lights push their state, and Hue needs to be pulled. Which is exactly the issue, because this results in timing issues, and many people ask the polling period to Hub to be upped (it now is 5 seconds) while the dev’s state that would overtask the system even further, and Hue needs to change their Api to a push api…

I use both systems extensively, and have many lights, of all types. So, I suppose ones mileage may vary, and having a bigger setup, brings more issues to the light (pun intended…)

About the Deconz: I have tested it but sent it back, it was of no use, since I couldn’t get it to recognize anything. Maybe that had to do with the state of my Pi at that time and I should give it another go.

I now have the new Rpi4 with 4 gig mem. Performance has upped immensely, and processor usage went down big time. So the Deconz might be better recognized now. Then again, Hue is also responding better :wink:

Getting back to your repo now :slight_smile: : I will keep a tight eye on it, since you rely a lot on these generic templates and auto filter cards. techniques that look magical and make the config a lot smaller, maybe even easier to maintain. In my experience though it has proven to be cleaner and lighter for the processor and system performance overall to be as dedicated as possible in each config. Also, creating a dedicated template sensor (in the backend) and using the state of that sensor in a Lovelace card seems to be leaner than having all of these templates in the Lovelace card config…

cheers!

That snippet isnt that complex, and it has more to do with the fact it constantly has to check all lights. In that it is much the same as the monster card, or the auto entities. Which result in the same performance issue (in my setup, used on the light domain). Having then them out solved that immediately.

Hello, I have posted on this thread earlier as well and I keep coming back to it. I really like the frontend presented by Jim and if I am able to make my setup even 10% of HKI, i think I will extremely happy.
That said the github repo overwhelms me. I am afraid that I will not be able to do it right and end up breaking HA itself. I have tried to start a few times but could not go beyond installing HACS and customs components manually.
Can someone share a ELI5 type instructions on how to proceed without breaking HA.
Thank you

You will not break anything, just don’t overwrite your files… Just do it step by step, just load custom component, test one first, then restart, then load a resource, just see how it goes…

You don’t need hacs if you are not familiar with it, just have a look what components you need, make sure they all load correctly, then start with Lovelace

1 Like

I tried… so many errors… :sob:
commented lovelace/mode:yaml atleast it brings the UI back to before.

I will keep watching this thread hoping to understand it someday.

Off course you will see so many errors, that’s normal… We all have different entities… If you don’t use them, wipe them out of the config otherwise you need to rename.

This kit is not like an add-on that you can use, if you want to complete merge, make sure you have 2 days spare time

@jimz011 I saw somewhere that you had tried swipe-card within popup cards. Just curious if you had any success? If not… do you have any code that you tried laying around? I am planning to jump into the water and give it a try and a few other ideas I’ve been knocking around in my head. Just thought I’d ask. Thanks in advance :wink:

As far as I remember this worked okayish. (I don’t use it in that fashion anymore as views do their work a lot better for this purpose). The problem with swipe-card is that you basically can not have buttons on them as swiping them will click them. You can find a modified file on my repo somewhat fixing that problem (called swipe-card.js) but it is an ugly hacky way that I have found in a PR of their repo.

I do not know if I still have that code, but if I do you might be able to find it on one of my repositories (I highly doubt it though as I don’t remember using it for long as it limits too much things for me, but yes I had them in my setup at one point. If I find such a piece of code in some of my old files I will post them to you.

1 Like

So, I was absent lately (except for some posts on the forums) but ofc with good reasons. So to tell you where the future is going with this project and the youtube channel I am here to explain, Enjoy!

2 Likes

While you guys wait for my next update, I have to show and ask you something.

This is the current theme:

This is the same theme with a shadow underneath.

Which one do you guys prefer?

And as a surprise even if you can’t choose, it will be a simple selector to choose if you want shadows or not.

At the same time please have a look at one of the new themes included in the next update.
They are not my favorite colors, but hey maybe there are people that do like it. All of this will be selectable within lovelace once installed and no restarts or reloads will be required to use this.

I prefer the cleaner look without shadows.

I do like the buttons to float a bit, not as much have as big a shadow as you now suggest, but yes, floating them seems much more tactile.
using this myself:

      - box-shadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)'

on all buttons.

55

I must have seen a shortcut for that somewhere, something like shadow: elevation 6px, but cant seem to find it right now…

btw about dynamic icons and colors you mention in your video. Ive been doing that ever since I started with Ha, using customize and custom_ui.

using things like this in the customize_glob:

homeassistant:
  customize_glob:
    sensor.*_lux: #_motion_sensor
      icon: mdi:theme-light-dark
      templates:
        icon_color: >
          if (state < 1) return 'rgb(0,0,0)';
          if (state < 2) return 'rgb(51,0,0)'; 
          if (state < 10) return 'rgb(51,25,0)';
          if (state < 50) return 'rgb(102,51,0)';
          if (state < 150) return 'rgb(153,153,0)';
          if (state < 350) return 'rgb(102,204,0)';
          if (state < 700) return 'rgb(51,255,53)';
          if (state < 2000) return 'rgb(102,255,178)';
          if (state < 7000) return 'rgb(153,255,255)';
          return 'rgb(204, 255, 229)';
      unit_of_measurement: 'Lx'

or

device_tracker.*_bt:
  show_last_changed: true
  templates:
    icon: >
      if (state === 'home') return 'mdi:bluetooth';
      return 'mdi:bluetooth-off';
    icon_color: >
      if (state === 'home') return 'blue';
      return 'grey';

etc etc
makes the rest of your config so much cleaner. Simply use the entities in the Lovelace cards, without the need for extra templates there…

Yes, well I had hardcoded ‘mdi:’ in a lot of places which made using icon templates impossible. I have rewritten a lot of code so that it can accept these templates in my own config.

Actually the shadows under the buttons will become a selector like most theme element will be in my config in the future.

It will be something like this (this is what I am currently testing and it works pretty good)

might have been unprecise… seems the button card takes the templated icon in the backend in to account, but not the icon_color.
will ask @RomRider if this can be done, in the button-card topic

this is a good example:

    sensor.cpu_temperature:
      icon: mdi:thermometer
      templates:
        icon_color: >
          if (state < 60) return 'green';
          if (state < 65) return 'darkgreen';
          if (state < 70) return 'orange';
          if (state < 75) return 'crimson';
          return 'firebrick';

Ah color I wouldn’t know, you can however use a color template within the button card. It is how I show different colors now.

sure, as we do indeed.
It would be so nice the button-card would respect the entity settings for icon and color already available in the system.
This diverges from your topic here though :wink: shall takeout to button-card.

@jimz011
hey quick question, i want to change your template button, your button changes the icon state when the value = on / off, based on that state the button lights up

i have button with state open / closed , so i copy pasted stuff and changed state to code below
it works, button lights up on state open/closed, but the mdi icon colors are not changing … what am i missing?

    - value: "open" 
      '[[variable]]': '[[spin]]'  
      styles:
        card:
          - --ha-card-background: '[[on_card_color]]'
          - opacity: '[[opacity_on]]'
        name:
          - color: '[[on_name_color]]'
        state:
          - color: '[[on_state_color]]'
        lock:
          - color: var(--lock-color-on)
        label:
          - color: '[[on_label_color]]'
    - value: "closed"
      '[[off_variable]]': '[[off_spin]]'
      styles:
        card:
          - opacity: '[[opacity]]'
        icon:
          - color: '[[off_icon_color]]'
        name:
          - color: '[[off_name_color]]'
        state:
          - color: '[[off_state_color]]'
        label:
          - color: '[[off_label_color]]'
          - font-size: '[[label_font_size]]'
          - font-weight: '[[label_font_weight]]'
        lock:
          - color: var(--lock-color-off)

You should add

styles:
  icon:
    - color: yourcolorhere

to your template if you want this, but this will change that for all buttons that uses this state. Honestly you are better off using a color template i.e.

"[[[ if (entity.state < 20) return 'red'; if (entity.state >= 20 && entity.state < 80) return 'orange'; else return 'green'; ]]]"

Use this as the color variable in your decluttering-card. If I am correct this was already templated into the config so you shouldn’t have to change anything.

so it should look like:

  - type: custom:decluttering-card
    template: button
    variables:
      - color: "[[[ if (entity.state < 20) return 'red'; if (entity.state >= 20 && entity.state < 80) return 'orange'; else return 'green'; ]]]"

been trying to find it in your GitHub, but no such luck :wink: could you please point me to it? Id love to try and see if your code works for my HA setup also, without compromising performance.

It is not yet available on my repo. A few more days and I will post the update here.

Hello HA community, a little update: HKI 0.13.0 will be released within 36 hours! Prepare your schedules as this update will take up a bit of your time. With some exciting new features on the way.

Thank you for your patience!

1 Like