core icon indicating copy to clipboard operation
core copied to clipboard

Ecowitt new device WFC01 unhandled by integration

Open zipzagster opened this issue 2 years ago • 56 comments

The problem

Ecowitt has a new device, a water valve, that when added to the GW2000 does not appear in the integration

What version of Home Assistant Core has the issue?

2023.8.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Ecowitt

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

zipzagster avatar Aug 04 '23 21:08 zipzagster

Hey there @pvizeli, mind taking a look at this issue as it has been labeled with an integration (ecowitt) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of ecowitt can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign ecowitt Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


ecowitt documentation ecowitt source (message by IssueLinks)

home-assistant[bot] avatar Aug 04 '23 21:08 home-assistant[bot]

Following too see if this gets movement

cloudbr34k84 avatar Oct 04 '23 00:10 cloudbr34k84

Also following as just purchased a WFC01 and wanting to control it from HomeAssistant via this Ecowitt integration.

stevekmoore avatar Dec 04 '23 01:12 stevekmoore

how is it?

mortenx avatar Dec 19 '23 23:12 mortenx

Following as well.

CAT1210 avatar Dec 29 '23 19:12 CAT1210

Would be great if this valve could be supported but I suspect it may not be possible

pauljatho avatar Jan 04 '24 15:01 pauljatho

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I keep HA updated and haven't seen this valve in the implementation or heard anything about whether or not it's even possible, yet....

CAT1210 avatar Apr 03 '24 16:04 CAT1210

As above, there has been no information I've seen to suggest this implementation has even been considered, let alone worked on. Still hopeful this can be added

cokecan72 avatar Apr 05 '24 13:04 cokecan72

Just purchased WFC01 + GW2000 + WH51 assuming it could integrate with HA. Read a post from Dec-23 stating a few months for this integration to be added to Ecowitt HA integration. Any update that Ecowitt could post here?

mhors avatar May 11 '24 17:05 mhors

This link here suggests a development will be delivered by Feb-2924.

https://community.home-assistant.io/t/ecowitt-weatherstation-integration-for-home-assistant/194718/322

mhors avatar May 11 '24 17:05 mhors

As I've received my WFC01 recently I've spent some time on getting it to work with HA. The good thing: the local web-service of the Ecowitt Gateway (GW2000 in my case) gives access to the subdevices without any issue.

This works already with rest-command/rest in HA to get all information about the subdevice and control it:

rest_command:
  watering_turn_on:
    url: http://192.168.x.x/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"on_type":0,"off_type":0,"always_on":1,"on_time":0,"off_time":0,"val_type":1,"val":0,"cmd":"quick_run","id":123,"model":1}]}'

  watering_turn_off:
    url: http://192.168.x.x/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"cmd":"quick_stop","id":123,"model":1}]}'

rest:
  - resource: "http://192.168.x.x/parse_quick_cmd_iot"
    method: POST
    scan_interval: 10
    payload: '{"command":[{"cmd":"read_device","id":123,"model":1}]}'
    sensor:
      - name: "Water Temperature"
        value_template: "{{ value_json['command'][0]['water_temp'] }}"
        unit_of_measurement: "°C"
      - name: "Water Total"
        value_template: "{{ value_json['command'][0]['water_total'] }}"
        unit_of_measurement: "L"
    binary_sensor:
      - name: "Water On"
        value_template: "{{ value_json['command'][0]['water_running'] }}"

As this is just a test implementation: To Query all subdevices (iot-devices) there is also an endpoint for that: http://192.168.x.x/get_iot_device_list (device-id is not 123, I've changed it to that)

Response:

{"command":[{"cmd":"read_quick","model":1,"id":123,"ver":113,"rfnet_state":1,"battery":5,"signal":4}]}

I'm no python-dev. But I really think that thos ecowitt-subdevices could be easy integrated in the official HA-Integration. Currently it looks that on my Dashboard (Bewässerung = Watering):

image

Hope someone has skills & time to integrate it. Thanks!

domhaas avatar May 31 '24 20:05 domhaas

Thanks! I also added like this.

There are plenty parameters:

http://192.168.x.x/get_iot_device_list

{"command":[{"cmd":"read_quick","model":1,"id":12345,"ver":113,"rfnet_state":1,"battery":4,"signal":2}]}

and

http://192.168.x.x/parse_quick_cmd_iot

