Warstomper
(Danny Batenburg)
February 13, 2020, 10:02pm
1
Hi guys,
I am trying to create a Lovelace button card that executes an action in Kodi. I first tested if the call was working from the Services tab in the developers tools:
The log shows it as follows, and the command is executed correctly:
Received {'type': 'call_service', 'domain': 'kodi', 'service': 'call_method', 'service_data': {'entity_id': 'media_player.kodi', 'method': 'Input.Up'}, 'id': 40}
Now I am trying to put the same command into a button, which currently looks like this:
- card:
entity: media_player.kodi
icon: 'mdi:arrow-up-bold'
show_icon: true
show_name: false
tap_action:
action: call-service
service: kodi.call_method
service-data:
entity_id: media_player.kodi
method: Input.Up
type: entity-button
When pressing the button in the interface, the log shows the command as follows:
Received {'type': 'call_service', 'domain': 'kodi', 'service': 'call_method', 'service_data': {}, 'id': 27}
As you can see, the service_data is not being filled correctly, eventhough the data is part of the card.
Could anyone point me in the direction of what I am doing wrong?
Thanks in advance!
Fonderat
(Fonderat)
February 17, 2020, 5:29am
4
- entity: media_player.kodi
type: custom:mini-media-player
hide:
controls: true
icon: mdi:kodi
name: KODI
background: /local/kodi.jpg
shortcuts:
columns: 3 # Max buttons per row
buttons:
- name: menu
icon: 'mdi:menu'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ContextMenu
- icon: 'mdi:arrow-up-bold-circle'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Up
- icon: 'mdi:chevron-double-up'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ExecuteAction
action: pageup
- icon: 'mdi:arrow-left-bold-circle'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Left
- icon: 'mdi:check-circle-outline'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Select
- icon: 'mdi:arrow-right-bold-circle'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Right
- icon: 'mdi:backburger'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Back
- icon: 'mdi:arrow-down-bold-circle'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Down
- icon: 'mdi:chevron-double-down'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ExecuteAction
action: pagedown
- icon: 'mdi:chevron-double-left'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ExecuteAction
action: stepback
- icon: 'mdi:pause'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ExecuteAction
action: playpause
- icon: 'mdi:chevron-double-right'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ExecuteAction
action: stepforward
- name: home
icon: 'mdi:home'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.Home
- icon: 'mdi:stop'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.ExecuteAction
action: stop
- name: info
icon: 'mdi:information-outline'
type: service
id: kodi.call_method
data:
entity_id: media_player.kodi
method: Input.InfoPreformatted text
1 Like
would you know how to start and stop ad addon?
pafftis
(Maxim)
June 8, 2020, 8:59pm
6
Hi iem Maxim? from Russia.
Please help me. No work button
type: button
tap_action:
action: call-service
service: kodi.call_method
service_data: null
method: Input.Down
entity_id: media_player.kodi
hold_action:
action: more-info
show_icon: true
show_name: true
entity: media_player.kodi
name: DOWN
icon: ‘mdi:menu-down’
I’ve been looking for this, you’ve saved me SO much work. Thanks!