How to create a "virtual" window entity?

Hello,
I want to integrate my alarm system with window sensors with home assistant. so all my windows open/close state are showing up in Home Assistant
My plan is that the Alarm system calls a home assistant webhook automation. This works already.
Now this automation shall change the state of the (not yet created entity kitchenwindow).
I have searched and looked but could not find a real explanation how to create a virtual entity for my kitchen window.
Anyone can point me to this? happy to share my final results there.
Overall it will be 6 Alarm system managed Windows and 6 home assistant.
Thank you!

P.s. why use 2 system? the exposed windows are monitored by an alarm system with is tightly integrated and more secure. Windows in the 2nd floor will be managed by Home Assistant to monitor the the open/close state.

Would something like this work for you?

Template cover - Home Assistant (home-assistant.io)

Hello Max,
the template you are refering to is for covers. as my entity actually is a window, I would like to create a window entity. Then I can treat all windows (zigbee and alarm system managed) the same…
or maybe I dont fully understand your proposal.

Window/door sensors are typically Binary sensors. If you want to change the state of an binary sensor entity based on a trigger, you would use a trigger-based template binary sensor.

My main problem (for now) is to create custom binary or better window entities.
The automation will work I think.
But I need to have a entity representing my alarm system sensor. Switching it on and off will work using either webhooks or direct the new entity state

@Didgeridrew I spent some time now on the templates and helpers… I think this is the way. But I have not fully understood templates and helpers so I struggle creating the flow. Can you propose a good start for templates and helpers?

I solved the use case differently:

I found an integration and now all windows show up as windows binary sensors.