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

Expose error states #21

Open
mikelward opened this issue Aug 31, 2024 · 0 comments
Open

Expose error states #21

mikelward opened this issue Aug 31, 2024 · 0 comments

Comments

@mikelward
Copy link

mikelward commented Aug 31, 2024

T-Smart exposes warnings and errors.

I'd love to get notified when there is an error so I can go check, and switch over my to boiler. (Right now, I'm using it being in heat mode and the temperature not going up, but I think it would be nice to know exactly when the error happened.)

Don't have access to my laptop right now, but from what I can see, creating binary sensors for warning and error might be a simple approach?

class TSmartErrorEntity(TSmartCoordinatorEntity, BinarySensorEntity):
    _attr_device_class = BinarySensorDeviceClass.PROBLEM

    # Inherit name from DeviceInfo, which is obtained from actual device
    _attr_has_entity_name = True
    _attr_name = "Error"

    @property
    def is_on(self):
        return self._tsmart.mode == self._tsmart.mode.CRITICAL

class TSmartWarningEntity(TSmartCoordinatorEntity, BinarySensorEntity):
    _attr_device_class = BinarySensorDeviceClass.PROBLEM

    # Inherit name from DeviceInfo, which is obtained from actual device
    _attr_has_entity_name = True
    _attr_name = "Warning"

    @property
    def is_on(self):
        return self._tsmart.mode == self._tsmart.mode.LIMITED

Happy to send a pull request later if you like.

Eventually I'd also like to know which error code it is, e.g. E03, but the above would be sufficient.

Thanks!

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