jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
189 stars 46 forks source link

Lost all my switches after latest update. #234

Closed jiipee-blob closed 3 months ago

jiipee-blob commented 6 months ago

Title says it all.

"Hubitat doesn't provide this integration anymore...."

image

They all seem to be switches.

jason0x43 commented 6 months ago

Hmmm…there was an issue for a while today where attribute names were dropped from entity ids, but that should be resolved now (v0.9.15).

What version are you currently running?

Is the integration providing new switch entities and breaking existing ones, or are you getting no working switches at all?

jiipee-blob commented 6 months ago

Hi, I'm running the latest 0.9.1.5 that I updated couple of hours ago. Actually now that I'm looking this more carefully I noticed that all missing switches are virtual switches from hubitat side. It shows up like this: image

I'm not sure what is that second switch which works. There was only one switch "entity" before the update and now it seems like every virtual switch has to switch entities where the older one is not working anymore but the newer is.

EDIT: there is normal switches too, so it is not virtual switch only type of thing. This seems to have something to do with that attribute name issue I assume.

kungktd commented 6 months ago

Same here. All switches are “offline” after updating to latest version.

BlueMoon23 commented 6 months ago

Similar position here, I've lost all "double" switches, i.e. Fibaro and AEOTEC dual switches. The other devices (sockets, sensors, etc) appear to be working. There are no updates pending so I assume I have the lateste version.

shopro commented 6 months ago

My old switches all display the error "This entity is no longer being provided by the hubitat integration. If the entity is no longer in use, delete it in settings.". The update however generated new ones with _switch added to the end, those work fine.

In example, switch.outside_garage is now unavailable, but a new one switch.outside_garaga_switch works.

BlueMoon23 commented 6 months ago

My old switches all display the error "This entity is no longer being provided by the hubitat integration. If the entity is no longer in use, delete it in settings.". The update however generated new ones with _switch added to the end, those work fine.

In example, switch.outside_garage is now unavailable, but a new one switch.outside_garaga_switch works.

Ah, yes I can see these. Do you know of the changes are permanent; I have several of them linked to automations, so I'll need to update them all (and don't want to have to do it twice!)?

jason0x43 commented 6 months ago

Is everyone seeing the same issue, where a device has multiple entities with one working and one not? Assuming that’s the case, could someone post the name of the non-working switch entity (e.g., switch.bedroom_lights) and the name of the working one?

Do you know of the changes are permanent;

The issue should be fixable once I can see what changed.

BlueMoon23 commented 6 months ago

Is everyone seeing the same issue, where a device has multiple entities with one working and one not? Assuming that’s the case, could someone post the name of the non-working switch entity (e.g., switch.bedroom_lights) and the name of the working one?

Do you know of the changes are permanent;

The issue should be fixable once I can see what changed.

In my list of hubitat devices, I am seeing two "Garage Door Switch (S1)". When I select the first one there are no entities; the second one had two entity IDs: "switch.garage_door_switch_s1" (which is grayed out, under Controls it is labelled "Garage Door Switch (S1)") "switch.garage_door_switch_s1_switch" (which works, under controls it is labelled "Switch").

Wipeout944 commented 6 months ago

switch.kitchen_counter was my working entity yesterday. That no longer works and there is now a switch._kitchen_counter_switch entity on the device (which works). I’m also seeing it on plug-in outlets where the original entity was, for example, switch.christmas_tree. This one I’d changed device types on to light.christmas_tree, but the only working entity now is switch.christmas_tree_power.

Looking at what works vs. what doesn’t, it seems like only things that reported as switches were impacted.

kungktd commented 6 months ago

Is everyone seeing the same issue, where a device has multiple entities with one working and one not? Assuming that’s the case, could someone post the name of the non-working switch entity (e.g., switch.bedroom_lights) and the name of the working one?

Yes, this is how I see things now.

Wipeout944 commented 6 months ago

Maybe related, maybe not, but one of my motion sensors, the only one I have plugged into power, is reporting that it’s 117 degrees in HA—but in Hubitat, it’s reporting (correctly) 46 degrees. This started at the same time the update happened.

pwestbro commented 6 months ago

I also encountered the problem with switches going offline. I restored from a backup with Hubitat 0.9.11, and the switches are working correctly again

Wipeout944 commented 6 months ago

