Morning All,
im still quite new to home assistant! I have a three smart TRV’s I am wanting to convert the temperature status into a sensor so I can include it in some bedroom cards that I am making.
I have done the following code which is passing the developer check and restarting fine but I cannot see the sensors anywhere. Am I doing something wrong or looking in the wrong place?
Here is the code:
CONVERT TEMPERATURE OF ROOMS
Riley_temperature:
friendly_name: 'Rileys Room'
value_template: "{{ state_attr('climate.rileys_room', 'current_temperature') }}"
Bedroom_temperature:
friendly_name: 'Bedroom'
value_template: "{{ state_attr('climate.bedroom', 'current_temperature') }}"
Dressing_temperature:
friendly_name: 'Dressing Room'
value_template: "{{ state_attr('climate.dressing_room', 'current_temperature') }}"
pedolsky
(Pedolsky)
November 5, 2022, 10:37am
2
Don’t use capital letters.
Thanks, I have removed the capitals and not made any difference.
pedolsky
(Pedolsky)
November 5, 2022, 11:13am
4
You have reloaded the YAML, right?
If so, please post the complete sensor file.
here is the full sensor yaml file:
sensor:
platform: systemmonitor
resources:
platform: template
sensors:
nextsunrise:
entity_id: sun.sun
friendly_name: 'Next Sunrise'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-up
nextsunset:
entity_id: sun.sun
friendly_name: 'Next Sunset'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-down
Minimal configuration of the standard time and date sensor
platform: time_date
display_options:
Build on the standard sensor to produce one that can be customized
template:
sensor:
sensor:
name: “Date and time”
state: “{{ as_timestamp(states(‘sensor.date_time_iso’)) | timestamp_custom(’%A %B %-d, %I:%M %p’) }}”
icon: “mdi:calendar-clock”
CONVERT TEMPERATURE OF ROOMS
riley_temperature:
friendly_name: 'Rileys Room'
value_template: "{{ state_attr('climate.rileys_room', 'current_temperature') }}"
bedroom_temperature:
friendly_name: 'Bedroom'
value_template: "{{ state_attr('climate.bedroom', 'current_temperature') }}"
dressing_temperature:
friendly_name: 'Dressing Room'
value_template: "{{ state_attr('climate.dressing_room', 'current_temperature') }}"
pedolsky
(Pedolsky)
November 6, 2022, 9:52am
7
Ok, this is a little hard to read because the code is not set in backticks (see no. 11 of the community guidelines ). If I can read it correctly, you have placed the legacy sensor code under the template
domain. However, legacy template sensors belong to the domain sensor.
1 Like