ardian
October 8, 2021, 1:32pm
1
Hello,
I use HomeAssistant to track some devices with bluetooth. So i always know who is at home and who not. But I have a problem. I want to show a picture in the overview between 08:00-11:30 and 13:00-16:00 only when no one is at home (all devices are unavailable). But when someone is at home then this picture has to be replaced from another picture.
Does someone know how can i do it?
Many thanks in advance
Ardian
tom_l
October 8, 2021, 1:43pm
2
Have a look at the state switch card:
Ever wanted a lovelace card that’s only shown for certain users?
Ever wanted to show a certain lovelace card in one spot if the door is open, and another one otherwise?
Ever wanted to be able to swap out a part of your layout when you press a button?
Ever wanted to do that only on one device, and not on all of them at once?
Ever wanted to show different cards depending on the size of your window, or on wheter you’re viewing it on a touch enabled device or not?
[image]
[image]
State-sw…
ardian
October 11, 2021, 12:18pm
3
I tried it, but it doesn’t work. No error is reported and the card remains empty, no picture is shown.
The name of sensor and the image path are correct…
type: custom:state-switch
entity: sensor.iphone_one_room_presence
states:
Home:
cards:
- type: picture
image: /local/img1.png
tap_action:
action: none
hold_action:
action: none
not_home:
cards:
- type: picture
image: /local/img2.png
tap_action:
action: none
hold_action:
action: none
unavailable:
cards:
- type: picture
image: /local/img3.png
tap_action:
action: none
hold_action:
action: none
available:
cards:
- type: picture
image: /local/img5.png
tap_action:
action: none
hold_action:
action: none
pedolsky
(Pedolsky)
October 11, 2021, 12:24pm
4
Sure, that H ome is correct?
ardian
October 11, 2021, 1:29pm
6
Yes, because I use it in another card and it works…
pedolsky
(Pedolsky)
October 11, 2021, 1:47pm
7
Interesting. I only was aware of state home