Homekit Infused (HKI) v2.0.0b10 - Updated 03/05/2020

Tags: #<Tag:0x00007f77fbdd3f18>

I do have packages, but I’m guessing you are looking at my personal branch?

Clicking this link will take you to the correct branch which is the master branch. The personal branch is only meant to find examples if you’d want to create automations and such.

Right… Was looking your personnal branch.
My bad.
Your reactivity is impressive. Thank you Jimz

No problem, happens to the best of us.

And well thank you, I hope you’ll be up and running soon. Shouldn’t be that hard (unless you copied from my personal branch that is, which is not up to date atm).

Jim
Thanks a lot for your excellent job, running your 1.1 and it is really easy to customize.
I was looking how to get the away picture back on the front view like in version 13.3, I think a conditional IF can check the person status but not sure where to add the code (not sure if it is even possible), is that something that you can suggest me where to do it? Or do you have plans to release a person view with that option?

Thanks for your feedback.
Sergio

@Sergio_Marquez The person view will be added in the near future. Still need to think about what to do with it as I want to make it a template like the rest of Homekit Infused.

@jncanches thanks to the community, I have found out what is slowing everything down. If you leave the group file as is (with all my entities) it will slow down the backend considerably if you leave my entities. Removing all my entities should fix the slow backend (though, I haven’t tested this, but this was debugged by some of the community members). I know there were others saying that automations would slow down considerably using HKI. This solution should fix that (afaik).