{"command":[{"model":1,"id":12345,"nickname":"WFC01-0000123E","devicename":"h5PvBXKkzABC12rnTDMi","version":113,"water_status":0,"warning":0,"always_on":1,"val_type":1,"val":0,"run_time":12,"wfc01batt":5,"rssi":2,"gw_rssi":-75,"timeutc":1717279140,"publish_time":1717262636,"water_action":36,"water_running":0,"plan_status":0,"water_total":"70.795","happen_water":"70.673","flow_velocity":"0.00","water_temp":"17.0"}]}

Similar could be for other device (model 2) AC1100 WittSwitch Smart Plug 'ac_running','happen_elect', 'elect_total', 'realtime_power', 'ac_action', 'ac_voltage'

bitlisz1 avatar Jun 01 '24 23:06 bitlisz1

As I've received my WFC01 recently I've spent some time on getting it to work with HA. The good thing: the local web-service of the Ecowitt Gateway (GW2000 in my case) gives access to the subdevices without any issue.

Thank you, implemented here as well. Also added a switch template but the value template has sync issues (flipping on/off continually ?) so had to comment it out :

- platform: template
  switches:
    ex_water_valve_ecowitt1:
      friendly_name: EX water valve ecowitt1
#     value_template: "{{ is_state('binary_sensor.ex_water_valve_ecowitt_wittflow1_water_running', 'on') }}"
      turn_on:
        - service: rest_command.ex_water_valve_ecowitt_wittflow1_turn_on
          data: {}
      turn_off:
        - service: rest_command.ex_water_valve_ecowitt_wittflow1_turn_off
          data: {}

BTW how/where did you find the commands/sensors data and usage?

Did you figure out a way to have a bidirectionnal switch (updating status) ?

maybe "water running" is not the correct parameter (valve not connected to water now). I there a "valve status" (on/off) which could be leveraged?

Thanks!

Montreal666 avatar Jun 02 '24 16:06 Montreal666

As I've received my WFC01 recently I've spent some time on getting it to work with HA. The good thing: the local web-service of the Ecowitt Gateway (GW2000 in my case) gives access to the subdevices without any issue.

Thank you, implemented here as well. Also added a switch template but the value template has sync issues (flipping on/off continually ?) so had to comment it out :

- platform: template
  switches:
    ex_water_valve_ecowitt1:
      friendly_name: EX water valve ecowitt1
#     value_template: "{{ is_state('binary_sensor.ex_water_valve_ecowitt_wittflow1_water_running', 'on') }}"
      turn_on:
        - service: rest_command.ex_water_valve_ecowitt_wittflow1_turn_on
          data: {}
      turn_off:
        - service: rest_command.ex_water_valve_ecowitt_wittflow1_turn_off
          data: {}

BTW how/where did you find the commands/sensors data and usage?

I've just used the (local) webinterface of the GWA2000 und looked into the debug-tools of the browser what requests have been sent.

Did you figure out a way to have a bidirectionnal switch (updating status) ?

No. But I don't think there are any: the local webinterface have separated calls.

maybe "water running" is not the correct parameter (valve not connected to water now). I there a "valve status" (on/off) which could be leveraged?

I think we need to find that out. This is the response: image

domhaas avatar Jun 02 '24 17:06 domhaas

Maybe "water status" (or does this check for water presence in the valve?) . Will run some more tests and report back. Thx

Montreal666 avatar Jun 02 '24 17:06 Montreal666

My switch template looks like this and seems to work:

switch:
  - platform: template
    switches:
      wfc01_watering:
        friendly_name: "WFC01 Watering"
        value_template: "{{ is_state('binary_sensor.wfc01_water_on', 'on') }}"
        turn_on:
          service: rest_command.wfc01_watering_turn_on
          data:
            zoneid: 1
            turn_on: 1
        turn_off:
          service: rest_command.wfc01_watering_turn_off
          data:
            zoneid: 1
            turn_on: 0

Watering_off

Watering_on

bitlisz1 avatar Jun 02 '24 20:06 bitlisz1

Can you provide your code for binary_sensor.wfc01_water_on ?

Thx

Montreal666 avatar Jun 02 '24 21:06 Montreal666

Here is all related to WFC01 from my config.yaml:


rest_command:
  wfc01_watering_turn_on:
    url: http://192.168.1.123/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"on_type":0,"off_type":0,"always_on":1,"on_time":0,"off_time":0,"val_type":1,"val":0,"cmd":"quick_run","id":12345,"model":1}]}'

  wfc01_watering_turn_off:
    url: http://192.168.1.123/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"cmd":"quick_stop","id":12345,"model":1}]}'

