Ecowater softener -> how to integrate this python script?

Thank you!
If anyone is interested, this is how I broke down attributes to entities using this integration:

template:
  - sensor:
      #Ecowater Softener
      - name: "Ecowater Days until out of salt"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'days_until_out_of_salt') }}"
        icon: mdi:calendar-end
        device_class: duration
        unit_of_measurement: 'day(s)'
      - name: "Ecowater Out of salt on"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'out_of_salt_on') }}"
        icon: mdi:calendar-today-outline
      - name: "Ecowater Salt level"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'salt_level_percentage') }}"
        unit_of_measurement: '%'
        icon: mdi:page-layout-header
      - name: "Ecowater Water used today"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'water_used_today') }}"
        unit_of_measurement: 'l'
        icon: mdi:water-plus-outline
      - name: "Ecowater Water used per day average"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'water_used_per_day_average') }}"
        unit_of_measurement: 'l'
        icon: mdi:water-percent
      - name: "Ecowater water available"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'water_available') }}"
        unit_of_measurement: 'l'
        icon: mdi:waves

  - binary_sensor:
      #Ecowater Softener
      - name: "Ecowater status"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'status') }}"
        #icon: mdi:power
      - name: "Ecowater Recharge enabled"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'recharge_enabled') }}"
      - name: "Ecowater Recharge scheduled"
        state: "{{ state_attr('sensor.ecowater_ac000w007138272', 'recharge_scheduled') }}"
2 Likes

Hi

I have just noticed my homeassistant hasn’t been getting updates from appdaemon for my ecowater, i have changed the URL to wifi.ecowater.com on all 3 entries in the ecowater.py file, but im still getting this in the logs

> 2022-09-19 22:32:35.764040 WARNING EcoWater: ------------------------------------------------------------
> 2022-09-19 22:32:35.764727 WARNING EcoWater: Unexpected error in worker for App EcoWater:
> 2022-09-19 22:32:35.765301 WARNING EcoWater: Worker Ags: {'id': '021be9db5994475bb87bae8ee79b21ff', 'name': 'EcoWater', 'objectid': '941e300f672f435d8bc793ec07aa3df7', 'type': 'scheduler', 'function': <bound method EcoWater.run_parsing of <ecowater.EcoWater object at 0x7f49342fc8b0>>, 'pin_app': True, 'pin_thread': 0, 'kwargs': {'interval': 900, '__thread_id': 'thread-0'}}
> 2022-09-19 22:32:35.765773 WARNING EcoWater: ------------------------------------------------------------
> 2022-09-19 22:32:35.766626 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)
> 2022-09-19 22:32:35.766995 WARNING EcoWater: ------------------------------------------------------------
> 2022-09-19 22:32:35.770734 WARNING AppDaemon: callback run_parsing() in EcoWater has now completed

any one seen this before? any ideas whats wrong?

Thanks

Neil

You may try this integration:

Has anyone created this for Hoobs?