Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Error requesting hvac_status data #51

Closed
WinkelB opened this issue Oct 4, 2020 · 33 comments
Closed

Error requesting hvac_status data #51

WinkelB opened this issue Oct 4, 2020 · 33 comments
Labels
question Further information is requested

Comments

@WinkelB
Copy link

WinkelB commented Oct 4, 2020

Version: v3.0.0-rc2
Getting Errror Messages with my Renault Zoe Phase 2
Im not getting any HVAC Informations...

Logger: custom_components.renault.pyzevehicleproxy
Source: helpers/update_coordinator.py:152
Integration: Renault (documentation)
First occurred: 21:55:16 (1 occurrences)
Last logged: 21:55:16

Error requesting VINXXXXXXXXXXXX hvac_status data: 502 Server Error: Bad Gateway for url: https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/ACCOUNTXXXXXXXXXXXXXXX/kamereon/kca/car-adapter/v1/cars/VINXXXXXXXXXXXX/hvac-status?country=DE

@epenet
Copy link
Collaborator

epenet commented Oct 4, 2020

Hi,

Can you please confirm:

  • was it working in v2?
  • is it a permanent issue or is it an intermittent issue?
  • does it work in the PyZe CLI?

I'm pretty sure it's an intermittent issue on the Renault side.

@PysX
Copy link
Contributor

PysX commented Oct 5, 2020

Hi, for information i have the same issue. It's not new as Pyze gives me this response too (from Renault side).
I suspect that the problem is related to the configuration of "Planned HVAC" setting in the vehicle, mine was never activated, i will test this one.
However, i am able to start HVAC with service via homeassistant.

- service: renaultze.ac_start
        data:
          entity_id: sensor.zoe

@epenet
Copy link
Collaborator

epenet commented Oct 5, 2020

I'm pretty sure 502 error is temporary on the Renault side.

Regarding HVAC start/stop, I would dearly love to have some feedback as I personally don't use it.
Please note also that the new service is designed to use the VIN and not the entity_id

@epenet
Copy link
Collaborator

epenet commented Oct 15, 2020

Extra note: if your vehicle doesn't support location and/or hvac status, then I suggest that you simply deactivate the "Zoe Location" and "Zoe HVAC" entities via "Configuration > Integrations >Renault >Entities" menu of home assistant.

@WinkelB
Copy link
Author

WinkelB commented Nov 20, 2020

So currently, I was able to start a HVAC vie the Service Call out of Homeassistant using version 3.0 of the Renault integration. The climate entity is still unavailed.

@epenet
Copy link
Collaborator

epenet commented Dec 1, 2020

This is not an issue from HomeAssistant or this custom component, and I think it's better to discuss it now on the renault-api repository.

@epenet
Copy link
Collaborator

epenet commented Dec 17, 2020

I reopen the issue on Home-Assistant because it seems that even if the "status" endpoint is disabled some users are still able to send requests to use the hvac services, so we need to disconnect the climate entity from the hvac-status endpoint.

And even if the endpoint doesn't work for the status of the hvac, it is still useful to get the outside temperature.

@epenet
Copy link
Collaborator

epenet commented Dec 17, 2020

Hi @PysX / @WinkelB / @marciej123

Does it make sense to use a climate entity to start hvac even if there is no feedback on the status?
Or should we keep it only as a service?

For now:

  • on Zoe40 (with hvac): you have a UI to select the temperature and ability to press "start now"
  • on Zoe40 (without hvac): you don't have UI
  • on Zoe50: the UI is not created because it thinks you don't have hvac system

@Quentame / @oncleben31 what is your opinion on this?

