template - why I can’t see attribute state?
climate:
title: HLAJENJE
subtitle: >
[[[
return "{{state_attr('sensor.inside_current_humidity','median')}}";
]]]
icon: phu:air-conditioner
template - why I can’t see attribute state?
climate:
title: HLAJENJE
subtitle: >
[[[
return "{{state_attr('sensor.inside_current_humidity','median')}}";
]]]
icon: phu:air-conditioner
Try
subtitle: "[[[ return states['sensor.inside_current_humidity'].attributes.median ]]]"
or I think the best approach:
subtitle: "{{state_attr('sensor.inside_current_humidity','median')}}"
You can try this but not sure if this works:
subtitle: "[[[ return state_attr['sensor.inside_current_humidity','median'] ]]]"
What card is that? Jinja or JS templates can only be used in a few spots. JS templates are all different as well.
It is JS template.
and what do the docs say for the JS templates? They are all custom, so they all have different syntax for accessing states.
If you link the docs, I can help you write the code. So all you have to do is tell me what card that is, because it’s not listed in your configuration in your post.
This solution works. Now I can see attribute state.
Ok, so that must be custom button cards.
subtitle: |
[[[
return states['sensor.inside_current_humidity'].attributes.median;
]]]
This solution is perfect. Thx