Can I call a python_script directly from lovelace?

If I create an intermediate hass script that calls a python_script, the lovelace ui will allow me to call it via call-service, for example:

tap_action:
  action: call-service
  service: script.hass_script_intermediary

Is there a way I can call the python_script directly from lovelace? Lovelace doesn’t seem to show or allow them under entities.

Being able to call python_scripts directly would save a lot of time not having to create intermediary scripts for each python call. This example below will not work:

tap_action:
  action: call-service
  service: python_script.endpoint
    action: [payload]

Is there a different action to call a python_script, or does this functionality not exist in lovelace?

1 Like

It’s a good question. I have a script that calls python_script and it’s by design but agree, when I researched about LL service calls, I had an impression it’s might be dot possible to call them directly.
When you say “will not work”, what does that mean?

Actually, I was able to call it as long as the main entity is not a python_script:

entity: [entity thats not a python_script]
tap_action:
  action: call-service
  service: python_script.endpoint
  service_data:
    action: this
    payload: that
type: entity-button

This seems to work decently enough.

1 Like

@RandomHassUser
Can you give me a real life example of service_data: or point me to the documentation for it?

Can it be used to pass parameters to the python_script? If yes could you give me an example.

Thanks