Don't disable switch entities by default in Logitech Harmony integration

Hi,

The recent update to the Logitech Harmony integration added behavior of disabling the switch entities that are created for each activity. Github conversation here.

This was a surprise to me as after updating to the latest HA it broke my automations and all places where I used these switches. The changes proposed by the contributor were originally marked as not a breaking change, but this addition made this update a breaking change, undocumented in the latest release notes, which is unfortunate.

Please reconsider the behavior of disabling the switch entities or adding a UI option when configuring the integration that allows you to select which entity types you want to be added.

Kind regards,

Davey.

They seem very much still there for meā€¦

Did you update to 2021.10.0? When I did, it disabled the switch entities.

Yes, I did. By a quick look at the PR, those entities will likely be disabled when newly installed, but I guess not if they were already there.
Even if they became disabled for you, whatā€™s the big deal with just re-enabling them?

The are there for me as well on 2021.10

And btw, I find the select much more elegant than a bunch of switches :wink:

1 Like

Exactly, and I can also get rid of the template sensor that I had to create to show the current activity.

1 Like

Yep, I have the same one :rofl:

I used it to get the activities into Google Home. The select might be more elegant, but it breaks the functionality as it had been. In that case you could make the argument: if you donā€™t use the switches, just ignore them. :wink:

Itā€™s a valid point, I do the same. Iā€™ll have to see if it can be done just with a select.

But yeah, the point is: They are still there if you need them, and nothing is broken when updating.

If this FR is about ā€œdonā€™t disable them by default because I donā€™t want to enable them manually if I start again from scratchā€, the title should be clarified.

I amended the title. It might not be a ā€˜featureā€™-break, as you say the feature is still there. But still, for me personally, Iā€™m having difficulty understanding why this approach was taken.

Just for my understanding: You upgraded and the switches became disabled?
That might be a plain bug, and not intentionalā€¦

Yes, although I was also using Tuya v1, and Tuya v2 integrations from HACS which needed to be removed from my integrations because they were conflicting with the new updated Tuya integration.

So directly after the update, I got errors. Had to delete all Tuya integrations, restart, delete the Tuya v2 custom component from HACS, restart, then continued to reconfigure Tuya v2 via the official, updated integration and then I noticed the switches were gone in the Harmony integration. So that situation mayā€™ve removed all entities and caused the ā€œstart from scratchā€ behavior? Maybe had I deleted Tuya before upgrading to 2021.10.0, the switches wouldā€™ve stayed enabled?

I doubt it could be related, but maybe some edge case in case of failure when restarting after an upgradeā€¦

They also disable when you delete .storage/core.entity_registry, which I do from time to time to clean up unused entities when messing around. Then they also are removed in Google Home from the room they were in and I have to reorganize them to the correct room. The select doesnā€™t really work in the Google Assistant integration, it shows up but no selection can be made.

I ended up making my own switches.

switch:
  - platform: template
    switches:
      my_non_breaking_harmony_switch:
        friendly_name: Watch TV
        value_template: "{{ is_state('select.harmony_hub_activities', 'Watch TV') }}"
        turn_on:
          service: select.select_option
          target:
            entity_id: select.harmony_hub_activities
          data:
            option: Watch TV
        turn_off:
          service: select.select_option
          target:
            entity_id: select.harmony_hub_activities
          data:
            option: PowerOff