(More information on: https://github.com/hacf-fr/renault-api/wiki/Data-endpoint:-hvac-status)

@WinkelB
Copy link
Author

WinkelB commented Dec 17, 2020 via email

@marciej123
Copy link

I have a Zoe50 and HA does find my hvac entity (just since a few days, therefore I few weeks it didn't have one), unfortunately this entity, and a lot of other entity are unavailable..

Now we know that the Renault app and API isn't the best one and has some stability options but I'm not sure if that's just the issue?

@PysX
Copy link
Contributor

PysX commented Dec 17, 2020

I have created switch and script, so not important to me.
Not tested to start with different temperature than default 21.

@epenet
Copy link
Collaborator

epenet commented Dec 18, 2020

Does it work if you simply remove the if "hvac_status" in vehicle.coordinators: on line 49 of climate.py?
https://github.com/hacf-fr/hassRenaultZE/blob/master/custom_components/renault/climate.py#L49

And does someone want to work on a PR?

@PaoloTo
Copy link

PaoloTo commented Dec 30, 2020

Dear @epenet,
I have a Twingo ZE, i've tested this component and I've the same error:
2020-12-30 15:58:45 ERROR (MainThread) [custom_components.renault.renault_vehicle] Error fetching VF****6 hvac_status data: This endpoint has been disabled: ('err.func.403', 'Operation not supported Operation not supported for this can (T4VS)')
I've tried to remove the line 49 of climate.py but no climate entity is generated and i've got this error:
2020-12-30 16:05:57 ERROR (MainThread) [homeassistant.components.climate] Error while setting up renault platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/renault/climate.py", line 34, in async_setup_entry entities: List[RenaultDataEntity] = await get_entities(proxy) File "/config/custom_components/renault/climate.py", line 42, in get_entities entities.extend(await get_vehicle_entities(vehicle)) File "/config/custom_components/renault/climate.py", line 50, in get_vehicle_entities entities.append(RenaultHVACController(vehicle, "HVAC")) File "/config/custom_components/renault/renault_entities.py", line 93, in __init__ super().__init__(vehicle, entity_type, "hvac_status") File "/config/custom_components/renault/renault_entities.py", line 28, in __init__ super().__init__(vehicle.coordinators[coordinator_key]) KeyError: 'hvac_status'

@epenet
Copy link
Collaborator

epenet commented Dec 30, 2020

@PaoloTo would you mind adding a fixture file to the renault-api module for your Twingo? We don't have any fixture files for Twingo yet...
hacf-fr/renault-api#48

Also, does Twingo support setting HVAC via MyRenault application and/or using HA ac_start service?

@PaoloTo
Copy link

PaoloTo commented Jan 3, 2021

Yes, i could help you integrating this fixture but I need some help, i can test it for you of course!

from MyRenault I've a button to start the ac, if I press it, it takes some seconds (near 5 seconds, maybe a connection problem?) but then the ac starts!
Even using ac_start service the ac starts. then i tried the ac_cancel but it din't stop.

@PaoloTo
Copy link

PaoloTo commented Jan 4, 2021

Dear @epenet,
using ac_start service the log is:
2021-01-03 15:55:28 DEBUG (MainThread) [custom_components.renault.services] A/C start attempt: None / 20 2021-01-03 15:55:29 DEBUG (MainThread) [renault_api.kamereon] Received Kamereon response 200 on https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/*****/kamereon/kca/car-adapter/v1/cars/***/actions/hvac-start?country=IT: {"data":{"type":"HvacStart","id":"*****","attributes":{"action":"start","targetTemperature":20.0}}} 2021-01-03 15:55:29 INFO (MainThread) [custom_components.renault.services] A/C start result: {'action': 'start', 'targetTemperature': 20.0}
using ac_cancel servis the log is:
2021-01-03 15:58:25 DEBUG (MainThread) [custom_components.renault.services] A/C cancel attempt. 2021-01-03 15:58:25 DEBUG (MainThread) [renault_api.kamereon] Received Kamereon response 200 on https://api-wired-prod-1-euw1.wrd-aws.com/commerce/v1/accounts/*****/kamereon/kca/car-adapter/v1/cars/***/actions/hvac-start?country=IT: {"data":{"type":"HvacStart","id":"*****","attributes":{"action":"cancel"}}} 2021-01-03 15:58:25 INFO (MainThread) [custom_components.renault.services] A/C cancel result: KamereonVehicleHvacStartActionData(raw_data={'action': 'cancel'})

@epenet
Copy link
Collaborator

epenet commented Jan 4, 2021

@PaoloTo

First, regarding fixture file, I was only referring to providing vehicle description sample logs for renault-api, like in this path: https://github.com/hacf-fr/renault-api/tree/main/tests/fixtures/kamereon/vehicles

  1. in the Home Assistant logs, find the vehicle listing from the initialisation routine
  2. add the json file to the correct test/fixtures/kamereon/vehicles folder
  3. ensure that the registration number starts with REG-NUMBER, and that the vin starts with VF1AAAAA555777.
  4. beautify the json (2 spaces indentation) either manually, through pre-commit or through an online tool (eg https://codebeautify.org/jsonviewer)
  5. create a Pull Request

Second, regarding MyRenault application, what does that show when A/C is in progress? As it stands, I am not aware of any way to know when A/C is on, and when it is off.
I am thinking to avoid confusion that we should remove the climate entity altogether, and provide sample scripts only.

@PaoloTo
Copy link

PaoloTo commented Jan 4, 2021

@epenet

Inside MyRenault Application nothing shows me that ac is in progress and this is very annoying. I even don't know when it will stop... after some minutes? when it reaches the target temp? or maybe only if the battery goes under 20%?

@epenet
Copy link
Collaborator

epenet commented Jan 4, 2021

@PaoloTo thanks for your feedback. This is in line with all the information that we have... it's not possible to know what the real status from Renault servers. @eviollet also has the same issue.

So I think we need to remove the hvac-status endpoint from all vehicles except Zoe phase 1, where it is useful to track the externalTemperature.

Then we need to decide what is the best way to start (and cancel?) A/C from Home Assistant.
Do we keep only the service (like @PysX)? or does someone have an idea for another implementation?

@PaoloTo
Copy link

PaoloTo commented Jan 4, 2021

@epenet

if we don't have the ability to read out the temperature and neither the active status of the hvac i think that the climate is not suitable for us.
Maybe is useful a simple script that calls the two services, start the pre-conditioning and stops it after some (5-10) minutes.
ac_cancel works? it stops the ac even if we have already start driving?

Another way: what about using hvac sheduling? like adding a schedule that start immediately and ends in some minutes? after that the script could cancel the schedule.

@epenet
Copy link
Collaborator

epenet commented Jan 6, 2021

I have opened this issue on renault-api: hacf-fr/renault-api#138
I'm open to suggestions...

@eviollet
Copy link

eviollet commented Jan 7, 2021

Hi.

I've been looking around for some information on how to configure preconditionning remotely without using the phone app.
From what the Renault Zoe user manual says, once you have initiated preconditionning, it stops after 10 minutes if the car isn't plugged in. And no, there is no way to stop it, except from entering the car, or starting it, etc. So it seems totally legit that we can start the service without having any return from the API. The app doesn't return any information either.
So, with a ZOE50, what would I need to call preconditionning in the current plugin state? Is it currently possible?

@epenet
Copy link
Collaborator

epenet commented Jan 7, 2021

Yes, there is a service called renault.ac_start available (in developer tools > services).

You have to specify the vin and temperature.
If you wish to have a delayed start, you can pass the optional parameter when.

There is also a service called renault.ac_cancel which may work to cancel preconditionning even though the Renault application doesn't have the option.

@PaoloTo
Copy link

PaoloTo commented Jan 7, 2021

Dear @eviollet,
you can add a lovelace button card with custom code like this:

type: button
tap_action:
  action: call-service
  service: renault.ac_start
  service_data:
    vin: VF**************6
    temperature: 20
hold_action:
  action: none
show_icon: true
name: Start hvac
icon: 'mdi:snowflake'

@eviollet
Copy link

eviollet commented Jan 7, 2021

@PaoloTo and @epenet , thank you very much for your help.
I guess I managed to get it to work. I'll check this evening when the car comes back. 🤣

@epenet
Copy link
Collaborator

epenet commented Jan 7, 2021

Hi all,

I have created PR hacf-fr/renault-api#139 on renault-api to make it clearer.
Does anyone want to check it?

After it is merged there, then I think we'll just completely remove the climate entity from HA, and update the documentation with the notes from @PaoloTo

@PysX
Copy link
Contributor

PysX commented Jan 7, 2021

Hi, seems ok to remove climate. As it will avoid “does not work” feeback. May limitations by model could be documented in the readme/wiki ?

@epenet : if ac_cancel service is not working can it be disabled too ?

@eviollet : another implementation to have “fake status” (timer 5min). It avoids myself clicking more than one : https://github.com/PysX/home-assistant-config/blob/master/packages/zoe.yaml
May be not optimised but working.

@eviollet
Copy link

eviollet commented Jan 7, 2021

@PysX thank you for the 5 minute delay idea. I'd never thought of that. I'm quite new to Home Assistant and loving it.

Have a great evening

@marciej123
Copy link

Can I get this to work for the ZE50?

My main car is the ZE50, and information is working, only the start of preconditioning isn't.

2nd picture has hvac working of a ze40, car of a Colleague of mine (same account).

Screenshot_2021-01-07-23-33-37-903_io homeassistant companion android
Screenshot_2021-01-07-23-33-31-147_io homeassistant companion android

@marciej123
Copy link

Managed to get it working using the call as it was stated before. The automatic entity which is generated for the ZE50 doesn't seem to work..

I've also changed the timer to 10 minutes (600 seconds) which seemed way more stable for me.

This is the script with a notification that the car started the HVAC

start_hvac:
  alias: Start HVAC
  sequence:
  - service: renault.ac_start
    data:
      vin: VF1xxxxxxx
      temperature: 21
  - device_id: xxxxxxxxxxxxx
    domain: mobile_app
    type: notify
    message: Starting HVAC at 21°C
    title: Renault ZOE
  mode: single
  icon: mdi:snowflake

Thanks!

@epenet
Copy link
Collaborator

epenet commented Jan 29, 2021

Hi all,

I have created two PR:

I will leave them open for a little while for testing/feedback.

Regarding documentation of the scripts and lovelace cards, maybe someone wants to create a new documentation page?

@PysX
Copy link
Contributor

PysX commented Jan 30, 2021

Thanks @epenet , will try it tomorrow.
I have submitted a PR for documentation, i don't know how you think it should be, I will adjust it following your feedbacks.

@epenet
Copy link
Collaborator

epenet commented Feb 2, 2021

Hi all

The PRs have been merged, and the documentation has been updated.
It's all included in release v3.0.6

@WinkelB are you happy to close this issue?

@epenet epenet added the question Further information is requested label Feb 2, 2021
@epenet epenet closed this as completed Mar 15, 2021
@epenet epenet pinned this issue Mar 30, 2021
@epenet epenet unpinned this issue Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants