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

Error Codes in Telemetry #4

Open
ztnel opened this issue Oct 28, 2021 · 1 comment
Open

Error Codes in Telemetry #4

ztnel opened this issue Oct 28, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ztnel
Copy link
Member

ztnel commented Oct 28, 2021

Description

The mqtt helper needs to be modified to also indicate the device status. Now this reporting must be performed at. a regular interval and not state driven. If we do not get a new telemetry reading from the device or something else goes wrong we report an error code in the telemetry indicating to the cloud that the device is still online but something went wrong. This removes the need for a seperate status channel.

class ErrCodes(Enum):
     NO_DOCUMENT = 0

payload = {
    'err':ErrCodes.NO_DOCUMENT,
    'TC': icb.tc,
    'CC': icb.cc,
    'OC': icb.oc,
    'RH': icb.rh,
    'TP': icb.tp,
    'CP': icb.cp,
    'OP': icb.op,
    'TO': icb.to,
    'time': icb.timestamp,
    'exp_id': "-1",
    'ttl': 0 if save_point else datetime.now(timezone.utc).timestamp() + 120,
    'point_type': 1 if save_point else 0
}
@ztnel ztnel added the enhancement New feature or request label Oct 28, 2021
@ztnel ztnel self-assigned this Oct 28, 2021
@BrandonLucasZhu
Copy link
Contributor

BrandonLucasZhu commented Oct 29, 2021

FOR THE err key in the telemetry,
0 = idle (Meaning IRIS is operating normally no problems)
1 = alarm (Meaning something went wrong)

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

No branches or pull requests

2 participants