Gruenbeck Soft Water sensor Durchfluss

Hello, i have a Gruenbeck Soft water machine and i want to read the actual water flow in a sensor.

The Request is

http://192.168.2.9/mux_http/id=622&show=D_A_1_1~ this must be as POST

The Response is

ok<D_A_1_1>0.00</D_A_1_1>

i need the 0.00

the curl is

curl -X POST -i ‘http://192.168.2.9/mux_http’ --data ‘id=622&show=D_A_1_1~’

please help

I think the RESTful Sensor should do it.

Not sure how to deal with the response, but in Dev Tools/Templates, this:

{% set response = 'ok<D_A_1_1>0.00</D_A_1_1>' %}
{{ response.split('<')[1].split('>')[1] }}

returns 0.00

Hi,

with

sensor wasserdurchfluss:
  - platform: rest
    resource: http://192.168.2.9/mux_http/id=622&show=D_A_1_1~
    method: POST
    name: wasserdurchfluss
    value_template: {% set response = 'ok<D_A_1_1>0.00</D_A_1_1>' %}, 
    {{ response.split('<')[1].split('>')[1] }}

in the configuration i get this error :

missed comma between flow collection entries at line 138, column 22:
value_template: {% set response = 'ok<D_A_1_1>0.0 …
^

Well, this was just an example how the value could be extracted from the response.

So if your sensor works and shows the ok<D_A_1_1>0.00</D_A_1_1> without the value_template, then the value_template could be:

value_template: "{{ value.split('<')[1].split('>')[1] }}"

the sensor display unknown.

In the manual from Grunbeck is display that the machine response is in xml format.

With rest client that is a response. Direct in the Browser is nothing.

What can i do ?

Soory im an noob.

If the rest sensor without the value_template returns ‘unknown’, then maybe give the Command line Sensor a try.

sensor:
  - platform: command_line
    name: Durchfluss
    command: "curl -X POST -i 'http://192.168.2.9/mux_http' --data 'id=622&show=D_A_1_1~'"

If this returns the desired value: ok<D_A_1_1>0.00</D_A_1_1> then try it with the value_template from my last post.

If that doesn’t work, i’m out of ideas, sorry.

BTW: Give this topic a category (Configuration or something) so more people will see it in the latest section.

Here comes a response :

HTTP/1.1 200 OK Content-Type: text/html; charset=UTF-8 Accept-Ranges: bytes Connection: close ok<D_A_1_1>0.00</D_A_1_1>

Please create me the value template.
With your template in the last post theres nothing.

This example is working fine:

- platform: command_line
  scan_interval: 3600
  name: gruenbeck_restkapazitaet
  command: "curl -X POST -i 'http://192.168.1.99/mux_http' --data 'id=622&show=D_A_1_2~'"
  value_template: >
    {{ value.split('<')[4].split('>')[1] }}