REST sensor - how to authenticate and pass headers?

Hi everyone
Someone gave me a way to extract the data from the local power provider.
It requires authentication, storage or headers (which I guess will have auth info) and then requesting data through their REST API.
Is it possible to do inside HA itself, or I need to make my own docker image etc and send via MQTT?

1 – Login & store headers to a file
curl -d ‘username=xxxx&password=xxxxx&submit=Login’ --dump-header headers

2 – Now get the data, using the headers
curl -L -b headers ‘’
(remember to provide account # and meter #)

1 Like