Very nice card. Simple and useful. I have used it to get the following:
![lock_camera_demo](//community-assets.home-assistant.io/original/3X/3/b/3b141132e91c9e5fee954a4f38835031abf33aaa.gif)
I have a ācamerasā top menu where I have 4 cameras live. I wanted to show realtime image with a picture-entity card, as I used to have, but this time, I want the cameras hidden to certain user/users logged in my home assistant. As a plusā¦ with a click on a certain switch for root, I want to re-enable the video feed to that censored users with the click of a button.
It looked so nice and is so simple with Ianās card that I would like to show you my steps here. Also, would like to share because I havenāt found any reference on the web or on the cardās readme that explains with samples how to use it with different logged users, which is one of the best adventages of this card in my opinion, and make a difference with others. Here we go:
1.- First, create an input_boolean as my personal switch, that I will use as root to let censored users view the video feed at certain times, etc.
---input_boolean.yaml
show_my_cameras:
name: Show my cameras
initial: off
----
2.- I have created a blured, black and white picture that will substitute the camera feed for each particular camera once the root censors the camera feed. I have saved the image to www/cameras/blur_chickencam.jpg, in this example.
3.-Edit my old picture-entity CARD with the uncesored camera stream like that, adding the āconfig-template-cardā with itās variables as you can see here:
type: 'custom:config-template-card'
variables:
- 'states[''input_boolean.show_my_cameras''].state'
entities:
- input_boolean.show_my_cameras
card:
aspect_ratio: 50%
entity: >-
${vars[0] === 'off' && user.id === 'abc12346789034c3445ed4d37489123' ? 'input_boolean.show_my_cameras' : 'camera.chickencam'}
name: chickencam
image: /local/cameras/blur_chickencam.jpg
show_name: true
show_state: false
type: picture-entity
EXPLANATION:
-under ācard:ā, you could see my old card, but with the added variables to take that into account.
-vars[0]: corresponds with the value of the first variable declared above under āvariables:ā label. If you add more variables to the list, the second will be vars[1], and so onā¦
-Under āentities:ā label, is the entity that the card will take into account for checking state changes and adopt new values accordingly if that entity changes.
-the āentity:ā label at card:, says something likeā¦: if input_boolean.show_my_cameras value is āoffā AND the logged user is āMiss Trumpā, then assign āinput_boolean.show_my_camerasā to the label āentity:ā. Else give a value of ācamera.chickencamā. So, if the input_boolean somewhere in the root frontlace has been clicked to off, and the logged user is that user, the camera will show the black and white blured picture. If other user is logged, no matter where the input_boolean lever is set, the camera will show the video feed in all itās colour and glory.
-You can find the user id number of a certain user, to censor the video stream to him by going to configuration -> users -> Miss Trump -> long number.
It works for me. Hope it helps others. Thanks.