Reverting to my backup from two days ago fixed both the switch and temperature issue I was seeing after the update last night. Good call, @pwestbro.

kevdliu commented 6 months ago

Seems like what's happening is after the latest update, the integration is appending the "_switch" suffix to the entity id of switch entities, hence causing Home Assistant to create new entities and marking the old ones as unavailable. For example, my switch.bedroom_lights is unavailable but I now see a new switch.bedroom_lights_switch entity.

shopro commented 6 months ago

My old switches all display the error "This entity is no longer being provided by the hubitat integration. If the entity is no longer in use, delete it in settings.". The update however generated new ones with _switch added to the end, those work fine. In example, switch.outside_garage is now unavailable, but a new one switch.outside_garaga_switch works.

Ah, yes I can see these. Do you know of the changes are permanent; I have several of them linked to automations, so I'll need to update them all (and don't want to have to do it twice!)?

I have no idea, quick look might suggest it's following the same pattern as the rest with _type added to the end. Luckily all my configs are in YAML's so it only took 5s to update my automations by simply adding that extra _switch to the end.

jason0x43 commented 6 months ago

The issue was that _switch was being added to the end of switch entities. As part of a general upgrade to the integration I consolidated some of the code that managed entity names, which made switches behave more like sensors. That behavior bas been reverted in v0.9.16, which should fix the issue.

shopro commented 6 months ago

The issue was that _switch was being added to the end of switch entities. As part of a general upgrade to the integration I consolidated some of the code that managed entity names, which made switches behave more like sensors. That behavior bas been reverted in v0.9.16, which should fix the issue.

Still having the same issue, only the _switch ending ones are available.

730522js commented 6 months ago

I have the same issue. I've noticed that the Hubitat switches (including virtual switches) in HA changed from switch.name into switch.name_power. I've solved my issue by "renaming" all the buttons not working with the proper "new" id "_power". Hope this helps somebody!

kungktd commented 6 months ago

The issue was that _switch was being added to the end of switch entities. As part of a general upgrade to the integration I consolidated some of the code that managed entity names, which made switches behave more like sensors. That behavior bas been reverted in v0.9.16, which should fix the issue.

Unfortunately, the update did not correct the issue. Maybe for those who hasn't already updated to 9.1.15. I still have both the proper entities (which still are unavailable) and the new added _switch once.

IMG_0975

Is there anyway to correct this without breaking all automations etc.?

mattydiv commented 6 months ago

Just tried the latest version - same issue - new devices created, and existing versions of same device showing as invalid. ‘Switch’ no longer being added to name, but it appears the issue is the same with device duplication.

jason0x43 commented 6 months ago

Still having the same issue, only the _switch ending ones are available.

This is the case after updating to 0.9.16 and restarting?

Is there anyway to correct this without breaking all automations etc.?

Downgrading to 0.9.8 should work for now.

Just tried the latest version - same issue - new devices created, and existing versions of same device showing as invalid. ‘Switch’ no longer being added to name, but it appears the issue is the same with device duplication.

New devices, or new entities in existing devices? What are the entity names of some of the duplicated entities? (e.g. switch.bedroom and switch.bedroom_switch)

shopro commented 6 months ago

Still having the same issue, only the _switch ending ones are available.

This is the case after updating to 0.9.16 and restarting?

Yes, that's after full restart.

Both the switch.outlet_garage and switch.outlet_garage_switch exists, but only the switch.outlet_garage_switch is available.

jason0x43 commented 6 months ago

Both the switch.outlet_garage and switch.outlet_garage_switch exists, but only the switch.outlet_garage_switch is available.

What version of Home Assistant are you running?

shopro commented 6 months ago

Both the switch.outlet_garage and switch.outlet_garage_switch exists, but only the switch.outlet_garage_switch is available.

What version of Home Assistant are you running?

Core 2023.12.4 Frontend 20231208.2

Jelloitsalive12 commented 6 months ago

Still having the same issue, only the _switch ending ones are available.

This is the case after updating to 0.9.16 and restarting?

Is there anyway to correct this without breaking all automations etc.?

Downgrading to 0.9.8 should work for now.

Just tried the latest version - same issue - new devices created, and existing versions of same device showing as invalid. ‘Switch’ no longer being added to name, but it appears the issue is the same with device duplication.

New devices, or new entities in existing devices? What are the entity names of some of the duplicated entities? (e.g. switch.bedroom and switch.bedroom_switch)

