In the logs you posted, it appears to do what you want. What are you seeing in practice that you don’t like?
At 11:36:23 the thermostat reported it was heating, and the bedroom light was turned on.
About 11 minutes later, at 11:45:53 the thermostat reported it was idle, and your piston turned the bedroom light off.
Can you elaborate on this? Does this mean a few minutes later, the heat came back on but your light didn’t switch on again? Is there anything in the logs from an event like this happening?
When you say it only happens once - do you mean once after you edit and save the piston, then it never triggers again?
Sorry for all the questions - trying to sort out what might be happening. It’s a simple piston and should work reliably the way you have it set up.
Edit to add: If there isn’t anything in the logs at a time the heat turns on/off, the piston has nothing to trigger against and nothing you can write in the piston will work around that. Then you’re looking at a device/network matter to sort out.