[SOLVED] Restful sensor for BWT device

Hi,
I’m trying to configure some restful sensors all from the same physical device.

My configuration is as follows:

- platform: rest
  name: BWT
  resource: http://ipaddress:8080/api/GetCurrentData
  username: user
  password: xxxxx
  authentication: basic
  scan_interval: 10
  value_template: "{{ json_value[CurrentFlowrate_l_h] }}"

In the log I can see, that the json is read, but my sensor is not getting any values. Unfortunately I’m still struggling with the syntax. In the log I can see the JSON as follows:

{
   "ActiveErrorIDs" : "",
   "BlendedWaterSinceSetup_l" : 96785,
   "CapacityColumn1_ml_dH" : 8571775,
   "CapacityColumn2_ml_dH" : -1,
   "CurrentFlowrate_l_h" : 0,
   "DosingSinceSetup_ml" : 0,
   "FirmwareVersion" : "2.0209",
   "HardnessIN_CaCO3" : 481,
   "HardnessIN_dH" : 27,
   "HardnessIN_fH" : 48,
   "HardnessIN_mmol_l" : 5,
   "HardnessOUT_CaCO3" : 125,
   "HardnessOUT_dH" : 7,
   "HardnessOUT_fH" : 12,
   "HardnessOUT_mmol_l" : 1,
   "HolidayModeStartTime" : 0,
   "LastRegenerationColumn1" : "2024-02-17 05:00:19",
   "LastRegenerationColumn2" : "1970-01-01 00:59:59",
   "LastServiceCustomer" : "2023-11-10 14:51:24",
   "LastServiceTechnican" : "2023-04-28 09:23:01",
   "OutOfService" : 0,
   "RegenerationCountSinceSetup" : 450,
   "RegenerationCounterColumn1" : 450,
   "RegenerationCounterColumn2" : 0,
   "RegenerativLevel" : 93,
   "RegenerativRemainingDays" : 184,
   "RegenerativSinceSetup_g" : 159168,
   "ShowError" : 0,
   "WaterSinceSetup_l" : 73352,
   "WaterTreatedCurrentDay_l" : 52,
   "WaterTreatedCurrentMonth_l" : 804,
   "WaterTreatedCurrentYear_l" : 1900
}

I’d love to the the sensor running. But the goal is to get all sensory to be read correctly. Any hints how to configure it?
By the way, this is the current API to read out the BWT water softening device. For all who want to use it, I think the Firmware has not been released yet. Contact BWT to get it.
I hope you can help!
Thank you

Hi,
I managed the single sensor working. The problem was my configuration and the fact, that the sensor had been used for something different. With the following config it works:

- platform: rest
  resource: http://ipaddress:8080/api/GetCurrentData
  username: user
  password: mypassword
  authentication: basic
  scan_interval: 10
  name: bwt_test
  value_template: "{{ value_json.CurrentFlowrate_l_h }}"

Still the problem is remaining, that I need more sensors from this device. I suppose multiple entries will generate multiple requests, which is not good.

According to RESTful Sensor - Home Assistant it should be possible to add multiple sensors but checking the configuration returns an error:

Invalid config for ‘rest’ from integration ‘sensor’ at sensor/bwt.yaml, line 59: ‘sensor’ is an invalid option for ‘sensor.rest’, check: sensor (when using the proposed sample)

1 Like

I just got it solved - I put the configuration into a sensor configuration file. this cannot work.