I see for example: switch.vacation_switch (unavailable) switch.vacation_switch_2 (newly created/working) switch.front_entry_outlet (unavailable) switch.front_entry_outlet_2 (newly created/working)

kungktd commented 6 months ago

I did a full backup from the day before I updated, so I rolled back to that and am now happy again. 😀 Will stay away from updating the HE integration though. 😉

Jelloitsalive12 commented 6 months ago

I did a full backup from the day before I updated, so I rolled back to that and am now happy again. 😀 Will stay away from updating the HE integration though. 😉

Rolled back to before latest HA update? or Hubitat Add-On Update?

kungktd commented 6 months ago

Sorry for not being clear, Hubitat add-on update.

jason0x43 commented 6 months ago

switch.vacation_switch (unavailable) switch.vacation_switch_2 (newly created/working) switch.front_entry_outlet (unavailable) switch.front_entry_outlet_2 (newly created/working)

@Jelloitsalive12 Do you recall what version you upgraded from and to? Like, did you go from 0.9.8 directly to 0.9.16, or were there some versions in between? In your case, at least, it looks like HA decided to create a new entity with the same entity name (so ended up with the _2) rather than using the existing entity.

jason0x43 commented 6 months ago

@Wipeout944 regarding the temperature issue, see #237

mattydiv commented 6 months ago

switch.vacation_switch (unavailable) switch.vacation_switch_2 (newly created/working) switch.front_entry_outlet (unavailable) switch.front_entry_outlet_2 (newly created/working)

@Jelloitsalive12 Do you recall what version you upgraded from and to? Like, did you go from 0.9.8 directly to 0.9.16, or were there some versions in between? In your case, at least, it looks like HA decided to create a new entity with the same entity name (so ended up with the _2) rather than using the existing entity.

If it’s helpful, I just tried going from 0.9.11 to 0.9.16 and I’m still getting all devices with a _2 version (that works), with the original device no longer working.

jason0x43 commented 6 months ago

I've tracked down the issue -- the logic generating the unique IDs for entities was still adding a switch suffix for switches, so even though the entity name had been fixed, the unique entity ID was still wrong, so HA was creating 2 devices. I should have a fix out later this evening.

Jelloitsalive12 commented 6 months ago

switch.vacation_switch (unavailable) switch.vacation_switch_2 (newly created/working) switch.front_entry_outlet (unavailable) switch.front_entry_outlet_2 (newly created/working)

@Jelloitsalive12 Do you recall what version you upgraded from and to? Like, did you go from 0.9.8 directly to 0.9.16, or were there some versions in between? In your case, at least, it looks like HA decided to create a new entity with the same entity name (so ended up with the _2) rather than using the existing entity.

I think I went from 0.9.11, but I am not sure

Jelloitsalive12 commented 6 months ago

Upgrading from 0.9.8 (from restore) to 0.9.17 seems to have worked great!

BlueMoon23 commented 6 months ago

0.9.17 works for me as well, thanks.

Wipeout944 commented 6 months ago

0.9.17 has fixed issues with wall switches, however, I'm still seeing the creation of a new entity for 5 of my plug-in outlets. Example: switch.christmas_tree (hidden via change device type of a switch) is now unavailable. light.christmas_tree is also unavailable (duh, since it's tied to the "switch" above). switch.christmas_tree_2 is new.

jason0x43 commented 6 months ago

Interesting. The new switch.christmas_tree_2 was likely created because of the unique id issue that was fixed in 0.9.17. In my own testing, updating to 0.9.17 has always resulted in the original entity becoming active again because the integration switched back to the original unique id. However, I haven’t tested in a case where I converted a switch to a light.

Were you using the integration’s switch -> light feature or Home Assistant’s?

Wipeout944 commented 6 months ago

Pretty sure I did that in HA, not through the integration.

pwestbro commented 6 months ago

I also just upgraded from 0.9.11 to 0.9.18, and new switches were created, with the _2 suffix. The previous switches were disabled, with the message that they weren't provided by the integration

pwestbro commented 6 months ago

These are not switches that I converted to light though home assistant

jason0x43 commented 6 months ago

@pwestbro You're sure you're on 0.9.18 rather than 0.9.16? The general switch duplication issue was resolved in 0.9.17, and upgrading from 0.9.11 directly to 0.9.18, at least in the several times I've tried it, does not create new switches. If you happened to update to anything between 0.9.8 and 0.9.17, though, you'd end up with the extra switch entities.

