Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for posting to appliance #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Allow for posting to appliance #26

wants to merge 2 commits into from

Conversation

Skons
Copy link

@Skons Skons commented Jul 7, 2023

This update allows to change settings at the appliance. My main goal was to set the time, and that seems to be working. I have seen mixed results on switching the appliance on or off, sometimes error 516 will show up. I haven't figured out what that error is yet. For now it has a basic implementation of being able to send information to the appliance.

See the README for information how to send messages to an appliance.

I also updated the logging to see which message belongs to which appliance.

This PR integrates #25 and #19. It solves issue #17 and #3

@JW5PX
Copy link

JW5PX commented Aug 11, 2023

Very nice!! Thank you for this

@nebkrid
Copy link

nebkrid commented Aug 19, 2023

Did you figured out how to actually start a program? (e.g. dishwasher, but I guess it will be similar to other) I can turn it on and successfully tried some other features, which have explicit write access according to the config.json. But I have no idea where to get the structure of the json data for even only starting the pre-set program. Already tried to post to '/ro/activeProgram' but always getting a "400 Bad Request response", no matter which combination even with options I tried.

PS: I already have done some work using your PR as base branch to implement the Homie-MQTT protocoll for auto-detection in e.g. smart-home environments. Is it better to make a PR to your branch or directly into the main of this repository?

@Skons
Copy link
Author

Skons commented Aug 19, 2023

No i did not, but as said it is very alpha. i could look into that, but i need to bring my android phone back to live to see how the home connect app does that stuff.

You could best bring a PR to my branch. I doubt if @osresearch is looking into these PR's... The development is not very active.

@chris-mc1
Copy link

The json data for /ro/activeProgram should looks like this:
[{"program":8196, "options":[{"uid":558,"value":0},{"uid":5123,"value":false},{"uid":5126,"value":false},{"uid":5127,"value":false}]}]
Don’t know if the options need to be set beforehand.

@nebkrid
Copy link

nebkrid commented Aug 20, 2023

Thank you both! "program" was the missing keyword!
I created the PR to @Skons branch

@DimiPaparas
Copy link

Is there any documentation regarding what resource values exist when making requests and general information regarding the structure of the data variable?

I assume that there isn't any... If that's the case, what would be a good way to intercept and decode the packets without needing to root an android phone?

As a side note, I'd be interested in hidden features. I have a fridge/freezer and I would like to monitor the temperature inside. However, that doesn't seem to be part of ro/allMandatoryValues. It is a pity that they didn't include it. I'm wondering if some debug style output would include it. Alas...

@Skons
Copy link
Author

Skons commented Sep 1, 2023

First. There is documentation on how to use the cloud api, which seems to be very similar to the api exposed by the devices:
https://api-docs.home-connect.com/settings/#temperature-unit
I think it can be used as some sort of reference, but not as a guidance.

Second. If your device has got key and iv in the config.json, the traffic is encrypted by the client. If this is case, you can capture the traffic with a router that can have wireshark, tcpdump or whatever tool that can create a pcap from the traffic. I once had a script that could decrypt the a pcap based on the config.json, but i have lost that. I am planning on recreating that script. If capturing the traffic is not possible, or you've only have got the value key in your config.json, then your best bet is an android emulator. But, to do that, you will need a device with an arm processor. Home connect does not have, the last time i checked at least, an x86 compiled app. It is not possible to emulate arm software on a x86 processor.

@DimiPaparas
Copy link

@Skons thanks a lot for the advice. I'll try to use wireshark to get an insight into what's going on.

I was considering contacting the BSH Group, but I don't think they would disclose that information. Even their API is free but not open source.

I tried reverse engineering the local network HTTP communication using their cloud API as a blueprint but it's not one to one. The mismatch between the two is very significant.

@chris-mc1
Copy link

A list of possible resource values is here: https://github.com/osresearch/hcpy/blob/main/HCDevice.py.
Don’t know if it is complete or what most of them do.

For /ro/values the data variable is something like [{"uid":558,"value":0},{"uid":5123,"value":false}]
For the datatype of the "value" field, lookup the "refCID" values from the config.json in the CID list here: https://www.home-connect.com/schemas/DeviceDescription/20140417/HC_INT_BSH_CTD.xml

@ericblade
Copy link
Contributor

ericblade commented Dec 2, 2023

re: emulators and all that

of course, Windows 11 can just run Android apps (through the magic of emulators and all that, but it's all concealed from the user), so that's an interesting tool.

Just got a Home Connect Dishwasher, and discovered that IFTTT has been completely neutered, so I'm going to have to build something myself. I guess this means I become active on this project :-) Either that or I setup a proper HomeAssistant and/or Node-RED .. but this seems like the best option. I intend to write an app that will keep track of the state of the dishwasher, and notify people that it's done with what it's doing. And have it get progressively more annoying the longer it goes without someone unloading it. :-)

but I'd also like to implement control capability as well, because why not?

so.. here I am :-)

If there's anything I can do to help reverse the protocol, I'd be happy to load it up on one of my win11 machines and mess with it. Just let me know what needs to happen


if 'min' in feature:
min = int(feature['min'])
max = int(feature['min'])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 'max'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants