Home App Sync

Hi,
I’m using iPhone X and this week I started automate my apartment with the amazing home-assistant.
Automatically I got the chromecast devices I have around the apartment and I added more several Wake On Lan switches, as well as the Switcher V2, which is a smart switch for the boiler.

I was noticed that not all of the things were automatically synced with the Home app on the iPhone and I wondered why and how to fix this.

Does anyone know why this happens?
How can I add the chromecast switch, for example, to the Home app?

All I have for now is the Wake On Lan switch.

Thank you.

Hi Nadav,
I think this is relevant for your question to have all home assistant entities synched with homekit

Hi Piggyback,
Thank you for your answer.
I did the following:

discovery:
  enable:
    - homekit

But it didn’t really found the switch.

I asked the creator of the component and he told me that he thinks that maybe creating a template switch will help, so I created one:

switch:
  - platform: template
    switches:
      switcher_v2:
        friendly_name: "Switcher V2"
        value_template: "{{ is_state('switcher_aio.control_device_switch', 'on') }}"
        turn_on:
          service: switcher_aio.turn_on
        turn_off:
          service: switcher_aio.turn_off

Now I can see the switch, but it doesn’t perform the action of turn on or off.

Do you know what may be the problem?

Thank you.

Does the switch work from home assistant? Just need to make sure it is not an integration problem or automation issue.

I see the newly created switch in the home assistant, but it doesn’t work from there either

In that case your automation is not right and is not a problem of the switch.

I didn’t do any automation, only the code I showed here.
I thought it will work automatically because I refer the turn_on to the actual turn_on in the switch and same as for the turn_off.

Isn’t that what I should have done?

Well in your template switch definition, there is some logic, right?

Does it work if you call the service from the developer tools, Service section in Home Assistant?
Looking at the above, I would expect you would need some kind of automation, but I have to admit, I have not worked with template switches, but see that there are some references :slight_smile:

Hope these links help somewhat!

OK, I solved it!
@Piggyback I took your advice and used the Developer Tools in the HA. Only by that, I could find the right solution.
So after a lot of work and help, by email, with @TomerFi and thanks to you, @Piggyback, I could solve this.
adding to the configurations.yaml the following lines:

  - platform: template
    switches:
      switcher_v2:
        friendly_name: "Switcher V2"
        value_template: "{{ is_state('switcher_aio.control_device_switch', 'on') }}"
        turn_on:
          service: switcher_aio.turn_on
          data:
            entity_id: switcher_aio.control_device_switch
        turn_off:
          service: switcher_aio.turn_off
          data:
            entity_id: switcher_aio.control_device_switch  

The switch finally works, from the Switches category and, of course, the most important, from Siri, using the Home app.

Thank you both @TomerFi and @Piggyback for your help!

2 Likes

BTW

I have a PR open with home-assistant for incorporating a new and more stable version of the Switcher V2 component called switcher_kis.
It already passed all the required tests and it’s waiting for a code-review, after that it would be eligible for merge and becoming an “official ha component”.

Great!
Will you implement it as a water_heater or it will be a switch?

1 mandatory switch entity for on/off.
8 optional sensor entities for presenting the schedule slots status.

Managing the device and schedule’s will be done via the services at the component level (switcher_kis).
No group, script, input_select and any of the other entities created by the current switcher_aio component will be created.
The front-end will be entirely up to the user.

That would be amazing, it means that with the right configuration, you would be able to tell Alexa, Siri and all of them something like:
“Hey Siri, turn on the Boiler for 30 minuets”

Do you have an ETA for this so come out?
And will it be on the Add-Ons Store?

@nadav
It’s a lot of code, so I’m sure the code-review will take a long time.
So far it’s been about two weeks, I hope it will be over soon but I don’t know for sure when will it be.

As far as Alexa and other digital assistants, you can have it control the switcher like so (works great for me):
Create 4 scripts calling the 4 switcher_aio services:

  • switcher_aio.turn_on_15_minutes
  • switcher_aio.turn_on_30_minutes
  • switcher_aio.turn_on_45_minutes
  • switcher_aio.turn_on_60_minutes

Name them respectively:

  • boiler for 15 minutes
  • boiler for 30 minutes
  • boiler for 45 minutes
  • boiler for 60 minutes

Share these scripts with your digital assistant via its HA integration,
If the integration can’t handle script entities, you can wrap them with a scene or a template switch.

Here’s what I did, It’ll probably won’t fit you “as-is”, basically because instead of calling the services, I made the scripts go through automations (which is very redundant), but you can check out the concept regardless.

I’ve configured the switcher_aio, I created the above script entities and wrapped them up with scene entities.
I also added a fifth scene named boiler for 1 hour which is of course identical to the boiler for 60 minutes scene.

https://github.com/TomerFi/my_home_assistant_configuration/blob/master/yaml_packages/switcher_boiler.yaml

(I should probably mention here that as far as my digital assistant goes, I named my switcher_aio.control_device_switch as just boiler.)

I work with Alexa, so I configured its integration to share the switcher switch and 5 scenes:

The end result is that I can ask Alexa any of the following requests (with different variations):

  • Turn on the boiler
  • Turn off the boiler
  • Turn on the boiler for 15 minutes
  • Turn on the boiler for 30 minutes
  • Turn on the boiler for 45 minutes
  • Turn on the boiler for 60 minutes
  • Turn on the boiler for 1 hour

@TomerFi- Thank you !! any update from them ?

I’m currently working on migrating the switcher device integration from the switcher_aio custom component to the new switcher_kis built-in component.

This solution will not be maintained in the future,
So if you just starting with switcher, I would suggest starting with the built-in component.
So you won’t have to migrate in the future.

Hi @TomerFi,
I just tested the built-in component switcher_kis with the Switcher Power Plugs and it is working properly.
My problem is that I have 3 Power Plugs and I didn’t manage to configure all 3 devices with the built-in component, if I using the switcher_heater as custom component I can define all 3 Power Plugs.

Does the new component switcher_kis support multiple devices?