Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Assistant; Auto Discovery; MQTT; Temp Sensors do not get deleted and redefined properly when added/removed #55

Closed
nielsonm236 opened this issue Apr 14, 2021 · 3 comments

Comments

@nielsonm236
Copy link
Owner

When adding and removing temperature sensors the definitions in Home Assistant do not update properly. It appears that sensors that are removed do not get deleted in Home Assistant via Auto Discovery.

@nielsonm236
Copy link
Owner Author

The original issue described here was focused on failure to remove missing sensors on reboot. The "reboot" aspect has been fixed and will be in the next release.

@nielsonm236
Copy link
Owner Author

Well ... the "reboot" aspect is fixed simply by the nature of how the fix for issue #58 works. But if a temperature sensor is deleted while power is off it does not get deleted in HA, because the Network Module doesn't store the previous temperature sensor IDs through a power loss. Thus, on power on, the Network Module does not know it needs to send a "delete" message to HA for sensors that were there before power loss, and the Network Module does not know the serial numbers of devices that went away.
So, per issue #58 add/removal during runtime works fine, but removal during power down does not. The workaround is to manually delete the sensor entity in Home Assistant, and perhaps that is a sufficient solution. But, of course, it sure would be nice if it was "auto-magic".
To make it work automatically requires storing the serial number IDs of the devices. That won't fit in EEPROM, but they could be stored in Flash. This would require making sure unnecessary writes to Flash do not occur since it has a very limited write life cycle. I think this needs to be shelved for the moment.

nielsonm236 added a commit that referenced this issue May 9, 2021
Fixed Issue #55: Home Assistant; Auto Discovery; MQTT; Temp Sensors do not get deleted and redefined properly when added/removed
Fixed Issue #56: Temperature Sensor accuracy improvement
Fixed Issue #57: Temperature sensor order in GUI and Home Assistant. Fixed by changing Temperature Sensor ID’s from “1, 2, 3, 4, 5” to a 12 character ID per sensor that is based on the sensor serial number
Fixed Issue #58: Home Assistant; Auto Discovery; MQTT; Should a temperature sensor be deleted in HA if it fails during runtime?
Fixed Issue #62: Browser Only; Timers don’t work with Invert setting. Included in fix is a correction for “Timer values not saved correctly” and “Timer value being set to 256 in error”.
Fixed Issue #63: REST commands preventing IO Control page from making pin state changes.
Fixed Issue #66: MQTT doesn’t report temperature sensors
@nielsonm236
Copy link
Owner Author

Since the reboot part is fixed (admittedly via issue #58) I'm going to close this issue and open a new one focused on Temperature Sensor removal during power-off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant