Add a way to Start Horn and/or Lights
While trying to find a way to start a charge, I have found a new endpoint which allows to start horn and/or lights :
renault-api --log http post-file "/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v1/cars/{vin}/actions/horn-lights?country=FR" .\horn_request.json
And the request :
For Horn :
{"data":{"type":"HornLights","attributes":{"action":"start","target":"horn"}}}
For Light :
{"data":{"type":"HornLights","attributes":{"action":"start","target":"lights"}}}
It works well on my Scenic E-TECH.
Would be gratefull if this could be added into HA
Are you able to provide a PR?
Not in short term sorry. I am not enough confident in the project yet to be able to add a new feature in the correct way. But maybe in a distant future if nobody can do it quicker ...
it has always been there, but there is a news: since a couple of week the iOS app offers the capability of turning on lights and horn! But I can't provide any detail, I have an android phone.
It works well on my Scenic E-TECH.
How many passwords did you set in your app? Starting horn and lights (and engine...) is supposed to require an additional PIN.
It works well on my Scenic E-TECH.
How many passwords did you set in your app? Starting horn and lights (and engine...) is supposed to require an additional PIN.
Only one. There is no way to start the engine from the app. But horn & lights are working.
@remo-tech have you tried to start lights directly through the API with the payload provided in your first message ? It doesn't work for me... (22 Megane E-Tech), although the last refresh date of battery-status update meaning the car received something, lights don't flash. I sniffed the traffic from official MyRenault app, there is an additional srp before sending the request. Perhaps it could be this ?
There hasn't been any activity on this issue recently. Please make sure to update to the Renault API version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Documentation added via #1554 Ability run these from Home Assistant will be added in #1555
The actions/horn-lights isn't listed as a default endpoint, so calling await vehicle.get_full_endpoint("actions/horn-lights") fails.
But calling the full endpoint manually with http_post works.
works:
response = await vehicle.http_post(
"/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v1/cars/{vin}/actions/horn-lights",
{
"data": {
"type": "HornLights",
"attributes": {"action": "start", "target": "horn"},
}
},
)
I wanted to do this:
endpoint = await vehicle.get_full_endpoint("actions/horn-lights")
response = await vehicle.http_post(endpoint, {
"data": {
"type": "HornLights",
"attributes": {"action": "start", "target": "horn"},
}
})
But the ideal use would probably be:
response = await vehicle.horn_lights("horn")
edit: I could probably work on a PR to add this behavior if you want me to @epenet
edit: I could probably work on a PR to add this behavior if you want me to @epenet
Sure... always happy to take in PRs
Note: I reviewed data/GET endpoints but I'm still unhappy with action/POST endpoints
OK - I've started working on POST endpoints - see #1596
@NickyMeuleman that should give you a good base for implementation.
I suggest to keep actions separate on the vehicle, similar to ac-start and ac-stop having separate methods and separate definition pointing to same Renault endpoint:
vehicle.start_horn()in the vehicle >>actions/horn-startas the definition key >>...{vin}/actions/horn-lightsendpointvehicle.start_lights()in the vehicle >>actions/lights-startas the definition key >>...{vin}/actions/horn-lightsendpoint
does this feature require specific authorization/configuration? I get a "forbidden" error message on my Captur, rather than a "not found".
Note to all: if you know that an endpoint is definitely compatible, or definitely incompatible, please try to create at PR to update _VEHICLE_ENDPOINTS
https://github.com/hacf-fr/renault-api/blob/fd4ef7a285779aaecfd44edbbfefd0c3f034a1e9/src/renault_api/kamereon/models.py#L150-L169
The endpoints have been added - I think we can close this now.