rest:
  - resource: "http://192.168.1.123/parse_quick_cmd_iot"
    method: POST
    scan_interval: 10
    payload: '{"command":[{"cmd":"read_device","id":12345,"model":1}]}'
    sensor:
      - name: "WFC01 Water Total"
        value_template: "{{ value_json['command'][0]['water_total'] }}"
        unit_of_measurement: "L"
      - name: "WFC01 Water Flow Velocity"
        value_template: "{{ value_json['command'][0]['flow_velocity'] }}"
        unit_of_measurement: "L/min"
      - name: "WFC01 Water Temperature"
        value_template: "{{ value_json['command'][0]['water_temp'] }}"
        unit_of_measurement: "°C"
      - name: "WFC01 Water Run Time"
        value_template: "{{ value_json['command'][0]['run_time'] }}"
        unit_of_measurement: "sec"
      - name: "WFC01 Battery"
        value_template: "{{ value_json['command'][0]['wfc01batt'] }}"
        unit_of_measurement: "level"
      - name: "WFC01 RSSI"
        value_template: "{{ value_json['command'][0]['rssi'] }}"
        unit_of_measurement: "level"
    binary_sensor:
      - name: "WFC01 Water On"
        value_template: "{{ value_json['command'][0]['water_running'] }}"
      - name: "WFC01 Water Plan Status"
        value_template: "{{ value_json['command'][0]['plan_status'] }}"
      - name: "WFC01 Water Status"
        value_template: "{{ value_json['command'][0]['water_status'] }}"
      - name: "WFC01 Water Warning"
        value_template: "{{ value_json['command'][0]['warning'] }}"

bitlisz1 avatar Jun 02 '24 22:06 bitlisz1

Thanks! Is your valve connected to water? My status keeps toggling on/off on but I suspect it is related to the valve not being connected to water; The actual valve relay doesn't trigger, just the status toggling on/off on each scan interval.

image

Montreal666 avatar Jun 02 '24 23:06 Montreal666

Yes, mine is connected to water.

bitlisz1 avatar Jun 03 '24 06:06 bitlisz1

I have yet to try out the above access to my GW2000A, but for what it's worth, I have noticed spurious 'no water' notification at the start of a 'water on' event. This may be what @Montreal666 is experiencing also.

Screenshot_2024-06-03-07-27-26-44_aa17207b2fdd1d98a56b347e71d60713

mhors avatar Jun 03 '24 06:06 mhors

Thank you so much for this work around using REST! Just set it up and it's working great. I've had two of these devices since they were released in the UK but have largely been unable to use them the way wanted (via HA automations) till now. This looks like it'll work well until the official integration is updated.

cokecan72 avatar Jun 04 '24 11:06 cokecan72

This doesn't seem to be working for me, I've literally copied / pasted the code and then changed to my IP address which I know is correct as I can login to the web admin for the gateway, and all of the sensors come up as unavailable, any ideas what could be wrong?

Only thing possibly different is that I also have an Ecowitt weather station and the gateway picks up those sensors but can't imagine this to be an issue.

Model number on my unit is WFC01C

My code

#-----------------------------------------------------------
## Ecowitt Water valve
#-----------------------------------------------------------        
rest_command:
  wfc01_watering_turn_on:
    url: http://192.168.88.149/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"on_type":0,"off_type":0,"always_on":1,"on_time":0,"off_time":0,"val_type":1,"val":0,"cmd":"quick_run","id":12345,"model":1}]}'

  wfc01_watering_turn_off:
    url: http://192.168.88.149/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"cmd":"quick_stop","id":12345,"model":1}]}'

rest:
  - resource: "http://192.168.88.149/parse_quick_cmd_iot"
    method: POST
    scan_interval: 10
    payload: '{"command":[{"cmd":"read_device","id":12345,"model":1}]}'
    sensor:
      - name: "WFC01 Water Total"
        value_template: "{{ value_json['command'][0]['water_total'] }}"
        unit_of_measurement: "L"
      - name: "WFC01 Water Flow Velocity"
        value_template: "{{ value_json['command'][0]['flow_velocity'] }}"
        unit_of_measurement: "L/min"
      - name: "WFC01 Water Temperature"
        value_template: "{{ value_json['command'][0]['water_temp'] }}"
        unit_of_measurement: "°C"
      - name: "WFC01 Water Run Time"
        value_template: "{{ value_json['command'][0]['run_time'] }}"
        unit_of_measurement: "sec"
      - name: "WFC01 Battery"
        value_template: "{{ value_json['command'][0]['wfc01batt'] }}"
        unit_of_measurement: "level"
      - name: "WFC01 RSSI"
        value_template: "{{ value_json['command'][0]['rssi'] }}"
        unit_of_measurement: "level"
    binary_sensor:
      - name: "WFC01 Water On"
        value_template: "{{ value_json['command'][0]['water_running'] }}"
      - name: "WFC01 Water Plan Status"
        value_template: "{{ value_json['command'][0]['plan_status'] }}"
      - name: "WFC01 Water Status"
        value_template: "{{ value_json['command'][0]['water_status'] }}"
      - name: "WFC01 Water Warning"
        value_template: "{{ value_json['command'][0]['warning'] }}"

