metbosch / homebridge-http-temperature

HomeBridge HomeKit Plugin for HTTP temperature endpoints
https://www.npmjs.com/package/homebridge-http-temperature
Apache License 2.0
33 stars 18 forks source link

HomeBridge hub being replaced with temperature sensor #12

Closed Tiger519 closed 6 years ago

Tiger519 commented 6 years ago

When I installed the plugin and edited my config.json, all of my devices started showing up as not responding, and the icon for the bridge changed to a temperature sensor. I didn't make any changes to the config other than adding the additional accessory

{ "accessory": "HttpTemperature", "name": "Temperature", "url": "http://weatherundergroundapi.json "field_name": "current_observation\"][\"temp_f", "update_interval": "0" }

I actually ended up having to delete and remove the bridge from my home to get things working again (even after I had removed the plugin and restored the config.json, removed persist/accessory folders). Not sure it is strictly related to this plugin, but things had been working flawlessly until I tried to add this plugin and it was quite strange behavior (and the fact that the HomeBridge hub icon changed to a temp sensor says to me that there had to be something related to this plugin).

I really like the idea of getting outside temperature into homekit without having to buy an expensive sensor, but homebridge also runs my door locks so I need to make sure nothing affects that functionality!

metbosch commented 6 years ago

@Tiger519 , Is the configuration JSON well copied? I see a missing quote at the end of url value. Independently, have you checked the homebridge log to see if there is an error message?

Tiger519 commented 6 years ago

It wasn't, the JSON was on my Pi so I just typed in manually on my PC. But I have found that it's actually an issue with the accessories/persist folder and changing the JSON. I made some changes (to make a value for field name that could get a nested value), and when I started homebridge back up it got really confused. I ran into the same issue with a different plugin, so it wasn't caused by your plugin. The temperature icon on the bridge was probably just an artifact of the way I updated the JSON. I haven't had issues when adding/removing platforms on the fly, so I guess it's something to do with the way homebridge handles accessories.

I think if I tried again I could probably get it to work, but I ended up finding a plugin specifically for Weather Underground which I have working now (though that was the other one that also turned my bridge into a sensor). I'm assuming creating a nested field name as above would work fine in your plugin. Seems the code would support it. Anyway, as I think the issue was with the homebridge config I'll go ahead and close the issue.