Usually there are 2 black wires at the switch - one that’s always hot with 120VAC (known as line side) and another that goes to the light fixture (known as load side). The switch’s job is to connect or disconnect line and load when you turn it on and off. It looks like this.
Another way electricians sometimes do it is to just run the power directly to the light fixture and then run a 2-wire cable from the light fixture to the switch. With this method you don’t have both hot and neutral at the switch, you only have one of them and you’re using the switch the break that one wire (line or neutral). It looks like this.
The second method is not conducive to home automation because smart light switches require both hot and neutral in order to power themselves. This method only works with simple mechanical switches. It sounds like this is what you have.
In this case you need to run a new power cable from the light fixture to the switch so you can have both hot and neutral at the switch. You might also try looking to see if there is an additional wire in the cable that has been cut back since it wasn’t being used. You’d be lucky if that was the case. If so, you’ll need to re-wire both the switch side and the light fixture side of the cable to make it work.
The only other possibility would be to use your green wire as either hot or neutral instead of ground but that would be unsafe and against electrical code because then your switch would not be grounded so it would be at risk to electrocute someone. Don’t do that.