No idea, I don’t use the scrape integration. Maybe someone else can help.
After lots of trial and error and googling with the restful sensor, I think I found the problem.
My theory is:
It looks like the XML generated form my heatpump is no valid xml file.
The correct xml header tag is missing.
Because of that HA doesn’t convert it to JSON and so I never get a real value.
Could this be possible?
Is there a way to test, what HA is seeing when opening the resource?
resource: http://192.168.0.27/usr-cgi/xml.cgi?A|1|10
Is there a way to force HA to convert it to JSON?
So I found the way to activate debugging for REST.
Looks like this:
So atleast the JSON Conversion is working as expected.
2022-09-18 09:18:37.002 DEBUG (MainThread) [homeassistant.components.rest.data] Updating from http://192.168.0.27/usr-cgi/xml.cgi?A|1|10
2022-09-18 09:18:37.258 DEBUG (MainThread) [homeassistant.components.rest] Finished fetching rest data data in 0.256 seconds (success: True)
2022-09-18 09:18:37.259 DEBUG (MainThread) [homeassistant.components.rest.sensor] Data fetched from resource: <PCOWEB>
<PCO>
<ANALOG>
<VARIABLE>
<INDEX>1</INDEX>
<VALUE>9.1</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>2</INDEX>
<VALUE>20.4</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>3</INDEX>
<VALUE>-999.9</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>4</INDEX>
<VALUE>-8.7</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>5</INDEX>
<VALUE>21.9</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>6</INDEX>
<VALUE>22.1</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>7</INDEX>
<VALUE>21.6</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>8</INDEX>
<VALUE>42.9</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>9</INDEX>
<VALUE>-999.9</VALUE>
</VARIABLE>
<VARIABLE>
<INDEX>10</INDEX>
<VALUE>-999.9</VALUE>
</VARIABLE>
</ANALOG>
</PCO>
</PCOWEB>
2022-09-18 09:18:37.265 DEBUG (MainThread) [homeassistant.components.rest.sensor] JSON converted from XML: {"PCOWEB":{"PCO":{"ANALOG":{"VARIABLE":[{"INDEX":"1","VALUE":"9.1"},{"INDEX":"2","VALUE":"20.4"},{"INDEX":"3","VALUE":"-999.9"},{"INDEX":"4","VALUE":"-8.7"},{"INDEX":"5","VALUE":"21.9"},{"INDEX":"6","VALUE":"22.1"},{"INDEX":"7","VALUE":"21.6"},{"INDEX":"8","VALUE":"42.9"},{"INDEX":"9","VALUE":"-999.9"},{"INDEX":"10","VALUE":"-999.9"}]}}}}
After some additional trial&error, googling and forum searching I came to this working solution:
rest:
- resource_template: http://192.168.0.27/usr-cgi/xml.cgi?A|1|1
scan_interval: 60
sensor:
- name: "Aussentemperatur"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
value_template: "{{ value_json.PCOWEB.PCO.ANALOG.VARIABLE.VALUE | float }}"
- resource_template: http://192.168.0.27/usr-cgi/xml.cgi?A|5|5
scan_interval: 60
sensor:
- name: "Vorlauftemperatur"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
value_template: "{{ value_json.PCOWEB.PCO.ANALOG.VARIABLE.VALUE | float }}"
- resource_template: http://192.168.0.27/usr-cgi/xml.cgi?A|2|2
scan_interval: 60
sensor:
- name: "Rücklauftemperatur"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
value_template: "{{ value_json.PCOWEB.PCO.ANALOG.VARIABLE.VALUE | float }}"
- resource_template: http://192.168.0.27/usr-cgi/xml.cgi?A|53|53
scan_interval: 60
sensor:
- name: "Rücklaufsolltemperatur"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
value_template: "{{ value_json.PCOWEB.PCO.ANALOG.VARIABLE.VALUE | float }}"
Thank you very much.
i have integrated my Dimplex heatpumpt with that.
but do you know, how i can make it as “one Device” with multiple Sensors?
i now have integrated my weishaupt/dimplex heat pump this way:
configuration.yaml:
rest: !include rest.yaml
rest.yaml:
- resource: !secret wp_url_a
username: !secret wp_usr
password: !secret wp_pw
authentication: basic
scan_interval: 30
sensor:
- name: "wp_a001_at"
unique_id: "heatpump_dimplex_si8tu__A001"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][0]['VALUE'] }}"
- name: "wp_a002_rl"
unique_id: "heatpump_dimplex_si8tu__A002"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][1]['VALUE'] }}"
- name: "wp_a003_ww"
unique_id: "heatpump_dimplex_si8tu__A003"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][2]['VALUE'] }}"
- name: "wp_a005_vl"
unique_id: "heatpump_dimplex_si8tu__A005"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][4]['VALUE'] }}"
- name: "wp_a006_wq_e"
unique_id: "heatpump_dimplex_si8tu__A006"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][5]['VALUE'] }}"
- name: "wp_a007_wq_a"
unique_id: "heatpump_dimplex_si8tu__A007"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][6]['VALUE'] }}"
- name: "wp_a008_druck_h"
unique_id: "heatpump_dimplex_si8tu__A008"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][7]['VALUE'] }}"
- name: "wp_a047_rl_h"
unique_id: "heatpump_dimplex_si8tu__A047"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][46]['VALUE'] }}"
- name: "wp_a048_mi_h"
unique_id: "heatpump_dimplex_si8tu__A048"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][47]['VALUE'] }}"
- name: "wp_a053_rl_s"
unique_id: "heatpump_dimplex_si8tu__A053"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][52]['VALUE'] }}"
- name: "wp_a058_ww_s"
unique_id: "heatpump_dimplex_si8tu__A058"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][57]['VALUE'] }}"
- name: "wp_a096_ku_h"
unique_id: "heatpump_dimplex_si8tu__A096"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][95]['VALUE'] }}"
- name: "wp_a101_druck_n"
unique_id: "heatpump_dimplex_si8tu__A101"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][100]['VALUE'] }}"
- name: "wp_a103_status"
unique_id: "heatpump_dimplex_si8tu__A103"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][102]['VALUE'] }}"
- name: "wp_a104_sperre"
unique_id: "heatpump_dimplex_si8tu__A104"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][103]['VALUE'] }}"
- name: "wp_a105_stoer"
unique_id: "heatpump_dimplex_si8tu__A105"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['ANALOG']['VARIABLE'][104]['VALUE'] }}"
- resource: !secret wp_url_i
username: !secret wp_usr
password: !secret wp_pw
authentication: basic
scan_interval: 30
sensor:
- name: "wp_i043_ku_g"
unique_id: "heatpump_dimplex_si8tu__I043"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][42]['VALUE'] }}"
- name: "wp_i044_ww_h"
unique_id: "heatpump_dimplex_si8tu__I044"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][43]['VALUE'] }}"
- name: "wp_i095_wm_h1-4"
unique_id: "heatpump_dimplex_si8tu__I095"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][94]['VALUE'] }}"
- name: "wp_i096_wm_h5-8"
unique_id: "heatpump_dimplex_si8tu__I096"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][95]['VALUE'] }}"
- name: "wp_i097_wm_h9-12"
unique_id: "heatpump_dimplex_si8tu__I097"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][96]['VALUE'] }}"
- name: "wp_i098_wm_w1-4"
unique_id: "heatpump_dimplex_si8tu__I098"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][97]['VALUE'] }}"
- name: "wp_i099_wm_w5-8"
unique_id: "heatpump_dimplex_si8tu__I099"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][98]['VALUE'] }}"
- name: "wp_i0100_wm_w9-12"
unique_id: "heatpump_dimplex_si8tu__I100"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][99]['VALUE'] }}"
- name: "wp_i0126_wm_u"
unique_id: "heatpump_dimplex_si8tu__I126"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][125]['VALUE'] }}"
- name: "wp_i158_it"
unique_id: "heatpump_dimplex_si8tu__I158"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][157]['VALUE'] }}"
- name: "wp_i159_it_s"
unique_id: "heatpump_dimplex_si8tu__I159"
unit_of_measurement: °C
device_class: temperature
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][158]['VALUE'] }}"
- name: "wp_i160_ih"
unique_id: "heatpump_dimplex_si8tu__I160"
unit_of_measurement: '%'
device_class: humidity
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['INTEGER']['VARIABLE'][159]['VALUE'] }}"
- resource: !secret wp_url_d
username: !secret wp_usr
password: !secret wp_pw
authentication: basic
scan_interval: 30
sensor:
- name: "wp_D005_s_evu"
unique_id: "heatpump_dimplex_si8tu__D005"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][4]['VALUE'] }}"
- name: "wp_D006_s_ext"
unique_id: "heatpump_dimplex_si8tu__D006"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][5]['VALUE'] }}"
- name: "wp_D041_p-m14_verdichter"
unique_id: "heatpump_dimplex_si8tu__D041"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][40]['VALUE'] }}"
- name: "wp_D043_p-m11-m2_primaer"
unique_id: "heatpump_dimplex_si8tu__D043"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][42]['VALUE'] }}"
- name: "wp_D045_p-m13_h"
unique_id: "heatpump_dimplex_si8tu__D045"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][44]['VALUE'] }}"
- name: "wp_D046_p-m18_ww"
unique_id: "heatpump_dimplex_si8tu__D046"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][45]['VALUE'] }}"
- name: "wp_D049_p-m16_zusatz"
unique_id: "heatpump_dimplex_si8tu__D049"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][48]['VALUE'] }}"
- name: "wp_D060_p-m17_k"
unique_id: "heatpump_dimplex_si8tu__D060"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][59]['VALUE'] }}"
- name: "wp_D068_p-m12_k_primaer"
unique_id: "heatpump_dimplex_si8tu__D068"
json_attributes_path: "$.response.system"
value_template: "{{ value_json['PCOWEB']['PCO']['DIGITAL']['VARIABLE'][67]['VALUE'] }}"
some questions:
- the digital variables are only binary. how could i declare this? or shouldnt i do this?
- how can i crate a device “heatpump” with all these sensors?
i testet this in configuration.yaml but get an error:
device_tracker:
- platform: group
name: heatpump_dimplex_si8tu
entities:
- sensor.wp_i095_wm_h
- sensor.wp_i096_wm_h5_8
- sensor.wp_i097_wm_h9_12
- sensor.wp_i098_wm_w
- sensor.wp_i099_wm_w5_8
- sensor.wp_i0100_wm_w9_12