I don’t own a Samsung TV, but I had a quick look at the local integration and it should have support for both the media_content_id (Channel number) and media_channel (channel name), since it uses the generic media player.
I think your problem is that you’re expecting the channel to show as a separate sensor when in fact it is now an attribute of the media player entity.
If you still have the local integration installed, it’s easy to verify this:
Turn on your TV & switch to any channel
In HA, go to Developer tools > States tab, search for media_player & find the entity created by the Samsung Smart Tv integration.
Look under the attributes column on the right - it should show you the channel details.
I think this can be massively simplified by calling the dedicated service to change channels inside the medial player according to the docs
tried your script and (at least on my TV -around 2016) ,it does not work.
The TV just responds with a message on the OSD saying 4 times “NOT AVAILABLE”
But thanks anyway for the idea of a different approach.