hey i have recently set up a smart door handle and wish to create a log of its use but i am very new to coding i would like to have a card that would be a lod saying something like - (operator) unlocked the door via (trigger) - but i am unsure how
any help is appreciated
Correct me if I am wrong:
- You have 2 sensors which represent so called “trigger” & “operator”.
- You currently created Logbook card with these 2 sensors shows lines with state changes for both sensors (as expected since you added these 2 sensors on the card).
- But instead on the Logbook card you need to show a message composed from states of these 2 sensors (like <state of sensor 1> some text <state of sensor 2>).
Right?
1 Like
yes i have created a log book as im not too knowledgeable of coding so this is the closest i have found but i would like a card to look similar to this if possible
Then you got at least 2 options
- Create a template sensor containing a composed string → show this sensor in Logbook card.
- (may be) Some custom logbook-like card may show a similarly composed string (check custom:logbook-card - never used it - but may be it provides this functionality).
1 Like
thanks do you havbe any advice as to how i would create such a thing? im very new to coding and dont know where to start
You have to learn how to create template sensors.
No. You must.
Here is an untested example (just an idea):
template:
- sensor:
- name: composed_string
state: >-
{{ states('sensor.who')}} unlocked door via {{states('sensor.via_what')}}
But probably the composed string should not always contain “unlocked”; may be it should contain “locked” too.
And this could be sorted out by you only.
Docs here.
2 Likes