Merge branch 'main' into mac-compoatibility-enhancements
This commit is contained in:
482
README.md
482
README.md
@@ -16,19 +16,20 @@ and should prevent most any random attacker on your network from being able to
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
To avoid running into issues later with your default python installs, it's recommended to use a py virtual env for doing this. Go to your desired test directory, and:
|
||||||
```
|
```
|
||||||
pip3 -r requirements.txt
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
git clone https://github.com/osresearch/hcpy
|
||||||
|
cd hcpy
|
||||||
|
pip3 install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the Python dependencies; the `sslpsk` one is a little weird
|
Install the Python dependencies; the `sslpsk` one is a little weird
|
||||||
and we might need to revisit it later.
|
and we might need to revisit it later.
|
||||||
|
|
||||||
### For Mac Users
|
|
||||||
To avoid running into issues later with your default python installs, it's recommended to use a py virtual env for doing this. Go to your desired test directory, and:
|
|
||||||
1. python3 -m venv venv
|
|
||||||
1. source venv/bin/activate
|
|
||||||
1. clone this repo
|
|
||||||
|
|
||||||
|
### For Mac Users
|
||||||
Installing `sslpsk` needs some extra steps:
|
Installing `sslpsk` needs some extra steps:
|
||||||
|
|
||||||
1. The openssl package installed via brew: `brew install openssl`, and
|
1. The openssl package installed via brew: `brew install openssl`, and
|
||||||
@@ -39,7 +40,7 @@ Installing `sslpsk` needs some extra steps:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
```
|
```bash
|
||||||
hc-login $USERNAME $PASSWORD > config.json
|
hc-login $USERNAME $PASSWORD > config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -55,10 +56,9 @@ the resulting configuration JSON file *should* be sufficient to
|
|||||||
connect to the devices on your local network, assuming that
|
connect to the devices on your local network, assuming that
|
||||||
your mDNS or DNS server resolves the names correctly.
|
your mDNS or DNS server resolves the names correctly.
|
||||||
|
|
||||||
|
|
||||||
## Home Connect to MQTT
|
## Home Connect to MQTT
|
||||||
|
|
||||||
```
|
```bash
|
||||||
hc2mqtt config.json
|
hc2mqtt config.json
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -82,89 +82,89 @@ library.
|
|||||||
|
|
||||||
Example message published to `homeconnect/dishwasher`:
|
Example message published to `homeconnect/dishwasher`:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"state": "Run",
|
"state": "Run",
|
||||||
"door": "Closed",
|
"door": "Closed",
|
||||||
"remaining": "2:49",
|
"remaining": "2:49",
|
||||||
"power": true,
|
"power": true,
|
||||||
"lowwaterpressure": false,
|
"lowwaterpressure": false,
|
||||||
"aquastop": false,
|
"aquastop": false,
|
||||||
"error": false,
|
"error": false,
|
||||||
"remainingseconds": 10140
|
"remainingseconds": 10140
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Full state information</summary>
|
<summary>Full state information</summary>
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
'AllowBackendConnection': False,
|
'AllowBackendConnection': False,
|
||||||
'BackendConnected': False,
|
'BackendConnected': False,
|
||||||
'RemoteControlLevel': 'ManualRemoteStart',
|
'RemoteControlLevel': 'ManualRemoteStart',
|
||||||
'SoftwareUpdateAvailable': 'Off',
|
'SoftwareUpdateAvailable': 'Off',
|
||||||
'ConfirmPermanentRemoteStart': 'Off',
|
'ConfirmPermanentRemoteStart': 'Off',
|
||||||
'ActiveProgram': 0,
|
'ActiveProgram': 0,
|
||||||
'SelectedProgram': 8192,
|
'SelectedProgram': 8192,
|
||||||
'RemoteControlStartAllowed': False,
|
'RemoteControlStartAllowed': False,
|
||||||
'520': '2022-02-21T16:48:54',
|
'520': '2022-02-21T16:48:54',
|
||||||
'RemoteControlActive': True,
|
'RemoteControlActive': True,
|
||||||
'AquaStopOccured': 'Off',
|
'AquaStopOccured': 'Off',
|
||||||
'DoorState': 'Open',
|
'DoorState': 'Open',
|
||||||
'PowerState': 'Off',
|
'PowerState': 'Off',
|
||||||
'ProgramFinished': 'Off',
|
'ProgramFinished': 'Off',
|
||||||
'ProgramProgress': 100,
|
'ProgramProgress': 100,
|
||||||
'LowWaterPressure': 'Off',
|
'LowWaterPressure': 'Off',
|
||||||
'RemainingProgramTime': 0,
|
'RemainingProgramTime': 0,
|
||||||
'ProgramAborted': 'Off',
|
'ProgramAborted': 'Off',
|
||||||
'547': False,
|
'547': False,
|
||||||
'RemainingProgramTimeIsEstimated': True,
|
'RemainingProgramTimeIsEstimated': True,
|
||||||
'OperationState': 'Inactive',
|
'OperationState': 'Inactive',
|
||||||
'StartInRelative': 0,
|
'StartInRelative': 0,
|
||||||
'EnergyForecast': 82,
|
'EnergyForecast': 82,
|
||||||
'WaterForecast': 70,
|
'WaterForecast': 70,
|
||||||
'ConnectLocalWiFi': 'Off',
|
'ConnectLocalWiFi': 'Off',
|
||||||
'SoftwareUpdateTransactionID': 0,
|
'SoftwareUpdateTransactionID': 0,
|
||||||
'SoftwareDownloadAvailable': 'Off',
|
'SoftwareDownloadAvailable': 'Off',
|
||||||
'SoftwareUpdateSuccessful': 'Off',
|
'SoftwareUpdateSuccessful': 'Off',
|
||||||
'ProgramPhase': 'Drying',
|
'ProgramPhase': 'Drying',
|
||||||
'SilenceOnDemandRemainingTime': 0,
|
'SilenceOnDemandRemainingTime': 0,
|
||||||
'EcoDryActive': False,
|
'EcoDryActive': False,
|
||||||
'RinseAid': 'R04',
|
'RinseAid': 'R04',
|
||||||
'SensitivityTurbidity': 'Standard',
|
'SensitivityTurbidity': 'Standard',
|
||||||
'ExtraDry': False,
|
'ExtraDry': False,
|
||||||
'HotWater': 'ColdWater',
|
'HotWater': 'ColdWater',
|
||||||
'TimeLight': 'On',
|
'TimeLight': 'On',
|
||||||
'EcoAsDefault': 'LastProgram',
|
'EcoAsDefault': 'LastProgram',
|
||||||
'SoundLevelSignal': 'Off',
|
'SoundLevelSignal': 'Off',
|
||||||
'SoundLevelKey': 'Medium',
|
'SoundLevelKey': 'Medium',
|
||||||
'WaterHardness': 'H04',
|
'WaterHardness': 'H04',
|
||||||
'DryingAssistantAllPrograms': 'AllPrograms',
|
'DryingAssistantAllPrograms': 'AllPrograms',
|
||||||
'SilenceOnDemandDefaultTime': 1800,
|
'SilenceOnDemandDefaultTime': 1800,
|
||||||
'SpeedOnDemand': False,
|
'SpeedOnDemand': False,
|
||||||
'InternalError': 'Off',
|
'InternalError': 'Off',
|
||||||
'CheckFilterSystem': 'Off',
|
'CheckFilterSystem': 'Off',
|
||||||
'DrainingNotPossible': 'Off',
|
'DrainingNotPossible': 'Off',
|
||||||
'DrainPumpBlocked': 'Off',
|
'DrainPumpBlocked': 'Off',
|
||||||
'WaterheaterCalcified': 'Off',
|
'WaterheaterCalcified': 'Off',
|
||||||
'LowVoltage': 'Off',
|
'LowVoltage': 'Off',
|
||||||
'SaltLack': 'Off',
|
'SaltLack': 'Off',
|
||||||
'RinseAidLack': 'Off',
|
'RinseAidLack': 'Off',
|
||||||
'SaltNearlyEmpty': 'Off',
|
'SaltNearlyEmpty': 'Off',
|
||||||
'RinseAidNearlyEmpty': 'Off',
|
'RinseAidNearlyEmpty': 'Off',
|
||||||
'MachineCareReminder': 'Off',
|
'MachineCareReminder': 'Off',
|
||||||
'5121': False,
|
'5121': False,
|
||||||
'HalfLoad': False,
|
'HalfLoad': False,
|
||||||
'IntensivZone': False,
|
'IntensivZone': False,
|
||||||
'VarioSpeedPlus': False,
|
'VarioSpeedPlus': False,
|
||||||
'5131': False,
|
'5131': False,
|
||||||
'5134': True,
|
'5134': True,
|
||||||
'SilenceOnDemand': False
|
'SilenceOnDemand': False
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
</details>
|
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
### Clothes washer
|
### Clothes washer
|
||||||
|
|
||||||
@@ -178,86 +178,86 @@ binary data over the websocket (type 0x82).
|
|||||||
|
|
||||||
Example message published to `homeconnect/washer`:
|
Example message published to `homeconnect/washer`:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"state": "Ready",
|
"state": "Ready",
|
||||||
"door": "Closed",
|
"door": "Closed",
|
||||||
"remaining": "3:48",
|
"remaining": "3:48",
|
||||||
"power": true,
|
"power": true,
|
||||||
"lowwaterpressure": false,
|
"lowwaterpressure": false,
|
||||||
"aquastop": false,
|
"aquastop": false,
|
||||||
"error": false,
|
"error": false,
|
||||||
"remainingseconds": 13680
|
"remainingseconds": 13680
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Full state information</summary>
|
<summary>Full state information</summary>
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
'BackendConnected': False,
|
'BackendConnected': False,
|
||||||
'CustomerEnergyManagerPaired': False,
|
'CustomerEnergyManagerPaired': False,
|
||||||
'CustomerServiceConnectionAllowed': False,
|
'CustomerServiceConnectionAllowed': False,
|
||||||
'DoorState': 'Open',
|
'DoorState': 'Open',
|
||||||
'FlexStart': 'Disabled',
|
'FlexStart': 'Disabled',
|
||||||
'LocalControlActive': False,
|
'LocalControlActive': False,
|
||||||
'OperationState': 'Ready',
|
'OperationState': 'Ready',
|
||||||
'RemoteControlActive': True,
|
'RemoteControlActive': True,
|
||||||
'RemoteControlStartAllowed': False,
|
'RemoteControlStartAllowed': False,
|
||||||
'WiFiSignalStrength': -50,
|
'WiFiSignalStrength': -50,
|
||||||
'LoadInformation': 0,
|
'LoadInformation': 0,
|
||||||
'AquaStopOccured': 'Off',
|
'AquaStopOccured': 'Off',
|
||||||
'CustomerServiceRequest': 'Off',
|
'CustomerServiceRequest': 'Off',
|
||||||
'LowWaterPressure': 'Off',
|
'LowWaterPressure': 'Off',
|
||||||
'ProgramFinished': 'Off',
|
'ProgramFinished': 'Off',
|
||||||
'SoftwareUpdateAvailable': 'Off',
|
'SoftwareUpdateAvailable': 'Off',
|
||||||
'WaterLevelTooHigh': 'Off',
|
'WaterLevelTooHigh': 'Off',
|
||||||
'DoorNotLockable': 'Off',
|
'DoorNotLockable': 'Off',
|
||||||
'DoorNotUnlockable': 'Off',
|
'DoorNotUnlockable': 'Off',
|
||||||
'DoorOpen': 'Off',
|
'DoorOpen': 'Off',
|
||||||
'FatalErrorOccured': 'Off',
|
'FatalErrorOccured': 'Off',
|
||||||
'FoamDetection': 'Off',
|
'FoamDetection': 'Off',
|
||||||
'DrumCleanReminder': 'Off',
|
'DrumCleanReminder': 'Off',
|
||||||
'PumpError': 'Off',
|
'PumpError': 'Off',
|
||||||
'ReleaseRinseHoldPending': 'Off',
|
'ReleaseRinseHoldPending': 'Off',
|
||||||
'EnergyForecast': 20,
|
'EnergyForecast': 20,
|
||||||
'EstimatedTotalProgramTime': 13680,
|
'EstimatedTotalProgramTime': 13680,
|
||||||
'FinishInRelative': 13680,
|
'FinishInRelative': 13680,
|
||||||
'FlexFinishInRelative': 0,
|
'FlexFinishInRelative': 0,
|
||||||
'ProgramProgress': 0,
|
'ProgramProgress': 0,
|
||||||
'RemainingProgramTime': 13680,
|
'RemainingProgramTime': 13680,
|
||||||
'RemainingProgramTimeIsEstimated': True,
|
'RemainingProgramTimeIsEstimated': True,
|
||||||
'WaterForecast': 40,
|
'WaterForecast': 40,
|
||||||
'LoadRecommendation': 10000,
|
'LoadRecommendation': 10000,
|
||||||
'ProcessPhase': 4,
|
'ProcessPhase': 4,
|
||||||
'ReferToProgram': 0,
|
'ReferToProgram': 0,
|
||||||
'LessIroning': False,
|
'LessIroning': False,
|
||||||
'Prewash': False,
|
'Prewash': False,
|
||||||
'RinseHold': False,
|
'RinseHold': False,
|
||||||
'RinsePlus': 0,
|
'RinsePlus': 0,
|
||||||
'SilentWash': False,
|
'SilentWash': False,
|
||||||
'Soak': False,
|
'Soak': False,
|
||||||
'SpeedPerfect': False,
|
'SpeedPerfect': False,
|
||||||
'SpinSpeed': 160,
|
'SpinSpeed': 160,
|
||||||
'Stains': 0,
|
'Stains': 0,
|
||||||
'Temperature': 254,
|
'Temperature': 254,
|
||||||
'WaterPlus': False,
|
'WaterPlus': False,
|
||||||
'AllowBackendConnection': False,
|
'AllowBackendConnection': False,
|
||||||
'AllowEnergyManagement': False,
|
'AllowEnergyManagement': False,
|
||||||
'AllowFlexStart': False,
|
'AllowFlexStart': False,
|
||||||
'ChildLock': False,
|
'ChildLock': False,
|
||||||
'Language': 'En',
|
'Language': 'En',
|
||||||
'PowerState': 'On',
|
'PowerState': 'On',
|
||||||
'EndSignalVolume': 'Medium',
|
'EndSignalVolume': 'Medium',
|
||||||
'KeySignalVolume': 'Loud',
|
'KeySignalVolume': 'Loud',
|
||||||
'EnableDrumCleanReminder': True,
|
'EnableDrumCleanReminder': True,
|
||||||
'ActiveProgram': 0,
|
'ActiveProgram': 0,
|
||||||
'SelectedProgram': 28718
|
'SelectedProgram': 28718
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
</details>
|
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
### Coffee Machine
|
### Coffee Machine
|
||||||
|
|
||||||
@@ -268,101 +268,101 @@ The coffee machine needs a better mapping to MQTT messages.
|
|||||||
<details>
|
<details>
|
||||||
<summary>Full state information</summary>
|
<summary>Full state information</summary>
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
'LastSelectedBeverage': 8217,
|
'LastSelectedBeverage': 8217,
|
||||||
'LocalControlActive': False,
|
'LocalControlActive': False,
|
||||||
'PowerSupplyError': 'Off',
|
'PowerSupplyError': 'Off',
|
||||||
'DripTrayNotInserted': 'Off',
|
'DripTrayNotInserted': 'Off',
|
||||||
'DripTrayFull': 'Off',
|
'DripTrayFull': 'Off',
|
||||||
'WaterFilterShouldBeChanged': 'Off',
|
'WaterFilterShouldBeChanged': 'Off',
|
||||||
'WaterTankEmpty': 'Off',
|
'WaterTankEmpty': 'Off',
|
||||||
'WaterTankNearlyEmpty': 'Off',
|
'WaterTankNearlyEmpty': 'Off',
|
||||||
'BrewingUnitIsMissing': 'Off',
|
'BrewingUnitIsMissing': 'Off',
|
||||||
'SelectedProgram': 0,
|
'SelectedProgram': 0,
|
||||||
'MacchiatoPause': '5Sec',
|
'MacchiatoPause': '5Sec',
|
||||||
'ActiveProgram': 0,
|
'ActiveProgram': 0,
|
||||||
'BeverageCountdownWaterfilter': 48,
|
'BeverageCountdownWaterfilter': 48,
|
||||||
'BeverageCountdownCalcNClean': 153,
|
'BeverageCountdownCalcNClean': 153,
|
||||||
'RemoteControlStartAllowed': True,
|
'RemoteControlStartAllowed': True,
|
||||||
'EmptyDripTray': 'Off',
|
'EmptyDripTray': 'Off',
|
||||||
'BeverageCountdownDescaling': 153,
|
'BeverageCountdownDescaling': 153,
|
||||||
'EmptyDripTrayRemoveContainer': 'Off',
|
'EmptyDripTrayRemoveContainer': 'Off',
|
||||||
'BeverageCounterRistrettoEspresso': 177,
|
'BeverageCounterRistrettoEspresso': 177,
|
||||||
'AllowBackendConnection': True,
|
'AllowBackendConnection': True,
|
||||||
'BeverageCounterHotWater': 37351,
|
'BeverageCounterHotWater': 37351,
|
||||||
'RemindForMilkAfter': 'Off',
|
'RemindForMilkAfter': 'Off',
|
||||||
'BeverageCounterFrothyMilk': 22,
|
'BeverageCounterFrothyMilk': 22,
|
||||||
'BeverageCounterCoffeeAndMilk': 1077,
|
'BeverageCounterCoffeeAndMilk': 1077,
|
||||||
'CustomerServiceRequest': 'Off',
|
'CustomerServiceRequest': 'Off',
|
||||||
'4645': 0,
|
'4645': 0,
|
||||||
'CoffeeMilkOrder': 'FirstCoffee',
|
'CoffeeMilkOrder': 'FirstCoffee',
|
||||||
'BackendConnected': True,
|
'BackendConnected': True,
|
||||||
'BeverageCounterCoffee': 21,
|
'BeverageCounterCoffee': 21,
|
||||||
'Enjoy': 'Off',
|
'Enjoy': 'Off',
|
||||||
'UserMode': 'Barista',
|
'UserMode': 'Barista',
|
||||||
'PlaceEmptyGlassUnderOutlet': 'Off',
|
'PlaceEmptyGlassUnderOutlet': 'Off',
|
||||||
'WaterTankNotInserted': 'Off',
|
'WaterTankNotInserted': 'Off',
|
||||||
'PlaylistRunning': False,
|
'PlaylistRunning': False,
|
||||||
'BeverageCounterPowderCoffee': 9,
|
'BeverageCounterPowderCoffee': 9,
|
||||||
'DemoModeActive': False,
|
'DemoModeActive': False,
|
||||||
'CleanBrewingUnit': 'Off',
|
'CleanBrewingUnit': 'Off',
|
||||||
'WaterHardness': 'Medium',
|
'WaterHardness': 'Medium',
|
||||||
'CloseDoor': 'Off',
|
'CloseDoor': 'Off',
|
||||||
'EmptyMilkTank': 'Off',
|
'EmptyMilkTank': 'Off',
|
||||||
'SpecialRinsing': 'Off',
|
'SpecialRinsing': 'Off',
|
||||||
'AllowConsumerInsights': False,
|
'AllowConsumerInsights': False,
|
||||||
'SwitchOffAfter': '01Hours15Minutes',
|
'SwitchOffAfter': '01Hours15Minutes',
|
||||||
'4681': 0,
|
'4681': 0,
|
||||||
'LastSelectedCoffeeWorldBeverage': 20514,
|
'LastSelectedCoffeeWorldBeverage': 20514,
|
||||||
'BrightnessDisplay': 7,
|
'BrightnessDisplay': 7,
|
||||||
'CleanMilkTank': 'Off',
|
'CleanMilkTank': 'Off',
|
||||||
'NotEnoughWaterForThisKindOfBeverage': 'Off',
|
'NotEnoughWaterForThisKindOfBeverage': 'Off',
|
||||||
'ChildLock': False,
|
'ChildLock': False,
|
||||||
'4666': 0,
|
'4666': 0,
|
||||||
'Language': 'De',
|
'Language': 'De',
|
||||||
'MilkContainerConnected': 'Off',
|
'MilkContainerConnected': 'Off',
|
||||||
'SoftwareUpdateAvailable': 'Off',
|
'SoftwareUpdateAvailable': 'Off',
|
||||||
'LeaveProfilesAutomatically': True,
|
'LeaveProfilesAutomatically': True,
|
||||||
'RemoveWaterFilter': 'Off',
|
'RemoveWaterFilter': 'Off',
|
||||||
'OperationState': 'Inactive',
|
'OperationState': 'Inactive',
|
||||||
'BeverageCounterHotMilk': 9,
|
'BeverageCounterHotMilk': 9,
|
||||||
'4362': 0,
|
'4362': 0,
|
||||||
'MilkTubeRemoved': 'Off',
|
'MilkTubeRemoved': 'Off',
|
||||||
'DeviceIsToCold4C': 'Off',
|
'DeviceIsToCold4C': 'Off',
|
||||||
'SystemHasRunDry': 'Off',
|
'SystemHasRunDry': 'Off',
|
||||||
'DeviceShouldBeDescaled': 'Off',
|
'DeviceShouldBeDescaled': 'Off',
|
||||||
'PowerState': 'Standby',
|
'PowerState': 'Standby',
|
||||||
'DeviceShouldBeCleaned': 'Off',
|
'DeviceShouldBeCleaned': 'Off',
|
||||||
'DeviceShouldBeCalcNCleaned': 'Off',
|
'DeviceShouldBeCalcNCleaned': 'Off',
|
||||||
'BeanContainerEmpty': 'Off',
|
'BeanContainerEmpty': 'Off',
|
||||||
'MilkStillOK': 'Off',
|
'MilkStillOK': 'Off',
|
||||||
'CoffeeOutletMissing': 'Off',
|
'CoffeeOutletMissing': 'Off',
|
||||||
'MilkReminder': 'Off',
|
'MilkReminder': 'Off',
|
||||||
'RefillEmptyWaterTank': 'Off',
|
'RefillEmptyWaterTank': 'Off',
|
||||||
'RefillEmptyBeanContainer': 'Off',
|
'RefillEmptyBeanContainer': 'Off',
|
||||||
'UnderOverVoltage': 'Off',
|
'UnderOverVoltage': 'Off',
|
||||||
'NotEnoughPomaceCapacityForThisKindOfBeverage': 'Off',
|
'NotEnoughPomaceCapacityForThisKindOfBeverage': 'Off',
|
||||||
'AdjustGrindSetting': 'Off',
|
'AdjustGrindSetting': 'Off',
|
||||||
'InsertWaterFilter': 'Off',
|
'InsertWaterFilter': 'Off',
|
||||||
'FillDescaler': 'Off',
|
'FillDescaler': 'Off',
|
||||||
'CleanFillWaterTank': 'Off',
|
'CleanFillWaterTank': 'Off',
|
||||||
'PlaceContainerUnderOutlet': 'Off',
|
'PlaceContainerUnderOutlet': 'Off',
|
||||||
'SwitchOffPower30sekBackOn': 'Off',
|
'SwitchOffPower30sekBackOn': 'Off',
|
||||||
'ThrowCleaningDiscInTheDrawer': 'Off',
|
'ThrowCleaningDiscInTheDrawer': 'Off',
|
||||||
'RemoveMilkContainer': 'Off',
|
'RemoveMilkContainer': 'Off',
|
||||||
'RemoveContainerUnderOutlet': 'Off',
|
'RemoveContainerUnderOutlet': 'Off',
|
||||||
'MilkContainerRemoved': 'Off',
|
'MilkContainerRemoved': 'Off',
|
||||||
'ServiceProgramFinished': 'Off',
|
'ServiceProgramFinished': 'Off',
|
||||||
'DeviceDescalingOverdue': 'Off',
|
'DeviceDescalingOverdue': 'Off',
|
||||||
'DeviceDescalingBlockage': 'Off',
|
'DeviceDescalingBlockage': 'Off',
|
||||||
'CustomerServiceConnectionAllowed': False,
|
'CustomerServiceConnectionAllowed': False,
|
||||||
'BeverageCountdownCleaning': 38,
|
'BeverageCountdownCleaning': 38,
|
||||||
'ProcessPhase': 'None'
|
'ProcessPhase': 'None'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
</details>
|
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## FRIDA tools
|
## FRIDA tools
|
||||||
|
|
||||||
|
|||||||
41
hc-login
41
hc-login
@@ -4,7 +4,7 @@
|
|||||||
# A really nice walk through of how it works is:
|
# A really nice walk through of how it works is:
|
||||||
# https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow-with-pkce
|
# https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow-with-pkce
|
||||||
import requests
|
import requests
|
||||||
from urllib.parse import urlparse, parse_qs, urlencode
|
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
||||||
from lxml import html
|
from lxml import html
|
||||||
import io
|
import io
|
||||||
import re
|
import re
|
||||||
@@ -13,6 +13,7 @@ import json
|
|||||||
from time import time
|
from time import time
|
||||||
from base64 import b64decode as base64_decode
|
from base64 import b64decode as base64_decode
|
||||||
from base64 import urlsafe_b64encode as base64url_encode
|
from base64 import urlsafe_b64encode as base64url_encode
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
from Crypto.Random import get_random_bytes
|
from Crypto.Random import get_random_bytes
|
||||||
from Crypto.Hash import SHA256
|
from Crypto.Hash import SHA256
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
@@ -124,44 +125,40 @@ while True:
|
|||||||
r = session.get(preauth_url, allow_redirects=False)
|
r = session.get(preauth_url, allow_redirects=False)
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
break
|
break
|
||||||
if r.status_code == 302 or r.status_code == 301:
|
if r.status_code > 300 and r.status_code < 400:
|
||||||
preauth_url = r.headers["location"]
|
preauth_url = r.headers["location"]
|
||||||
|
# Make relative locations absolute
|
||||||
|
if not bool(urlparse(preauth_url).netloc):
|
||||||
|
preauth_url = singlekey_host + preauth_url
|
||||||
continue
|
continue
|
||||||
print(f"2: {preauth_url=}: failed to fetch {r} {r.text}", file=sys.stderr)
|
print(f"2: {preauth_url=}: failed to fetch {r} {r.text}", file=sys.stderr)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
# get the ReturnUrl from the response
|
# get the ReturnUrl from the response
|
||||||
query = parse_qs(urlparse(preauth_url).query)
|
query = parse_qs(urlparse(preauth_url).query)
|
||||||
return_url = query["ReturnUrl"][0]
|
return_url = query["returnUrl"][0]
|
||||||
debug(f"{return_url=}")
|
debug(f"{return_url=}")
|
||||||
|
|
||||||
headers["RequestVerificationToken"] = r.cookies["X-CSRF-FORM-TOKEN"]
|
if "X-CSRF-FORM-TOKEN" in r.cookies:
|
||||||
|
headers["RequestVerificationToken"] = r.cookies["X-CSRF-FORM-TOKEN"]
|
||||||
session.headers.update(headers)
|
session.headers.update(headers)
|
||||||
|
|
||||||
debug("--------")
|
debug("--------")
|
||||||
|
|
||||||
valid_url = singlekey_host + '/auth/api/v1/authentication/UserExists'
|
soup = BeautifulSoup(r.text, 'html.parser')
|
||||||
auth_url = singlekey_host + '/auth/api/v1/authentication/login'
|
requestVerificationToken = soup.find('input', {'name': '__RequestVerificationToken'}).get('value')
|
||||||
|
r = session.post(preauth_url, data={"UserIdentifierInput.EmailInput.StringValue": email, "__RequestVerificationToken": requestVerificationToken }, allow_redirects=False)
|
||||||
|
|
||||||
r = session.post(valid_url, json={"username": email})
|
password_url = r.headers['location']
|
||||||
debug(f"{valid_url=}: {r} {r.text}")
|
if not bool(urlparse(password_url).netloc):
|
||||||
|
password_url = singlekey_host + password_url
|
||||||
|
|
||||||
|
r = session.get(password_url, allow_redirects=False)
|
||||||
|
soup = BeautifulSoup(r.text, 'html.parser')
|
||||||
|
requestVerificationToken = soup.find('input', {'name': '__RequestVerificationToken'}).get('value')
|
||||||
|
|
||||||
login_fields = {
|
r = session.post(password_url, data={"Password": password, "RememberMe": "false", "__RequestVerificationToken": requestVerificationToken }, allow_redirects=False)
|
||||||
"username": email,
|
|
||||||
"password": password,
|
|
||||||
"keepMeSignedIn": False,
|
|
||||||
"returnUrl": return_url,
|
|
||||||
}
|
|
||||||
|
|
||||||
r = session.post(auth_url, json=login_fields, allow_redirects=False)
|
|
||||||
|
|
||||||
if r.status_code != 200:
|
|
||||||
debug(f"auth failed: {auth_url=}, {login_fields=} {r} {r.text}")
|
|
||||||
exit(-1)
|
|
||||||
|
|
||||||
debug(f"{auth_url=}, {r} {r.text}")
|
|
||||||
return_url = json.loads(r.text)["returnUrl"]
|
|
||||||
if return_url.startswith("/"):
|
if return_url.startswith("/"):
|
||||||
return_url = singlekey_host + return_url
|
return_url = singlekey_host + return_url
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
bs4
|
||||||
|
requests
|
||||||
pycryptodome
|
pycryptodome
|
||||||
websocket-client
|
websocket-client
|
||||||
sslpsk
|
sslpsk
|
||||||
|
|||||||
Reference in New Issue
Block a user