D4VEW557
(David Wilkinson)
December 29, 2019, 4:16pm
1
Hi all,
I’m having an issue creating a button to call a service.
I want to toggle an input select, it works fine from the services section of the developer tools but not from the button.
My code is as follows. I sure this is very simple but I can’t figure it out.
>
> type: entity-button
> tap_action:
> action: call-service
> service: input_select.select_next
> Data:
> entity_id: input_select.floorplan_floor
> show_icon: true
> show_name: true
> entity: input_select.floorplan_floor
Thanks Guys.
D4VEW557:
Data:
this needs to be lowercase.
D4VEW557
(David Wilkinson)
December 29, 2019, 4:36pm
3
you’re right is does but it still doesn’t work.
I this message
and this when trying to execute it
Thanks
D4VEW557
(David Wilkinson)
December 29, 2019, 4:38pm
4
Got it.
it needs to be service_data.
Thanks
browetd
(Browet Didier)
December 29, 2019, 4:39pm
5
Try this (replace “Data” by “service_data” and correct the identation of the last three lines (must be aligned to “type” and “tap_action”):
> type: entity-button
> tap_action:
> action: call-service
> service: input_select.select_next
> service_data:
> entity_id: input_select.floorplan_floor
> show_icon: true
> show_name: true
> entity: input_select.floorplan_floor
D4VEW557
(David Wilkinson)
December 29, 2019, 6:40pm
6
OK, i have the 2 cards switching on off depending on the input_select state.
The next issue is when I set panel: true as i want full screen, only 1 image displays.
Any ideas on how to overcome that.
Thanks
eggman
(bertie basset)
December 31, 2019, 5:58am
7
Panel mode
This renders the first card on full width, other cards in this view will not be rendered. Good for cards like map
, stack
or picture-elements
.
Use a horizontal-stack, containing your two cards, as the first card.
D4VEW557
(David Wilkinson)
January 5, 2020, 12:27am
8
Hi,
thanks for the reply. I am massively struggling with achieving this. I can create vertical/horizontal stack cards and conditional cards but I can not get them to work together.
My cards are as follows.
card:
elements:
- entity: input_select.floorplan_floor
icon: mdi-close
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 33.5%
top: 10%
width: 6%
tap_action:
action: call-service
service: input_select.select_next
service_data:
entity_id: input_select.floorplan_floor
type: image
- entity: switch.on_off
style:
'--paper-item-icon-color': black
left: 77.3%
top: 46.%
transform: scale(5)
tap_action:
action: toggle
type: state-icon
- entity: switch.low
style:
'--paper-item-icon-color': orange
left: 77.3%
top: 61%
transform: scale(4)
tap_action:
action: toggle
type: state-icon
- entity: switch.high
style:
'--paper-item-icon-color': red
left: 77.3%
top: 30%
transform: scale(4)
tap_action:
action: toggle
type: state-icon
- entity: input_select.floorplan_floor
style:
'--paper-item-icon-color': black
left: 19%
top: 30%
transform: scale(4)
tap_action:
action: call-service
service: input_select.select_next
service_data:
entity_id: input_select.floorplan_floor
type: state-icon
image: /local/custom_ui/floorplan/fire_card1.png
type: picture-elements
conditions:
- entity: input_select.floorplan_floor
state: 1st Floor
panel: true
type: conditional
card:
elements:
- entity: device_tracker.d4vew557_davess9_2
hold_action: none
state_image:
home: /local/Bear.jpg
not_home: /local/Bear_away.jpg
style:
left: 5%
top: 9%
width: 10%
tap_action: none
type: image
- entity: switch.power
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/porch_over.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 14%
top: 67%
width: 21%
tap_action: none
type: image
- entity: switch.power
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/passage_over.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 30.2%
top: 38.3%
width: 34%
tap_action: none
type: image
- entity: switch.power
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/kitchen_over.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 33.4%
top: 67.6%
width: 42%
tap_action: none
type: image
- entity: switch.power
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/cupboard_over.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 47%
top: 25.%
width: 10%
tap_action: none
type: image
- entity: switch.power
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/garden_over.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 88%
top: 36.%
width: 18%
tap_action: none
type: image
- entity: switch.livingroomlight
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/patio_over.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 80.4%
top: 35.%
width: 18%
tap_action: none
type: image
- entity: switch.livingroomlight
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/livingroom.png
'on': /local/custom_ui/floorplan/trans_square.png
style:
left: 50%
top: 50%
width: 100%
tap_action: none
type: image
- entity: cover.front_blinds
hold_action: none
state_image:
closed: /local/custom_ui/floorplan/passage_blind_closed_over.png
open: /local/custom_ui/floorplan/passage_blind_open_over.png
style:
left: 17.7%
top: 43%
width: 22.5%
tap_action: none
type: image
- entity: binary_sensor.front_door
hold_action: none
state_image:
'off': /local/custom_ui/floorplan/front_door_closed_over.png
'on': /local/custom_ui/floorplan/front_door_open_over1.png
style:
left: 13.8%
top: 66.8%
width: 20.5%
tap_action: none
type: image
- entity: switch.livingroomlight
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 62%
top: 39%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.livingroomlight
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 82%
top: 33.4%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.power
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 91%
top: 47.5%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.power
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 47%
top: 25%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.power
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 34%
top: 67%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.power
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 33.5%
top: 43%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.power
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 10.5%
top: 51%
width: 6%
tap_action:
action: toggle
type: image
- entity: switch.on_off
style:
'--paper-item-icon-color': black
left: 65.%
top: 61.%
transform: scale(2)
tap_action:
action: toggle
type: state-icon
- entity: switch.low
style:
'--paper-item-icon-color': black
left: 60%
top: 63.5%
transform: scale(2)
tap_action:
action: toggle
type: state-icon
- entity: switch.high
style:
'--paper-item-icon-color': black
left: 70.5%
top: 58.5%
transform: scale(2)
tap_action:
action: toggle
type: state-icon
- entity: input_select.floorplan_floor
image: /local/custom_ui/floorplan/trans_square.png
style:
border: 2px solid red
left: 33.5%
top: 10%
width: 6%
tap_action:
action: call-service
service: input_select.select_next
service_data:
entity_id: input_select.floorplan_floor
type: image
- entity: binary_sensor.motion1
icon: 'mdi:run'
style:
'--paper-item-icon-active-color': '#ff0000'
background-color: 'rgba(25, 25, 25, 0.3)'
border-radius: 50%
left: 68.5%
top: 5.5%
transform: scale(1.8)
type: state-icon
image: /local/custom_ui/floorplan/floorplan6.png
type: picture-elements
conditions:
- entity: input_select.floorplan_floor
state: 2nd Floor
type: conditional
any help getting these into a conditional horizontal card would be much appreciated.