Ecowater softener -> how to integrate this python script?

@kalhimeo is there way to avoid putting plain text values for DSN, username and password in app.yaml? I tried moving these values to secrets.yaml but the integration stopped working and I could not figure out a way to make app.yaml read the DSN, username and password from secrets.yaml file.

I have no idea, I am still quite new with these things :stuck_out_tongue: sorry

@kalhimeo
Great thanks for this scripts and instructions indeed!
I got it working almost directly with your instructions.

Thanks a lot… :smiley:

@kalhimeo you did it perfectly, I was not starting the AppDaemon correctly. I’m able to put DSN, email and password in secrets.yaml and it is working like a charm!!
Thanks!

The integration was working for couple days like a charm, but yesterday, without any changes it disconencted and now I cannot get any data from ecowater. I can login to the ecowater website and mobile app without any issues, but the data are not coming to HA. Has anybody seen similar issue?

I don’t have any problem here, still works as usual

Hi, i tried this but I cant get it to work Please can you help.

Running Home Assistant Supervised 2021.7.4 on Raspberry Pi 4

Here is what I did:

Created Mqtt-user in HA

Supervisor > Add-On Store > Installed Mosquitto broker Enabled Boot and Watchdog > Start > Restarted HA

Configuration > integrations > added MQTT that was found by HA with Mqtt-user details

Supervisor > Add-On Store > Installed AppDaemon 4 (v0.6.2) > Enabled Boot, Watchdog and Auto update > Start > Restarted HA

File Editor - I can see new appdaemon folder created with defaults

Configuration > integrations > HACS > Configure > Enabled “Enable AppDaemon apps discovery & tracking” > Restarted HA

File Editor > Edited /config/appdaemon/apps/apps.yaml and added the following

EcoWater:
  module: ecowater
  class: EcoWater
  ecowater_minutes: 60
  ecowater_dsn: 'ACxxxxxxxxxxxxx'
  ecowater_email: '[email protected]'
  ecowater_password: 'xxxxxxxxxx'

File Editor > created /config/appdaemon/apps/ecowater.py and pasted contents from here

File Editor > edited ‘/config/appdaemon/appdaemon.yaml’ and added this to the end.

MQTT:
  type: mqtt
  namespace: mqtt
  verbose: True

File Editor > edited /config/configuration.yaml and added:

sensor:
  - platform: mqtt
    name: Out of Salt Days
    state_topic: "ecowater/out_of_salt_days"
    unit_of_measurement: 'days'

  - platform: mqtt
    name: Ecowater Salt Level
    state_topic: "ecowater/salt_level"
  
  - platform: mqtt
    name: Ecowater Salt Level Percent
    state_topic: "ecowater/salt_level_percent"
    unit_of_measurement: '%'
  
  - platform: mqtt
    name: Ecowater Water Today
    state_topic: "ecowater/water_today"
    unit_of_measurement: "gallons"
  
  - platform: mqtt
    name: Ecowater Water Average
    state_topic: "ecowater/water_avg"
    unit_of_measurement: "gallons"
  
  - platform: mqtt
    name: Ecowater Water Available
    state_topic: "ecowater/water_avail"
    unit_of_measurement: "liters"
  
  - platform: mqtt
    name: Ecowater Water Flow
    state_topic: "ecowater/water_flow"
    unit_of_measurement: "GPM"

binary_sensor:
- platform: mqtt
  name: Ecowater Online
  state_topic: "ecowater/online"
  payload_on: True
  payload_off: False

- platform: mqtt
  name: Ecowater Recharge Enabled
  state_topic: "ecowater/recharge"
  payload_on: True
  payload_off: False
  
- platform: mqtt
  name: Ecowater Out oF Salt
  state_topic: "ecowater/out_of_salt"
  payload_on: True
  payload_off: False

Restarted and added the entities entities to HA but All I see is Off and Unknown…

Anything I missed or did wrong ?

Thanks in Advance.

Hi All,

It seems like its working now but intermittently. It comes and goes. Anybody else noticed that.

Thanks for all your help

Hi rbhalla, I did not experience such problem, but note that the script only pulls the data from Ecowater every 60 minutes, so don’t expect live values.

@kalhimeo
Thak you so much, it’s working!

1 Like

Looks like the app doesn’t capture the initial data for 60mins from first run.

Is it possible to update it so it connects and captures the data at startup, then run every X minutes after to refresh?

Hi, normally it should do an initial update at startup, but you may try to modify this line in ecowater.py :

self.run_every(self.run_parsing, datetime.datetime.now() + timedelta(seconds=3), self.args["ecowater_minutes"] * 60)

to

self.run_every(self.run_parsing, datetime.datetime.now() + timedelta(seconds=60), self.args["ecowater_minutes"] * 60)

Not sure if will help as I am not the coder of the original script (I only adapted it for Appdaemon), but you can give it a try

Thanks, will look at that line.

I reduced the delay by modifying

ecowater_minutes: 60

to

ecowater_minutes: 10

which runs the script every 10 mins, but still waits for the first data acquisition.

Giving it sone thought, it’s only an issue after a restart, so I’m not going to worry too much if I can’t solve it easily.

You can indeed increase the polling cylce, but it will have a big impact for such a rare problem.
Modifying the line above defines when to start the first run : normally scheduled at actual time + 3 seconds, changed to +60 seconds as maybe other components are not ready yet on your system (network, internet connection ?).

The python script stopped working with the latest update of appdaemon, which bumps the python version to 3.10.
Not much info in the appdeamon log, except:
2022-07-12 14:41:42.735619 WARNING EcoWater: Traceback (most recent call last):
File “/usr/lib/python3.10/site-packages/appdaemon/threading.py”, line 904, in worker
funcref(self.AD.sched.sanitize_timer_kwargs(app, args[“kwargs”]))
File “/config/appdaemon/apps/ecowater.py”, line 70, in run_parsing
jsonv = json.loads(data.text)
File “/usr/lib/python3.10/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.10/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 2 (char 1)

Anyone with any insights?

Thx

P.

I Patrick, I stopped maintaining this script as someone made an integration accessible via HACS : https://github.com/barleybobs/homeassistant-ecowater-softener
It works fine with the latest HA version :wink:

2 Likes

I have that integration installed also, but you have to click on attributes to actually see them.
With yours all attributes were always visible.

Any chance of giving the script the necessary python 3.10 update?

Thx

Patrick

Sorry I won’t be able to do that, I am not the creator of the python script, I only adapted it to make it work with appdaemon, so my python knowledge is too limited :frowning:

I have an ecowater eVolution 400 Boost water softener, but even this site does not work for me: https://www.wifi.ecowater.com/Site/Login

you may try to replace the url with

https://wifi.ecowater.com/Site/Login

1 Like