jvmahon / Homebridge-HomeSeer4

Homebridge Plugin for HomeSeer 3 and 4
28 stars 8 forks source link

v1.0.6 corrupted the config of my smoke detectors and thinks my house is burning down #109

Closed teladog01 closed 4 years ago

teladog01 commented 4 years ago

Hi there. I don't see anything on the version history page for v1.0.6, but apparently something has changed with regard to the plugin handling of smoke sensors. After upgrading, all my smoke detectors showed as triggered..."Smoke Detected"...nearly gave me a heart attack as I was not at home at the time.

After checking the config.json, all of the "Off" values I had configured were gone. The only "Off" value left was "0". Here is an example of the config I had before the upgrade to 1.0.6:

                {
                    "type": "SmokeSensor",
                    "name": "Hallway Smoke Detector",
                    "ref": 1546,
                    "batteryRef": 1547,
                    "batteryThreshold": 78,
                    "offValues": [
                        0,
                        1,
                        2,
                        9,
                        12,
                        14,
                        13.255,
                        13.355
                    ]
                }

And after the upgrade they looked like this:

                {
                    "type": "SmokeSensor",
                    "name": "Hallway Smoke Detector",
                    "ref": 1546,
                    "batteryRef": 1547,
                    "batteryThreshold": 78,
                    "offValues": [
                        0
                    ]
                }

These are the First Alert ZCOMBO units...they are both smoke and carbon monoxide detectors. Here is what the status/graphics tab looks like for these units:

Screen Shot 2020-09-03 at 8 57 40 AM

Interestingly, I was able to add the missing "Off" values back, and the plugin seemed to have no problem with that. Also of note, I see there is a new "Settings" section for the plugin in Config UI X. When I open the settings for one of these smoke/co sensors, I don't see the "Off" values that were removed (which I added back), but they are still present in config.json.

Screen Shot 2020-09-03 at 9 08 30 AM Screen Shot 2020-09-03 at 9 11 18 AM
jvmahon commented 4 years ago

I am glad to to hear that your house did not burn down!

Version 1.0.6 added support to config-ui-x.

I'm not sure why this would have changed your configuration, but I'll try to look into this.

teladog01 commented 4 years ago

I am glad to to hear that your house did not burn down!

Ha! Me, too 😁

Let me know if you need any more info...

teladog01 commented 4 years ago

Update on this...I have restarted Homebridge several times while working on other stuff, and now HomeKit thinks my house is burning down again. Looks like the plugin has a problem with the "13.255" and "13.355" device values, as they are now missing again...

Screen Shot 2020-09-03 at 12 35 27 PM

Interestingly, I didn't lose all the other "Off" values this time, only the two non-Integer ones.

shawnparr commented 4 years ago

I'm also seeing the issue with non-integer values being lost on restart. My smoke/co detectors also use X.255 for status values.

Mine are also combination units, so I'm creating two advanced devices and manually setting the UUID_base value. For these devices it might be easier to have an "onValue" vs "offValue" since the have multiple values and one will be used for CO detected and another for Smoke detected.

mwolter805 commented 4 years ago

@teladog01 and @shawnparr, sent a pull request with an updated config.schema.json awaiting @jvmahon's approval. This update allows decimals to be entered in the offValues for all Advanced Device types that support offValues. offValues with decimals now also remain after a reboot. You will need to update Homebridge to version 1.1.6 and Homebridge Config UI X to version 4.27.1 for this to work. There is still an issue where multiple offValues are not displayed but remain in the config when saving and over a reboot of the server. I believe this is an issue with Config UI X as I believe the schema is good.

jvmahon commented 4 years ago

Thanks @mwolter Update 1.0.9 has been published. I'll close out this comment in a few days if no other issues are reported.

teladog01 commented 4 years ago

Yea 🙌 My house is no longer burning down 😄

Looks good here. I am seeing the noted issue that only the 0 off value shows in Config UI X, but all the off values, including the non-integer ones, are still there in the actual config.json. Thanks very much 👍

jvmahon commented 4 years ago

@shawnparr - Regarding the suggestion of using "onValue" rather than "offValue" - I intentionally didn't do that. I was considering what happens if someone misconfigures the device - I'd rather a false alarm due to a missing "offValue" (as that can then be corrected) then missing an alarm due during a fire due to forgetting an "onValue."