HI,
For use eufysecurity cam, I use io broker. but in HA I have this error:
Logger: homeassistant.components.sensor
Source: helpers/template.py:1472
Integration: Capteur (documentation, issues)
First occurred: 13:15:06 (2 occurrences)
Last logged: 13:15:06
Error adding entities for domain sensor with platform rest
Error while setting up rest platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 806, in add_to_platform_finish
await self.async_added_to_hass()
File "/usr/src/homeassistant/homeassistant/components/rest/entity.py", line 42, in async_added_to_hass
self._update_from_rest_data()
File "/usr/src/homeassistant/homeassistant/components/rest/sensor.py", line 173, in _update_from_rest_data
value = self._value_template.async_render_with_possible_json_value(
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 625, in async_render_with_possible_json_value
return _render_with_context(self.template, compiled, **variables).strip()
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2007, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1790, in forgiving_int_filter
raise_no_default("int", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1472, in raise_no_default
raise ValueError(
ValueError: Template error: int got invalid input '{
"error": "command getPlainvalue unknown",
"getPlainValue": "http://192.168.1.99:8087/getPlainValue/stateID",
"get": "http://192.168.1.99:8087/get/stateID/?prettyPrint",
"getBulk": "http://192.168.1.99:8087/getBulk/stateID1,stateID2/?prettyPrint",
"set": "http://192.168.1.99:8087/set/stateID?value=1&prettyPrint",
"toggle": "http://192.168.1.99:8087/toggle/stateID&prettyPrint",
"setBulk": "http://192.168.1.99:8087/setBulk?stateID1=0.7&stateID2=0&prettyPrint",
"setValueFromBody": "http://192.168.1.99:8087/setValueFromBody?stateID1",
"objects": "http://192.168.1.99:8087/objects?pattern=system.adapter.admin.0*&prettyPrint",
"states": "http://192.168.1.99:8087/states?pattern=system.adapter.admin.0*&prettyPrint",
"search": "http://192.168.1.99:8087/search?pattern=system.adapter.admin.0*&prettyPrint",
"query": "http://192.168.1.99:8087/query/stateID1,stateID2/?dateFrom=2019-06-06T12:00:00.000Z&dateTo=2019-06-06T12:00:00.000Z&noHistory=false&aggregate=minmax&count=3000&prettyPrint"
}' when rendering template '{% set v = value | replace("","")|int %} {{ {0: "Away",
1: "Home",
2: "Schedule",
3: "Custom1",
4: "Custom2",
5: "Custom3",
47: "Geofence",
63: "Disarmed"}[v] | default("Unknown state:" + (value|urlencode)) }}' but no default was specified
My configuration.yaml:
sensor:
-
platform: rest
name: eufy_status
resource: “http://192.168.1.99:8087/getPlainvalue/eusec.0.T8010N2322161431.station.guard_mode”
scan_interval: 10
value_template: >-
{% set v = value | replace("","")|int %}
{{ {0: “Away”,
1: “Home”,
2: “Schedule”,
3: “Custom1”,
4: “Custom2”,
5: “Custom3”,
47: “Geofence”,
63: “Disarmed”}[v] | default(“Unknown state:” + (value|urlencode)) }} -
platform: rest
name: eufy_entree_baterrie_level
resource: “http://192.168.1.99:8087/getPlainvalue/eusec.0.T8010N2322161431.cameras.T8142N532228083C.battery”
scan_interval: 10
device_class: battery
unit_of_measurement: ‘%’
Can you help me please?