Hello I am trying to add more than one sensor template but can’t seem to get it without an error saying duplicates sensor anyone can help. I am trying to add template sensor for my ecobee thermostat three diff. Template sensor for three diff. attributes. All of them to round so there is no decimal. One being humidity, current temperature, target temperature.
Use a computer and copy paste the text within code block.
The screenshot is useless since it doesn’t even include the full text.
The snap shot is just what I have now which works perfect like it suppose to the problem I am having is adding another sensor template without conflict of this one saying duplacated sensors.
then you need to post what you are trying to add along with the above.
But you need to post it as a text code block and not as a screenshot.
We are willing to help you but I’m not going to re-type everything out for you especially if you already have some code written. If I find an error it’s faster for me to just copy/paste/edit what you already have instead of trying to explain in words what you need to change.
So, post the “sensor:” section along with the new sensor you are trying to add that is giving you an error.
sensor:
- platform: template
sensors:
shed_door:
value_template: >-
{% if states.switch.shed_door_status.state == ‘on’ %}
Open
{% elif states.switch.shed_door_status.state == ‘off’ %}
Closed
{% else %}oh
n/a
{% endif %}
platform: template
sensors:
my_ecobee:
value_template: ‘{{value | round(1) }}’
I am trying to add another sensor template to round so there is no decimal point. I have three sensors I would like which all come from my ecobee thermostat. All three use attributes.
-humidity
-current temperature
-temperature
i have them in a grid card on my front end which display the readings.
type: grid
cards:
- type: entity
entity: climate.my_ecobee
name: Hum.
unit: ‘%’
icon: hass:water
attribute: current_humidity - type: entity
entity: climate.my_ecobee
attribute: current_temperature
unit: °
icon: mdi:thermometer
name: 'Temp. ’ - type: entity
entity: climate.my_ecobee
attribute: temperature
name: Set to
square: false
columns: 3
Please take the time to learn how to format code when posting to the forums.
The reason it’s not working is you’re missing the - in front of your second platform: template.
sorry I am completely new to this. Trying to learn .
Read point 11 for formatting code
Something like this should work:
sensor:
- platform: template
sensors:
shed_door:
value_template: xxx
my_ecobee:
value_template: xxx
However, it should be noted this method actually is considered Legacy now (Template - Home Assistant), it’ll work for now but might break in the future. What you want to do with the new format is this:
template:
- sensor:
- name: Shed Door
state: xxx
- name:: My Ecobee
state: xxx
state
is the new value_template
so you can keep the same template. The entity ID will be generated based on the name (I think, haven’t actually used this myself)
ah, come on, i had told you that when you had posted that stuff in the power / energy discussion that you needed to add the code if you wanna get help cause screenshots are not showing the hidden stuff.
If you do not invest the time for your own stuff you can not expect help from others. I had thought that you had replaced the screenshot when it was taken out of the tuy power / energy discussion where it had popped up first.
Hope you got it fixed.