If you can provide some data from your entity registry it might help diagnose what's going on. The registry is in your Home Assistant config directory, at <config dir>/.storage/core.entity_registry. In there you should be able to find the entries for your disabled switch and the _2 switch. It would be great if you could post the entries for both of those.

jason0x43 commented 6 months ago

@Wipeout944 You're on v0.9.18 now, and the original switch entities are still disabled?

I just tested the behavior for switch-to-light setups by creating a switch in v0.9.9, and then converting it to a light using HA's "show switch as light" option. I updated to v0.9.16 and got a new _2 switch, and the original switch. and light. entities became unavailable. After updating to 0.9.18 and restarting, both the original entities became available again, and the new _2 entity became unavailable, which is the expected behavior.

Are you seeing any errors during startup in the HA log?

Wipeout944 commented 6 months ago

@jason0x43 That was on .17 still. I had not gone to .18. Same behavior for me after installing .18, new _2.

Screenshot 2024-01-04 at 19 22 08 jpeg

I have no errors related to this integration. Edit: In case it matters, I was on .10 prior to this issue appearing.

jason0x43 commented 6 months ago

So, some switch-related issues came up in v0.9.12, and were fixed in 0.9.17. The one that causes the problem above is that switch entities created in v0.9.12-0.9.16 used different internal unique IDs than switch entities created before 0.9.12 or after 0.9.16.

