Configure honeycomb menu to set volume on axis control

Hello all,
having problems doing some math. I’m not an programmer and it’s probably easy for one.
I’m using honeycomb-menu from Sian-Lee-SA and i want to control the volume of a media player with the x axis.

              tap_action:
                action: call-service
                service: honeycomb
                service_data:
                  entity: entity
                  xy_pad:
                    x:
                      service: media_player.volume_set
                      service_data:
                        entity_id: media_player.mass_multiroom
                        volume_level: '{{ x_percentage / 100 }}'

I know that the math behind “volume_level” is wrong but i have no clue how to do it right. Think i should get the actual volume level and then calculate the x axis percentage to or from it. Anyone could help me?
Thx in advance!

Hello,
I’ve solved this identifying the y axis positive or negative value and executing an script based on this:

                      xy_pad:
                        'y':
                          invert: true
                          service: script.turn_on
                          service_data:
                            entity_id: >-
                              {{ ( y_percentage > 0 ? "script.tv_volume_up" :
                              "script.tv_volume_down" ) }}
2 Likes

can you show the script code?