michbeck100 / pimatic-hap

Pimatic homekit bridge
GNU General Public License v2.0
30 stars 10 forks source link

Deleting device in Pimatic doesn't seem to delete it also in Homekit #64

Closed pplucky closed 6 years ago

pplucky commented 7 years ago

Is it just me, or this still doesn't work properly? Should be, according to this enhancement.

Every time I remove a device in Pimatic, is still appears as not responding in Home app. If I try to delete it from there, I always get an error message.

What can I arrange (logs, whatever), for you to check this, please?

Thanks in advance.

michbeck100 commented 7 years ago

What type of devices are you removing? Looking at the code it seems that removing sensors will not work properly.

michbeck100 commented 7 years ago

I did test this for "normal" devices and couldn't find any issues, so I'm closing this. Changes for sensor are released with v0.10.0

pplucky commented 7 years ago

Hello.

Sorry for not replying earlier, but this seems to happen for devices with type 'VariablesDevice'.

I currently use these in Homekit, by using a temperature or humidity variable, to display its value in iOS.

Can you please check?

Thanks in advance.

michbeck100 commented 7 years ago

There was indeed a bug for VariablesDevice which was fixed with the referenced changes. So it should be solved with 0.10.0

pplucky commented 7 years ago

Unfortunately I already have 0.10.0 and I had this same issue of deleting a 'VariablesDevice' in Pimatic and it still appeared in Homekit.

Deleting in Homekit yielded an error, so I had to deleted hap-database manually, restart pimatic and then deleting the Bridge on iOS and adding it later again.

Do you need me to produce any debug log, anything?

michbeck100 commented 7 years ago

Please provide me with a sample config of your VariablesDevice. I will try to reproduce this error as soon as I find the time.

pplucky commented 7 years ago

Here is the config for 2 VariablesDevice:

{
  "variables": [
    {
      "name": "temperature",
      "expression": "$temp-quarto-diogo",
      "type": "number",
      "unit": "ºC"
    }
  ],
  "xAttributeOptions": [],
  "hap": {
    "service": "Lightbulb"
  },
  "id": "temp-quarto-diogo",
  "name": "Temperatura Quarto Diogo",
  "class": "VariablesDevice"
},
{
  "variables": [
    {
      "name": "humidity",
      "expression": "$rhum-quarto-diogo",
      "type": "number",
      "unit": "%"
    }
  ],
  "xAttributeOptions": [],
  "hap": {
    "service": "Lightbulb"
  },
  "id": "rhum-quarto-diogo",
  "name": "Humidade Quarto Diogo",
  "class": "VariablesDevice"
},

I think this issue also happens for ShellSensor devices, but from pimatic-hap perspective, both should be treated as generic based on 'humidity' or 'temperature', right?

michbeck100 commented 7 years ago

Yes, that's right. Could you please test if you get the same behavior with a DummyTemperatureSensor?

pplucky commented 7 years ago

I will test them all and get back to you. It may take a couple of days, but this is a workaroundable issue, not critical at all.

Do you need any debug log for these tests?

pplucky commented 7 years ago

Hello.

I finally managed to test this with the following results:

Do you need me to do any more tests?

michbeck100 commented 7 years ago

First, thanks for testing. I will have a look whats wrong with this feature. I was thinking that it worked (at least someday in the past).

pplucky commented 7 years ago

No problem.

The other day I tried with another device type and this one worked properly (I wonder it might help you analyzing your code):

michbeck100 commented 6 years ago

Removing devices was implemented with 911375c. But i seems that sometimes devices still appear in the home app as disabled but don't get removed. There's nothing i can do at the moment. Therefor i close this issue for now.