Curl command in automation

Hi all,

I have an Easee charging station at home using for my 2 EV’s.
One of them uses 3 phase charging the other 1 phase charging. The 1 phase-car can not handle setting automatic and 3 phase in the charger .

In the easee API I found I can command the charger to go into 1 or 3 phase mode charging via: (example text copied from support cloud website XXX and YYY are unique data))

curl --request POST
–url https://api.easee.com/api/chargers/EHYYYYY/commands/set_phase_mode
–header ‘Authorization: Bearer XXXXXX’
–header ‘content-type: application/*+json’
–data ‘{“phaseMode”:1}’

However how do I translate this into Home assistant? I looked everywhere but unable to find how to do it.

Thanks for all help!

Not sure if this helps - and I’m confident smarter people than I will undoubtedly give a full and complete solution but…

I have gates at the front of my property that have a GSM SIM Card, and I can send specially crafted text messages to that mobile telephone number to get the gates to open/close/hold-open etc. To cut a long story short I use a web based text messaging service via their API and I do this from several automations in Home Assistant.

In my ‘configuration.yaml’ file I have the following entries: -

rest_command:
gates_open:
url: “https://api.txtlocal.com/send
method: post
content_type: “application/x-www-form-urlencoded”
payload: “apikey=BlahBlahBlahBlahBlahBlahBlah&sender=HomeAutomation&numbers=BlahBlahBlah&message=4165RLA”

Then within my Automation I have the following Action: -

As an aside I used Postman (an online tool) to call the API and test the parameters - it is really quite helpful