Hello! I’m very new at Home Assistant. I have created a rest-sensor reading some values from Animus Heart, it looks like this:
sensor:
- platform: rest
name: office_sensors
resource: http://10.79.3.36/rest/devices/com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa/functions
scan_interval: 900
json_attributes:
- "com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa:f-8193.0" # TEMP
- "com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa:f-8193.1" # HUMID
method: GET
value_template: "OK"
headers:
authorization: !secret animus_auth_header
- platform: template
sensors:
office_temperature:
value_template: "{{ state_attr('sensor.office_sensors', 'com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa:f-8193.0')['functionProperties']['data']['value']['level'] }}"
device_class: temperature
unit_of_measurement: "°C"
office_humidity:
value_template: "{{ state_attr('sensor.office_sensors', 'com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa:f-8193.1')['functionProperties']['data']['value']['level'] }}"
device_class: "humidity"
unit_of_measurement: "%"
office_timestamp:
value_template: "{{ (state_attr('sensor.office_sensors', 'com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa:f-8193.0')['functionProperties']['data']['value']['timestamp'] | int/1000) | timestamp_local }}"
device_class: "timestamp"
The device ID com.animushome.heart.packages.rf433.3bc6421c-5c7f-4911-b4b1-1acf249becfa
is repeated a lot of times. Any way to store this in a variable so I can reuse the ID? This is just the first sensor…have couple more to do.