-
Notifications
You must be signed in to change notification settings - Fork 9
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
"Status" sensor and "Last API call Successful" sensor #76
Comments
I think maybe I found how to include the "status" sensor and the "last_api_call_successful" sensor to show which was the last time and date from a successful connection to API and therefore if the API is "online" or "offline". The solution requires to edit ecowater.py in order to create a couple more properties. And the we can add theses properties as sensors in the sensor.py and const.py files. ecowater.py code:
Then we should add at sensor.py the new sensors:
And we should edit const.py to add a couple of lines:
@barleybobs, do you think this could work and wouldn't break the code? |
Tested and it works OK. No warnings at logs. |
In the previous code there was a "status" sensor that was showing if the device was "online" or "offline"
At ecowater.py there was this part of code:
Was the API sending the data for the status sensor? I don't know if it could be easily implemented in the new code? Or maybe it could be added in another way.
Then the integration, at sensor.py was adding the status sensor:
It is a sensor I was using to manage an automation that sends a notification when the device became "offline". It is not a huge problem ... I can modify the automation just to check if any other sensor (like "water used today") became "unavailable" or "unknown".
Thank you for all the work. The integration looks great.
The text was updated successfully, but these errors were encountered: