renault-api icon indicating copy to clipboard operation
renault-api copied to clipboard

Add a way to Start Horn and/or Lights

Open remo-tech opened this issue 1 year ago • 6 comments

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

remo-tech avatar Oct 17 '24 10:10 remo-tech

Are you able to provide a PR?

epenet avatar Oct 17 '24 10:10 epenet

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 ...

remo-tech avatar Oct 17 '24 10:10 remo-tech

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.

jumpjack avatar Nov 09 '24 11:11 jumpjack

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.

jumpjack avatar Nov 27 '24 18:11 jumpjack

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 avatar Dec 04 '24 11:12 remo-tech

@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 ?

kelyaenn avatar Feb 01 '25 10:02 kelyaenn

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.

github-actions[bot] avatar Apr 24 '25 12:04 github-actions[bot]

Documentation added via #1554 Ability run these from Home Assistant will be added in #1555

epenet avatar Apr 25 '25 09:04 epenet

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

NickyMeuleman avatar Jun 02 '25 20:06 NickyMeuleman

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

epenet avatar Jun 02 '25 20:06 epenet

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-start as the definition key >> ...{vin}/actions/horn-lights endpoint
  • vehicle.start_lights() in the vehicle >> actions/lights-start as the definition key >> ...{vin}/actions/horn-lights endpoint

epenet avatar Jun 03 '25 09:06 epenet

does this feature require specific authorization/configuration? I get a "forbidden" error message on my Captur, rather than a "not found".

jumpjack avatar Jun 13 '25 08:06 jumpjack

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

epenet avatar Jun 13 '25 08:06 epenet

The endpoints have been added - I think we can close this now.

epenet avatar Oct 13 '25 05:10 epenet