molobrakos / volvooncall

Retrieve information from the Volvo On Call (VOC) web service
The Unlicense
158 stars 51 forks source link

Add Support for separating Honk and Blink commands #19

Closed mjpcomp closed 6 years ago

mjpcomp commented 6 years ago

On the 2017 XC90 T8, within the App, I'm able to flash the lights, or do both the Horn and Flash... Pulling the status from your script, I noticed this:

"honkAndBlinkDistance": 500, "honkAndBlinkSupported": true, "honkAndBlinkVersionsSupported": [ "honkAndOrBlink", "honkAndBlink" ],

It looks like the honkandblink supported needs to be adjusted to support the separate commands? I don't know if I have time to fork and modify and submit, but, just wanted to bring up the breakout for the honk and blink.

From here: https://forums.swedespeed.com/showthread.php?526450-Getting-acclimated-with-VOC-API-WOW-so-much-potential! it looks like the following commands were found:

/honk_and_flash /honk_blink/both /honk_blink/horn /honk_blink/lights

Here's the full Status Dump in case there's any difference between what you've seen/written for, and what might be available now:

{ "ERS": { "status": "off", "timestamp": "2018-06-27T16:24:12+00:00", "engineStartWarning": "None", "engineStartWarningTimestamp": "2018-06-27T16:24:12+00:00" }, "VIN": "REMOVED", "assistanceCallSupported": true, "averageFuelConsumption": 58.0, "averageFuelConsumptionTimestamp": "2018-07-03T17:10:11+00:00", "averageSpeed": 41, "averageSpeedTimestamp": "2018-07-03T17:10:11+00:00", "bCallAssistanceNumber": "+18553994691", "brakeFluid": "Normal", "brakeFluidTimestamp": "2018-07-03T17:10:11+00:00", "bulbFailures": [], "bulbFailuresTimestamp": "2018-07-03T17:10:11+00:00", "calculatedPosition": { "longitude": null, "latitude": null, "timestamp": null, "speed": null, "heading": null }, "carLocatorDistance": 1000, "carLocatorSupported": true, "carLocked": true, "carLockedTimestamp": "2018-07-03T17:10:11+00:00", "climatizationCalendarMaxTimers": 8, "climatizationCalendarVersionsSupported": [ "climatizationCalendarV1" ], "connectionStatus": "ConnectedWithPower", "connectionStatusTimestamp": "2018-07-03T20:47:08+00:00", "country": { "iso2": "US" }, "distanceToEmpty": 96, "distanceToEmptyTimestamp": "2018-07-03T17:10:11+00:00", "doors": { "tailgateOpen": false, "rearRightDoorOpen": false, "rearLeftDoorOpen": false, "frontRightDoorOpen": false, "frontLeftDoorOpen": false, "hoodOpen": false, "timestamp": "2018-07-03T17:10:11+00:00" }, "engineCode": "XXXXXXXX", "engineRunning": false, "engineRunningTimestamp": "2018-07-03T17:10:11+00:00", "engineStartSupported": true, "exteriorCode": "XXXXXXXX", "fuelAmount": 16, "fuelAmountLevel": 32, "fuelAmountLevelTimestamp": "2018-07-03T17:10:11+00:00", "fuelAmountTimestamp": "2018-07-03T17:10:11+00:00", "fuelTankVolume": 50, "fuelType": "HEV", "gearboxCode": "XXXXXXXX", "grossWeight": 3010, "heater": { "seatSelection": { "frontDriverSide": false, "frontPassengerSide": false, "rearDriverSide": false, "rearPassengerSide": false, "rearMid": false }, "status": "off", "timer1": { "time": null, "state": null }, "timer2": { "time": null, "state": null }, "timestamp": "2018-06-12T01:42:34+00:00" }, "highVoltageBatterySupported": true, "honkAndBlinkDistance": 500, "honkAndBlinkSupported": true, "honkAndBlinkVersionsSupported": [ "honkAndOrBlink", "honkAndBlink" ], "hvBattery": { "hvBatteryChargeStatusDerived": "CablePluggedInCar_FullyCharged", "hvBatteryChargeStatusDerivedTimestamp": "2018-07-03T20:47:08+00:00", "hvBatteryChargeModeStatus": null, "hvBatteryChargeModeStatusTimestamp": null, "hvBatteryChargeStatus": "ChargeEnd", "hvBatteryChargeStatusTimestamp": "2018-07-03T20:47:08+00:00", "hvBatteryLevel": 100, "hvBatteryLevelTimestamp": "2018-07-03T20:47:08+00:00", "distanceToHVBatteryEmpty": 29, "distanceToHVBatteryEmptyTimestamp": "2018-07-03T20:47:08+00:00", "hvBatteryChargeWarning": "UnexpectedPowerloss", "hvBatteryChargeWarningTimestamp": "2018-07-03T17:32:55+00:00", "timeToHVBatteryFullyCharged": 0, "timeToHVBatteryFullyChargedTimestamp": "2018-07-03T20:47:08+00:00" }, "interiorCode": "XXXXXXXX", "journalLogEnabled": true, "journalLogSupported": true, "lockSupported": true, "maxActiveDelayChargingLocations": 7, "modelYear": 2017, "numberOfDoors": 5, "odometer": 10940972, "odometerTimestamp": "2018-07-03T17:10:11+00:00", "overrideDelayChargingSupported": false, "position": { "longitude": REMOVED, "latitude": REMOVED, "timestamp": "2018-07-03T17:09:11+00:00", "speed": null, "heading": null }, "preclimatizationSupported": true, "privacyPolicyEnabled": false, "privacyPolicyEnabledTimestamp": "2018-02-16T21:03:14+00:00", "registrationNumber": "UNKNOWN", "remoteClimatizationStatus": "CableConnectedWithPower", "remoteClimatizationStatusTimestamp": "2018-07-03T20:47:08+00:00", "remoteHeaterSupported": false, "sendPOIToVehicleVersionsSupported": [ "sendSinglePOIToVehicle" ], "serverVersion": "4.18.15-voc-deployable", "serviceWarningStatus": "Normal", "serviceWarningStatusTimestamp": "2018-07-03T17:10:11+00:00", "status.parkedIndoor.supported": false, "subscriptionEndDate": "2020-09-23T12:00:00+00:00", "subscriptionStartDate": "2017-09-23T12:00:00+00:00", "subscriptionType": "PREMIUM_2013", "theftAlarm": null, "timeFullyAccessible": 7200, "timeFullyAccessibleUntil": "2018-07-08T17:08:43+00:00", "timePartiallyAccessible": 31680, "timePartiallyAccessibleUntil": "2018-07-25T17:08:43+00:00", "tripMeter1": 525400, "tripMeter1Timestamp": "2018-07-03T17:10:11+00:00", "tripMeter2": 5100, "tripMeter2Timestamp": "2018-07-03T17:10:11+00:00", "tyreDimensionCode": "XXXXXXXX", "tyreInflationPressureHeavyCode": null, "tyreInflationPressureLightCode": null, "tyrePressure": { "frontLeftTyrePressure": "Normal", "frontRightTyrePressure": "Normal", "rearLeftTyrePressure": "Normal", "rearRightTyrePressure": "Normal", "timestamp": "2018-07-03T17:10:11+00:00" }, "unlockSupported": true, "unlockTimeFrame": 120, "vehiclePlatform": "XXXX", "vehicleType": "XC90", "vehicleTypeCode": "XXXXXXXX", "verificationTimeFrame": 120, "vin": "REMOVED", "washerFluidLevel": "Normal", "washerFluidLevelTimestamp": "2018-07-03T17:10:11+00:00", "windows": { "frontLeftWindowOpen": false, "frontRightWindowOpen": false, "timestamp": "2018-07-03T17:10:11+00:00", "rearLeftWindowOpen": false, "rearRightWindowOpen": false } }

