barleybobs / homeassistant-ecowater-softener

A Homeassistant custom component to integrate Ecowater water softeners
https://github.com/barleybobs/homeassistant-ecowater-softener
MIT License
33 stars 10 forks source link

Add water use per day #4

Closed zuzuman closed 1 year ago

zuzuman commented 2 years ago
    # Query the JSON endpoint for the additional data

    additionalData = s.get('https://www.wifi.ecowater.com/Dashboard/GraphBy?by=week&date=' + str(today.strftime("%Y-%m-%d")) + '&dsn=' + str(dsn['dsn']), headers=headers)
    self._attrs[ATTR_WATER_USE_PER_DAY] = data_json[json.loads(additionalData.text)]

Thanks :)

barleybobs commented 2 years ago

Please explain what you want. I can see that your code returns the water usage for the last week.

zuzuman commented 2 years ago

Not last week, but current :) image If we can grab all info - why not to get it?

barleybobs commented 2 years ago

Nice idea but I have some improvments. It would be better to have a separate sensor that holds today's water usage, which you can then use in a graph entity. Would that fulfil your needs?

barleybobs commented 1 year ago

Sorry for the long wait for this feature. There are now separate sensors in v3.0.0. Please make sure to follow the instructions to make sure you do not experience any issues.

Thanks :+1: