I’m trying to get connect to my EasyServ (heatpump). They have a RestAPI (which works fine, see picture)
I have added information given by the company in configuration.yaml:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Easyserv värmepump REST API
sensor:
- platform: rest
resource: https://easyserv.local:8080/api/metrics?authkey=[...]
verify_ssl: false
name: heatpump
json_attributes:
- HotwaterTemp1
- HotwaterTemp2
- IndoorTemp
- OutdoorTemp
- RadiatorForwardTemp
- RadiatorReturnTemp
- HeatCarrierInTemp
- HeatCarrierOutTemp
- BrineInTemp
- BrineOutTemp
- HotGasTemp
- CompressorState
- ColdCircuitPumpState
- HeatCircuitPumpState
- RadiatorPumpState
- AddHeat2State
- AddHeat1State
- SwitchValve1State
- HeatingSetpointTemp
- HotwaterSetpointTemp
- AddHeatLevelPercent
- SumAlarm
value_template: '{{ value_json.CompressorState }}'
- platform: template
sensors:
hotwater_temp:
friendly_name: 'Varmvatten'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.HotwaterTemp1 }}'
outdoor_temp:
friendly_name: "Utomhus-temp"
unit_of_measurement: 'C'
device_class: temperature
value_template: '{{ states.sensor.heatpump.attributes.OutdoorTemp }}'
radiator_forward:
friendly_name: 'Framledning'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.RadiatorForwardTemp }}'
radiator_return:
friendly_name: 'Returledning'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.RadiatorReturnTemp }}'
heatcarrier_in:
friendly_name: 'Värmebärare in'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.HeatCarrierInTemp }}'
heatcarrier_out:
friendly_name: 'Värmebärare ut'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.HeatCarrierOutTemp }}'
brine_in:
friendly_name: 'Köldbärare in'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.BrineInTemp }}'
brine_out:
friendly_name: 'Köldbärare ut'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.BrineOutTemp }}'
hotgas:
friendly_name: 'Hetgas'
unit_of_measurement: 'C'
value_template: '{{ states.sensor.heatpump.attributes.HotGasTemp }}'
compressor_state:
friendly_name: "Kompressor"
value_template: >-
{% if states.sensor.heatpump.attributes.CompressorState > 0 %}
På
{% else %}
Av
{% endif %}
switchvalve_state:
friendly_name: "Växelventil"
value_template: >-
{% if states.sensor.heatpump.attributes.SwitchValve1State > 0 %}
På
{% else %}
Av
{% endif %}
radiatorpump_state:
friendly_name: "Radiatorpump"
value_template: >-
{% if states.sensor.heatpump.attributes.RadiatorPumpState > 0 %}
På
{% else %}
Av
{% endif %}
coldcircuitpump_state:
friendly_name: "Köldbärarpump"
value_template: >-
{% if states.sensor.heatpump.attributes.ColdCircuitPumpState > 0 %}
På
{% else %}
Av
{% endif %}
(With the correct authkey)
I can see the Integration, but no values
Log gives this error:
Logger: homeassistant.helpers.event
Source: helpers/template.py:400
First occurred: 10:36:48 (13 occurrences)
Last logged: 10:36:48
Error while processing template: Template("{{ states.sensor.heatpump.attributes.HotGasTemp }}")
Error while processing template: Template("{% if states.sensor.heatpump.attributes.CompressorState > 0 %} På {% else %} Av {% endif %}")
Error while processing template: Template("{% if states.sensor.heatpump.attributes.SwitchValve1State > 0 %} På {% else %} Av {% endif %}")
Error while processing template: Template("{% if states.sensor.heatpump.attributes.RadiatorPumpState > 0 %} På {% else %} Av {% endif %}")
Error while processing template: Template("{% if states.sensor.heatpump.attributes.ColdCircuitPumpState > 0 %} På {% else %} Av {% endif %}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 398, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1698, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1304, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/local/lib/python3.9/site-packages/jinja2/sandbox.py", line 326, in getattr
value = getattr(obj, attribute)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1724, in _fail_with_undefined_error
raise ex
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1715, in _fail_with_undefined_error
return super()._fail_with_undefined_error(*args, **kwargs)
jinja2.exceptions.UndefinedError: 'None' has no attribute 'attributes'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 514, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 400, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'None' has no attribute 'attributes'
Anyone have an idea how to troubleshoot?