I've wrote a small application that provides control over the desired setting of my F-Series TV via HTTP REST.
It achieves that by abusing libBackPicSet
viewtopic.php?t=9861
Control is done by dumping the current settings, changing the byte that represents the backlight setting and restoring the edited backup file.
Unfortunately, since this is an F-Series TV, I do need to switch inputs for changes to take effect so I just run two samyGorc commands to switch to Analog and then back to HDMI in.
This works fine for my setup since I only use my TV as an HDMI screen. ymmv
Since there's source code available for libBackPicSet, the proper solution would of course be to understand that, extract the relevant logic and build your own lib that just sets the backlight value.
Unfortunately though, documentation for samyGO overall isn't that great so the chance that I mess up something while doing that is rather large.
Maybe that could be a solution that avoids the automatic input switching
Maybe @zoelechat can help out here?