janbenes
(Jan Benes)
1
Hello, can someone please help me to include attribute value in a message? The message is like:
action:
- service: notify.jan_b
data:
message: Block nr. mined
and after nr. I would like to insert attribute
entity_id: sensor.btc_blocks_last
attribute: height
How to do it please?
r-j-taylor
(R. J. Taylor)
2
This is done with templating. You’ll want to use something like this:
{{ state_attr('sensor.btc_blocks_last', 'height') }}
action:
- service: notify.jan_b
data:
message: "Block nr. {{ state_attr('sensor.btc_blocks_last', 'height') }} mined"
1 Like
r-j-taylor
(R. J. Taylor)
4
Right, typed too quick. Thanks for the correction.