Can't get a legend_click to toggle a boolean using Plotly-Graph

I’m trying to get mt plot to toggle a boolean helper when the legend is clicked. Nothing happens when I click the legend (including the removal of the solar plot). Can anyone help?
Thanks

type: custom:plotly-graph
hours_to_show: 24
config:
  disable_pinch_to_zoom: true
  scrollZoom: false
layout:
  margin:
    r: 75
  dragmode: false
  legend:
    orientation: h
    xanchor: center
    x: 0.5
entities:
  - entity: sensor.pv_1_minute
    name: Solar
    fill: tozeroy
    line:
      color: gold
    on_legend_click: |-
      {
        $ex hass.callService('input_boolean', 'turn_on', {
          entity_id: 'binary_sensor.sunny_profile'
        })
      }
  - entity: sensor.load_1_minute
    name: Load
    fill: tozeroy
    line:
      color: blue
refresh_interval: 10
title: Energy Overview
'''

Suggest to add a “plotly-graph” word to the thread‘s title.