Adding a button to power up a optoma projector via rs232

Hello,
I’m trying to use home assistant to power up my optoma projector. It can be controlled by sending codes over rs232 just like the acer projector integration. I modified the acer integration to send the correct codes for the optoma projector. So now i want to test my modifications but I cant get it to work. I added many _LOGGER.debug() lines to the integration and it seems that the turn_on() function is never called. So this makes me think that my lovelace configuration is wrong.

Is this the correct way to add a power on button in lovelace?

type: entity-button
entity: switch.optoma_projector
tap_action:
  action: call-service
  service: switch.turn_on
  service_data:
    entity_id: switch.optoma_projector

Or alternatively can somebody who uses the acer integration show me his lovelace configuration?

Thanks