Git Product home page Git Product logo

ecowater-softener's Introduction

Ecowater Softener

PyPI PyPI - Python Version PyPI - License GitHub Repo stars

ecowater-softener is a Python library for collecting information from Ecowater water softeners.

Installation

Use the package manager pip to install ecowater.

pip install ecowater-softener

Usage

from ecowater_softener import Ecowater

ecowaterDevice = Ecowater('username', 'password', 'serialnumber')

# returns 'all data other commands can get' as a dictionary
ecowaterDevice.getData()

# returns 'days until the device is out of salt' as an integer
ecowaterDevice.daysUntilOutOfSalt()

# returns 'date when device will run out of salt' as string object
ecowaterDevice.outOfSaltOn()

# returns 'the salt level' as an integer
ecowaterDevice.saltLevel()

# returns 'the salt level in percent' as an integer
ecowaterDevice.saltLevelPercent()

# returns 'the amount of water used today' as an integer
ecowaterDevice.waterUsageToday()

# returns 'the average amount of water used daily' as an integer
ecowaterDevice.waterUsageDailyAverage()

# returns 'the amount of water available' as an integer
ecowaterDevice.waterAvailable()

# returns 'the amount of water flow' as an integer
ecowaterDevice.waterFlow()

# returns 'the units for the water measurements' as a string
ecowaterDevice.waterUnits()

# returns 'true or false depending on whether recharge is enabled'
ecowaterDevice.rechargeEnabled()

# returns 'true or false depending on whether there is a recharge scheduled'
ecowaterDevice.rechargeScheduled()

# returns 'true or false depending on whether the device is online'
ecowaterDevice.deviceStatus()

Using ecowaterDevice.getData() is optimal as it only uses one request and returns all of the data as a dictionary.

E.g. {'daysUntilOutOfSalt': 421, 'outOfSaltOn': datetime.datetime(2025, 5, 5, 0, 0), 'saltLevel': 3, 'saltLevelPercent': 21, 'waterUsageToday': 50, 'waterUsageDailyAverage': 143, 'waterAvailable': 1332, 'waterFlow': 0, 'waterUnits': 'Liters', 'rechargeEnabled': True, 'rechargeScheduled': False, 'deviceStatus': True}

Credits

Thanks to Kyle Johnson for his work on using python to interface with Ecowater water softeners. Most of this libraries code is built upon code which he wrote. You can read his article regarding scraping data from Ecowater water softeners at https://gnulnx.net/2020/02/18/ecowater-api-scraping/

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

ecowater-softener's People

Contributors

barleybobs avatar

Stargazers

 avatar Andrew Ryder avatar Pedraza A. Henry avatar Luke Else avatar Lander avatar  avatar  avatar Benny avatar  avatar

Watchers

Brad avatar  avatar

ecowater-softener's Issues

Daily Consumption not working - Sync Error

Hi,
the daily water consumption is not working. It updates but freezes after an unknown period of time. After a softener reboot, it works until it freezes again.
I had contact to Ecowater and they communicated this is a problem when using a third party smart home integration. The integrations results in sync errors between the softener and the dashboard. Idk if this is valid...
Anybody else facing this issue?

Thank you and best regards!

Reuse Established Connection

Currently each function to query status (e.g. saltLevel, saltLevelPercent, waterUnits) makes a call to _get() and subsequently establishes a new server connection/login. This not only makes querying multiple server status values time consuming, the vendor may identify this resource strain and take decisive action.

Is it possible to re-use an already established server connection to query every X number of seconds for updated status values, or is the connection forcibly closed after every server query?

Alternatively, a more conservative server resources approach might be to create class variables for each status value of interest, updating ALL of the class variables via a single call to _get() once they are determined stale. The server call to "/Dashboard/UpdateFrequentData" already returns all possible status values. Use this single call to update the class variables.

Perhaps 'staleness' could be given by a user defined value? Function calls for each status value of interest (e.g. saltLevel, saltLevelPercent) would simply return the current value of the class variable (if not stale, else obtain new values from server).

Thank you for the effort given to this and I greatly look forward to a future HomeAssistant integration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.