can anyone help me, no matter what sample I am trying to use, I will end up getting “UNKNOWN ERROR” from lovelace and this in my log. what am i doing wrong?
Error handling message: Unknown error
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py”, line 20, in _handle_async_response
await func(hass, connection, msg)
File “/usr/src/homeassistant/homeassistant/components/lovelace/init.py”, line 187, in send_with_error_handling
result = await func(hass, connection, msg)
File “/usr/src/homeassistant/homeassistant/components/lovelace/init.py”, line 212, in websocket_lovelace_config
return await hass.data[DOMAIN].async_load(msg[“force”])
File “/usr/src/homeassistant/homeassistant/components/lovelace/init.py”, line 145, in async_load
self._load_config, force
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/homeassistant/homeassistant/components/lovelace/init.py”, line 164, in _load_config
config = load_yaml(fname)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 62, in load_yaml
return yaml.load(conf_file, Loader=SafeLineLoader) or OrderedDict()
File “/usr/local/lib/python3.7/site-packages/yaml/init.py”, line 114, in load
return loader.get_single_data()
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 43, in get_single_data
return self.construct_document(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 47, in construct_document
data = self.construct_object(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 196, in _ordered_dict
nodes = loader.construct_pairs(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 147, in construct_pairs
value = self.construct_object(value_node, deep=deep)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 227, in _construct_seq
(obj,) = loader.construct_yaml_seq(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 400, in construct_yaml_seq
data.extend(self.construct_sequence(node))
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 122, in construct_sequence
for child in node.value]
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 122, in
for child in node.value]
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 117, in _include_yaml
return _add_reference(load_yaml(fname), loader, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 62, in load_yaml
return yaml.load(conf_file, Loader=SafeLineLoader) or OrderedDict()
File “/usr/local/lib/python3.7/site-packages/yaml/init.py”, line 114, in load
return loader.get_single_data()
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 43, in get_single_data
return self.construct_document(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 47, in construct_document
data = self.construct_object(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 196, in _ordered_dict
nodes = loader.construct_pairs(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 147, in construct_pairs
value = self.construct_object(value_node, deep=deep)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 227, in _construct_seq
(obj,) = loader.construct_yaml_seq(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 400, in construct_yaml_seq
data.extend(self.construct_sequence(node))
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 122, in construct_sequence
for child in node.value]
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 122, in
for child in node.value]
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 196, in _ordered_dict
nodes = loader.construct_pairs(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 147, in construct_pairs
value = self.construct_object(value_node, deep=deep)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 227, in _construct_seq
(obj,) = loader.construct_yaml_seq(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 400, in construct_yaml_seq
data.extend(self.construct_sequence(node))
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 122, in construct_sequence
for child in node.value]
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 122, in
for child in node.value]
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 196, in _ordered_dict
nodes = loader.construct_pairs(node)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 147, in construct_pairs
value = self.construct_object(value_node, deep=deep)
File “/usr/local/lib/python3.7/site-packages/yaml/constructor.py”, line 92, in construct_object
data = constructor(self, node)
File “/usr/src/homeassistant/homeassistant/util/yaml/loader.py”, line 115, in _include_yaml
fname = os.path.join(os.path.dirname(loader.name), node.value)
File “/usr/local/lib/python3.7/posixpath.py”, line 94, in join
genericpath._check_arg_types(‘join’, a, *p)
File “/usr/local/lib/python3.7/genericpath.py”, line 153, in _check_arg_types
(funcname, s.class.name)) from None
TypeError: join() argument must be str or bytes, not ‘list’

I’m back :stuck_out_tongue:

One little question, is it possible to edit the /config/lovelace/views/00.frontpage.yaml file in order to change for example the weather city instead of global_config/views/frontpage_view.yaml ?

If yes, is it normal that i got an error in the 00.frontpage.yaml (configurator editor) ? :

bad indentation of a sequence entry at line 16, column 30:
                      - city_name: {{ _global.frontpage_weather.c ... 
                                 ^

G.

@soylant did you use the beta before? If yes make sure to delete everything related to the beta. Mainly the global config are now objects instead of an array which might cause that problem.

@gautier23 why would you want to edit the view if you can edit the city in global_config? You can ofc edit the view if you want, but if you don’t want to change the layout it is best to use the global config. Not only will you be able to update very easy but also changing frontpage layouts (will upload some in the near future) will be very easy.

Ok, I get it :slight_smile:

1 Like

Did you manage? I know I should document the global_config with more detail. Which will come soon!

1 Like

Yes, I succeed in the modification of city :slight_smile: (in the global_config).

Right now, I try to correct my first element in the home page :

image

I will figure it out, I installed your solution yesterday night (and I have a lot of stuff to learn and understand).
But anyway, your solution seems amazing and your support also… (so reactive !!)

1 Like

Thank you, don’t worry I will properly document everything in videos as well. Though unfortunately creating (decent) videos take a lot of time (even when one might think it is rather easy). But I am working on the videos, as well as update 1.2 which will come somewhere tomorrow and has a lot of new bugfixes and a new orange theme, which you can find a preview of in the screenshots below!

I see you are french, if you join me on slack I could try to give you support in your native language (though it is not my own native language).

1 Like

Hi Jim, huge thanks for HKI - the setup is great ! However I have one problem. I got Roborck S60 vacuum and in Xiaomi integration sensor.xiaomi_vacuum_fan_speed_state values are mapped wrong (it’s integration fault). The sensor has value 101 or 102 or 103 or 104 or 105. They should be mapped like:
Quiet: 101
Balanced: 102
Turbo: 103
Max: 104
Mop: 105
How can I remap them in HKI to have proper values working with control buttons in vacuum view?

Edit, they work fine for me though, however;

I am guessing you use mqtt instead of the miio integration, am I correct? The states are actually based on the official integration and they have been altered since HA 0.105.x which is why I changed the names to reflect the states in the new version of HA.

Personally I have set them up both (so I have mqtt set up, but I use that only for the live map) and the integration which also works with non-rooted vacuums which should accept both state names as state numbers. If it won’t work I can fix it ofc as I know that sending 101 etc will probably always work.

Nope I don’t use MQTT for that, just standard miio integration but it’s known issue for 2019 and newer vacuums(with values like 101 instead of silent etc. check this:

But I just solved it by modifying your value_template in vacuum templates:

xiaomi_vacuum_fan_speed_state:
      value_template: >-
        {% if  is_state_attr('vacuum.roborock', 'fan_speed', 101) %}
        Silent
        {% elif  is_state_attr('vacuum.roborock', 'fan_speed', 102) %}
        Standard
        {% elif  is_state_attr('vacuum.roborock', 'fan_speed', 103) %}
        Medium
        {% elif  is_state_attr('vacuum.roborock', 'fan_speed', 104) %}
        Turbo
        {% elif  is_state_attr('vacuum.roborock', 'fan_speed', 105) %}
        Gentle
        {% endif %}

Then I had to edit automation:

# Xiaomi Fan Speed
- alias: xiaomi vacuum set fan speed
  initial_state: 'true'
  trigger:
  - platform: state
    entity_id: input_select.xiaomi_vacuum
  action:
    service: vacuum.set_fan_speed
    data_template:
      entity_id: vacuum.roborock
      fan_speed: >
        {% if is_state('input_select.xiaomi_vacuum', 'Silent') %}
          101
        {% elif is_state('input_select.xiaomi_vacuum', 'Standard') %}
          102
        {% elif is_state('input_select.xiaomi_vacuum', 'Medium') %}
          103
        {% elif is_state('input_select.xiaomi_vacuum', 'Turbo') %}
          104
        {% elif is_state('input_select.xiaomi_vacuum', 'Mop') %}
          105
        {% endif %}

And now it works like a charm:) So if anyone of HKI users has 2019 or newer Xiaomi vacuum and got problems with fan speed attributes values that’s the solution! BTW Jim what method did you use to root you vacuum? Because I still need to do this to get the live map

I did it with windows and python with these instructions (if you use the instructions below you can skip directly to the “uploading” part)

And then you can build your file here:
https://dustbuilder.xvm.mit.edu/

All you need to do is choose which version of Valetudo you want to build and then click on your vacuum model and download. Personally I will suggest getting Valetudo RE because it is better imho and I can’t get the live map to work with mqtt in the official Valetudo firmware. But RE is better in many areas so get that instead.

Don’t forget to save the ssh keys you get by mail. They will only be in their servers for a few days.

Edit: you will need flasher.py which I believe can be downloaded from the valetudo github repo.

thanks a lot I will try it a soon a I have some free time

This has changed a ton in a few months, wow! Looks incredible and I’ll have to get started on migrating over to this new setup. Fantastic job!

One question though, is this as easy to customize as your older versions of the project? I ended up doing a lot of different tweaks to the older versions to “make it my own” in a sense.

1 Like

yes this code is easy customizeable, but the only thing is there is no upgrade path from the old version to this.

So you will need reinstall everything. (just reading from the documentation he made.)

Well the answer needs a bit more explaining.

So the short answer is yes you can change all of the views like you were used to. However, the long answer is, it depends what you are going to edit.

To explain it better: if you configure homekit infused at the global level (which is a folder with files I have included) you can update easily into new versions. If you configure it at view level you must read update notes which can as you already know be a lot of information with a lot of changes.

Now my new documentation states the following: if you want to edit views, you are better off copying them and then change the buttons paths (with global_config) to point to your custom view. Just name your view to anything but the original name. This way, when an update comes you can simply overwrite the old stuff (as your configuration comes from global_config, which I will only update if it is absolutely necessary). Also editing templates I advise you to do the same. Copy and rename a template.

I do no longer use decluttering-cards which is a good thing for older users of HKI, why? Well because you can simply copy/paste old config to new views. Though you MUST change the folder those templates live in (they can NOT be in /lovelace/templates/) so rename the folder with decluttering cards to something like ‘lovelace/decluttering-templates’ and then change the reference in ‘ui-lovelace.yaml’. That is all for now.

I also have to mention that 90% of the views can be autofilled (which is the default setting now) this means if you have less knowledge of home assistant it will still be super easy to install and use this.

Also, I will update the project to version 2 in the upcoming week which will be even more awesome than it already is as it will receive some major new cool stuff like hiding/showing different kinds of elements from the interface (see screenshots below). With this update, it will probably (not sure if it will make it in time) have the choice between the current device type based views and room based views.

Enjoy!