Hello,
I have a Fritzbox as a router and I’m creating a card that shows me the status of the home phone.
I would like to have the number or name of the last call on the card, but the sensor I created has no attributes such as last_call or similar.
Is there a way to create an attribute to a sensor template?
Or how could I extract this information from the sensor I already have to put it on a card?
Thanks for the replies
- entity: switch.tv
secondary_info: last-changed
hi krskrab than thanks for the answer, i know the last-changed option, but i want to have the name or the phone number of the last incoming call.
That information is present in the sensor (you can see it in the image at the top left of the image I’ve posted) and I would like to understand how I can get it to put it on a card.
Hello Giuliano,
i have this running here.
my steps:
- create/use an input_text helper (remember the name)
- create/use an input_datetime helper (remember the timestamp)
- create/use an automation (evaluate the call)
- use the helper values in my dashboards/cards
a shortened version of my automation:
alias: evaluate call (RINGING)
trigger:
- platform: state
entity_id:
- sensor.<your_fritzbox_name>_call_monitor_<your_phoneboox_name>
to: ringing
condition: []
action:
- service: input_datetime.set_datetime
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
target:
entity_id: input_datetime.last_call
- service: input_text.set_value
data:
value: {{ state_attr('sensor.<your_fritzbox_name>_call_monitor_<your_phoneboox_name>', 'from_name') }} ({{ state_attr('sensor.<your_fritzbox_name>_call_monitor_<your_phoneboox_name>', 'from') }})
target:
entity_id: input_text.last_caller_name
I only evaluate the status change from ‘idle’ to ‘ringing’.
1 Like
Thanks, a simple fix, but I hadn’t thought of that.
I’ve already tested it and it works perfectly
1 Like