Did you happen to add the Christmas Tree switch within the last week? (I wouldn't think so, based on its name. 🙂) If so, that might explain things, because it might have been created when the broken IDs were being used, so wouldn't get fixed with 0.9.17.

If that's not the case, I'd request the same information from you that I asked @pwestbro for above -- the entries from the entity_registry for the "unavailable" entities and the entity that's currently working. Seeing those might point out what's going on.

Wipeout944 commented 6 months ago

Define "created"...because I upgraded from a C7 to a C8 on the 30th. Anything is possible, IKNA how that migration process might muddy things... 🤣

I can pull the entities in a bit.

jason0x43 commented 6 months ago

Define "created"...

😂

I just mean if you set up a new instance of the Hubitat integration some time on Dec 31, you may have been using one of the broken versions of the integration, so the switch devices would have been created using incorrectly formatted unique IDs, and updating to 0.9.17+ would create new entities with the correct unique IDs.

Users who upgraded from v0.9.8, which had been the latest release for the last few months, would have started out with switches having the correct unique IDs, would have had new entities show up and the originals become unavailable when they updated to v0.9.12 (or anything up to v0.9.16), and would have had the original entities become available again after updating to v0.9.17.

Wipeout944 commented 6 months ago

switch.christmas_tree_2

      {
        "aliases": [],
        "area_id": null,
        "capabilities": null,
        "config_entry_id": "92724de2e248b300a8cae621f0a0f82e",
        "device_class": null,
        "device_id": "cc15d7f7028804b1f9f0c650c826800c",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "switch.christmas_tree_2",
        "hidden_by": null,
        "icon": null,
        "id": "7efba5166a7a07e56f798099667963f1",
        "has_entity_name": false,
        "name": null,
        "options": {
          "conversation": {
            "should_expose": true
          }
        },

switch.christmas_tree

      {
        "aliases": [],
        "area_id": null,
        "capabilities": null,
        "config_entry_id": "92724de2e248b300a8cae621f0a0f82e",
        "device_class": null,
        "device_id": "cc15d7f7028804b1f9f0c650c826800c",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "switch.christmas_tree",
        "hidden_by": "integration",
        "icon": "mdi:pine-tree",
        "id": "ebc2b13ac24a0efcab05183263e3d87d",
        "has_entity_name": false,
        "name": null,
        "options": {
          "conversation": {
            "should_expose": false
          },
          "cloud.alexa": {
            "should_expose": false
          },
          "cloud.google_assistant": {
            "should_expose": false
          }

...and for good measure, light.christmas_tree

{
        "aliases": [],
        "area_id": null,
        "capabilities": {
          "supported_color_modes": [
            "onoff"
          ]
        },
        "config_entry_id": "a87416a024c2a9db1d4818f39df1ef98",
        "device_class": null,
        "device_id": "cc15d7f7028804b1f9f0c650c826800c",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "light.christmas_tree",
        "hidden_by": null,
        "icon": "mdi:pine-tree",
        "id": "915dc61536efb27e1ddf54fe64f3cecb",
        "has_entity_name": false,
        "name": null,
        "options": {
          "switch_as_x": {
            "entity_id": "switch.christmas_tree"
          },
          "conversation": {
            "should_expose": true
          },
          "cloud.alexa": {
            "should_expose": true
          },
          "cloud.google_assistant": {
            "should_expose": true
          }
        },
pwestbro commented 6 months ago

Hello, After updating to the 0.9.18 version, here are some example entities

Here is the one that existed previously

  {
    "aliases": [],
    "area_id": null,
    "capabilities": null,
    "config_entry_id": "9777d28e286b67f11cee030b806cd000",
    "device_class": null,
    "device_id": "7df056e108a24b46816c8cd0380d7845",
    "disabled_by": "integration",
    "entity_category": null,
    "entity_id": "sensor.basement_workshop_plug_switch",
    "hidden_by": null,
    "icon": null,
    "id": "cd93c3efea8893481efcff1527bd5f2a",
    "has_entity_name": false,
    "name": null,
    "options": {
      "cloud.google_assistant": {
        "should_expose": false
      },
      "conversation": {
        "should_expose": false
      }
    },
    "original_device_class": null,
    "original_icon": null,
    "original_name": "Basement Workshop Plug Switch",
    "platform": "hubitat",
    "supported_features": 0,
    "translation_key": null,
    "unique_id":

"07ad9556fb534127576b1b3eaf459843a0fdc437cfe5e88d42a97682be05a322::11::sensor::switch", "previous_unique_id": null, "unit_of_measurement": null },

Here is the newly added one that has the _2 suffix

  {

    "aliases": [],

    "area_id": null,

    "capabilities": null,

    "config_entry_id": "9777d28e286b67f11cee030b806cd000",

    "device_class": null,

    "device_id": "7df056e108a24b46816c8cd0380d7845",

    "disabled_by": null,

    "entity_category": null,

    "entity_id": "switch.basement_workshop_plug_2",

    "hidden_by": null,

    "icon": null,

    "id": "bf55a72605b59738052c5aae9008be45",

    "has_entity_name": false,

    "name": null,

    "options": {

      "conversation": {

        "should_expose": true

      },

      "cloud.google_assistant": {

        "should_expose": true

      }

    },

    "original_device_class": "outlet",

    "original_icon": null,

    "original_name": "Basement Workshop plug",

    "platform": "hubitat",

    "supported_features": 0,

    "translation_key": null,

    "unique_id":

"07ad9556fb534127576b1b3eaf459843a0fdc437cfe5e88d42a97682be05a322::11::switch::power",

    "previous_unique_id": null,

    "unit_of_measurement": null

  },

Is there anything else that I can provide? Otherwise, I will restore to a backup with 0.9.11

Thanks,

Paul

On Thu, Jan 4, 2024 at 9:52 PM Jason Cheatham @.***> wrote:

Define "created"...

😂

I just mean if you set up a new instance of the Hubitat integration some time on Dec 31, you may have been using one of the broken versions of the integration, so the switch devices would have been created using incorrectly formatted unique IDs, and updating to 0.9.17+ would create new entities with the correct unique IDs.

Users who upgraded from v0.9.8, which had been the latest release for the last few months, would have started out with switches having the correct unique IDs, would have had new entities show up and the originals become unavailable when they updated to v0.9.12 (or anything up to v0.9.16), and would have had the original entities become available again after updating to v0.9.17.

— Reply to this email directly, view it on GitHub https://github.com/jason0x43/hacs-hubitat/issues/234#issuecomment-1878086422, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJ5OSILOP5H4F4OMYWHVCTYM52H7AVCNFSM6AAAAABBI2OFJOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZYGA4DMNBSGI . You are receiving this because you were mentioned.Message ID: @.***>

-- Paul Westbrook @.*** https://paulwestbrook.me

AJolly commented 6 months ago

Whats the best way to go from 0.9.8 to the latest without getting duplicate switch entities? (and the old ones being now invalid?) Everytime I try all my devices get duplicated.

jason0x43 commented 6 months ago

If you go directly from 0.9.8 to the latest version (currently 0.9.19) you should not see any switch duplication.