Switch for Hisense TV with HomeKit and Broadlink

Hello everybody,

I have a Hisense TV that I turn on and off via Broadlink.

The HomeKit integration gives me the status of whether the television is on or off.

How can I create a switch that switches on and off via Broadlink and gets the status from the Homekit.

On my devices that have no integration, I put on power metering plugs to know if the device is using any electricity - then I can derive the status of it from that. If you have a streaming device attached, like Apple TV, you can use the state of the Apple TV to help too (i.e., suspend = TV off, playing = TV on).

I need help, how i code this in yalm.

I have the status whether on or off.