![WFC](https://github.com/home-assistant/core/assets/60437563/516ebda1-1567-48e6-96b6-fe4c020aeb9a)


pauljatho avatar Jun 04 '24 13:06 pauljatho

you need to change the 'id' in the payload as well as the IP address in the URL. This is unique to your device.

Following domhaas and bitlistz1's post earlier, you need to load http://192.168.x.x/get_iot_device_list (either in a web page or CURL or similar). This will list all the iot devices connected and also give you the unique ID's for each. Obviously change the IP address to match your gateway :) Worth just double checking the 'model' in the payload matches what's in this URL too

cokecan72 avatar Jun 04 '24 13:06 cokecan72

Following domhaas and bitlistz1's post earlier, you need to load http://192.168.x.x/get_iot_device_list (either in a web page or CURL or similar).

Ah thanks a million I somehow missed that, it's working now, appreciate the help.

pauljatho avatar Jun 04 '24 13:06 pauljatho

Here is all related to WFC01 from my config.yaml:


rest_command:
  wfc01_watering_turn_on:
    url: http://192.168.1.123/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"on_type":0,"off_type":0,"always_on":1,"on_time":0,"off_time":0,"val_type":1,"val":0,"cmd":"quick_run","id":12345,"model":1}]}'

  wfc01_watering_turn_off:
    url: http://192.168.1.123/parse_quick_cmd_iot
    method: POST
    content_type: "application/json; charset=utf-8"
    payload: '{"command":[{"cmd":"quick_stop","id":12345,"model":1}]}'

rest:
  - resource: "http://192.168.1.123/parse_quick_cmd_iot"
    method: POST
    scan_interval: 10
    payload: '{"command":[{"cmd":"read_device","id":12345,"model":1}]}'
    sensor:
      - name: "WFC01 Water Total"
        value_template: "{{ value_json['command'][0]['water_total'] }}"
        unit_of_measurement: "L"
      - name: "WFC01 Water Flow Velocity"
        value_template: "{{ value_json['command'][0]['flow_velocity'] }}"
        unit_of_measurement: "L/min"
      - name: "WFC01 Water Temperature"
        value_template: "{{ value_json['command'][0]['water_temp'] }}"
        unit_of_measurement: "°C"
      - name: "WFC01 Water Run Time"
        value_template: "{{ value_json['command'][0]['run_time'] }}"
        unit_of_measurement: "sec"
      - name: "WFC01 Battery"
        value_template: "{{ value_json['command'][0]['wfc01batt'] }}"
        unit_of_measurement: "level"
      - name: "WFC01 RSSI"
        value_template: "{{ value_json['command'][0]['rssi'] }}"
        unit_of_measurement: "level"
    binary_sensor:
      - name: "WFC01 Water On"
        value_template: "{{ value_json['command'][0]['water_running'] }}"
      - name: "WFC01 Water Plan Status"
        value_template: "{{ value_json['command'][0]['plan_status'] }}"
      - name: "WFC01 Water Status"
        value_template: "{{ value_json['command'][0]['water_status'] }}"
      - name: "WFC01 Water Warning"
        value_template: "{{ value_json['command'][0]['warning'] }}"

Hey @bitlisz1 In my case the sensors are getting the state "unknown" for some seconds after the rest-service updates the sensors, after that, the sensors are getting the right values. Same on your side? Haven't used the rest-service till now.

I think this is a design-issue of the rest-service in Home Assistant.

domhaas avatar Jun 04 '24 16:06 domhaas

Yes, same behaviour here.

bitlisz1 avatar Jun 04 '24 18:06 bitlisz1

Thanks for all your combined efforts! Question 1: I have two device with (of course) different ID's. How to include the second device? I can't just copy the whole block. Question 2: And how did you get that nice switch card with all the sensors underneath?

Thanks!

rondol1 avatar Jun 11 '24 23:06 rondol1

rondol1:

Copy here reply for these (alter IP/ID):

(192.168.x.x HUB's address)

http://192.168.x.x/get_iot_device_list

and

http://192.168.x.x/parse_quick_cmd_iot

bitlisz1 avatar Jun 12 '24 09:06 bitlisz1