TL;DR
- When I long press on the Front Door button, I want it to show the logbook for
binary_sensor.front_door
. - The entity for the button card is the template sensor
sensor.front_door_master_sensor
. - The
more-info
forsensor.front_door_master_sensor
is History, not Logbook.
Details:
Here is my card with door sensors. The outside doors have Yale locks on them, so they show the state of the lock via a template sensor. The interior doors just have a simple magnetic door sensor on them.
Here is a snippet of the YAML from the cards above:
- type: horizontal-stack
cards:
- type: button
tap_action:
action: call-service
service: script.turn_on
service_data: {}
target:
entity_id: script.1642214952051
hold_action:
action: more-info
entity: sensor.front_door_master_sensor
name: Front Door
- type: horizontal-stack
cards:
- type: button
entity: binary_sensor.alexandra_door
name: Kid 1
- type: button
entity: binary_sensor.ben_door
name: Kid 2
Here is the template sensor for the outside doors that have the Yale locks and magnetic sensors.
#FRONT DOOR
- platform: template
sensors:
front_door_master_sensor:
value_template: >-
{%- if is_state('binary_sensor.front_door', 'off') %}
{%- if is_state('lock.front_door_lock', 'locked') %}
Locked
{%- else %}
Unlocked
{%- endif %}
{%- else %}
Open
{%- endif %}
icon_template: >-
{%- if is_state('binary_sensor.front_door', 'off') %}
{%- if is_state('lock.front_door_lock', 'locked') %}
mdi:door-closed-lock
{%- else %}
mdi:door-closed
{%- endif %}
{%- else %}
mdi:door-open
{%- endif %}
friendly_name: 'Front Door'
Here is the more info for the kid doors. Note it shows the Logbook.
Here is the more info for the outside doors. Note is does NOT show the Logbook.
If I go to the Logbook and click on binary_sensor.front_door
, this is what I get. This is what I want to come up when I long press the Front Door button.
If I go to the Logbook and click on sensor.front_door_master_sensor
, this is what I get.
So, how do I create a button card for entity A but then have the more-info
for entity B show up with a long press?