chixxi commented 6 years ago

I would also like to see this as I am driving the same Volvo.

I am still fighting with the setup of this, any hint on how you did that?

Is the pre-climatization command working for your XC90?

mjpcomp commented 6 years ago

@chixxi - I haven't tried the Parking Climate feature since I don't use it (I usually just use remote start to get the cabin temperature going). In terms of the VolvoOnCall code here, I ran it on Ubuntu 18.04 - didn't really take much. Just use PIP3 (not PIP, which is Python2 - I did that the first time and wondered why flake8 failed tests).

The only other changes I made (to make it easy) - set up the voc.conf file with the username, password, and region.. Since I only have a single Volvo, I could run the VOC commands directly without having to add any other options.

mjpcomp commented 6 years ago

If I get time, and get my Python skills up to par, I was thinking it would be great to add the following additional features:

When running the "Status" option - if the vehicle is a hybrid/EV, show the battery status as well (range, charging, time to full charge, etc...).

Also, just saw the following change when I ran the print command:

"serverVersion": "4.18.17-feature-att_paygo_rateplan-voc-deployable",

chixxi commented 6 years ago

I also got it working. Now working on a driver for NEEO so that the Volvo can be integrated in my smart home controller. Thanks for your feedback.

mjpcomp commented 6 years ago

@chixxi If you get a chance, when you create that NEEO driver, could you post it? I have 3 of them and it would be great to get that integrated as well. I'm hoping someone can get a SmartThings device handler made for this, as well, since that would be the ultimate win.

chixxi commented 6 years ago

Wow, cool to hear that you have three NEEOs! I only have two but I fell in love with them ;-)

It is very very basic and just proof of concept, I will keep working on it, but I am no actual developer either: https://github.com/chixxi/neeo-voc

There seems to be a distance limit for honking etc., to I have to figure out a way to get the vehicle position and send that right back with the call to make the API think the distance is zero.

I don't own smart things, but I know you can add NEEO as a secondary controller. That is not a full integration, but at least you can then control the z-wave devices at least. I have also seen drivers for Athom and openHAB, so I think it's not unrealistic

chixxi commented 6 years ago

What states and commands do you think would make sense to have on NEEO for the Volvo.

mjpcomp commented 6 years ago

@chixxi - I'll head over to your codebase and check it out!

I know with this codebase, you can read back the position and feed it to itself, so, it solves the distance limitations.

With the NEEO, I was one of the first few when they started their Kickstarter, so, ended up getting 3... Only have one in use, though, since they took forever to arrive, and Amazon Fire TV support wasn't there in the beginning.

Would definitely like to see the ability to lock/remote start/precondition, but, then, there aren't really many things left :p

molobrakos commented 6 years ago

Please submit separate pull requests for any new feature you wish to add. Please see https://github.com/molobrakos/volvooncall/blob/master/volvooncall.py#L329 for example.