If anyone reach this thread seaching for the same as me, I was solving this with:
- modifying my script to “curl” to HA API to change a new sensor with state of the result of the original script (less elegant as possible).
The other solution: code your script/commandline as a new python component in HA.