Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Drying machine #5

Closed
rogodra opened this issue Sep 1, 2021 · 12 comments
Closed

Drying machine #5

rogodra opened this issue Sep 1, 2021 · 12 comments

Comments

@rogodra
Copy link
Contributor

rogodra commented Sep 1, 2021

Hello,

I have a Candy Simply-fi dryer, but the integration fails.: "Error communicating with API: KeyError('statusLavatrice')"

The start of the chain is different, change statusLavatrice to statusTD. As well as other parameters, I can collaborate with tests.

I attach the extracted data with ./simplyfi IP KEY read

{
"statusTD":
{
"StatoWiFi":"1",
"StatoTD":"1",
"CodiceErrore":"0",
"Pr":"1",
"PrPh":"0",
"RemTime":"150",
"DryLev":"2",
"Time":"0",
"Rapido":"0",
"Opt1":"1",
"Opt2":"1",
"Opt3":"0",
"Opt4":"0",
"Opt5":"0",
"Opt6":"0",
"Opt7":"0",
"Opt8":"0",
"Refresh":"0",
"CleanFilter":"0",
"WaterTankFull":"0",
"DryingManagerLevel":"1",
"DelVal":"0",
"DoorState":"1",
"RecipeId":"NULL",
"CheckUpState":"0"
}
}

Thanks!

@ofalvai
Copy link
Owner

ofalvai commented Sep 4, 2021

Hey @rogodra, I added basic support for dryers in #8, based on the API response you posted. I was only able to test this in unit tests, so please upgrade to the latest version in HACS and let me know how it works.

Also, I don't really know what the different number values mean in the response, so feel free to open a PR with better parsing if you know more about each value. You can see the current parsing here: https://github.com/ofalvai/home-assistant-candy/blob/main/custom_components/candy/client/model.py#L120

@thorin8k
Copy link
Contributor

thorin8k commented Sep 5, 2021

Hi, thanks for your work! This integration saved me a lot of time.

I've recently bought a tumble dryer and added it to ha with the latest version without problem. I will keep testing it trying to identify those values. If I get something I'll try to create a PR.

@thorin8k
Copy link
Contributor

Hi, I've found a couple of missing parameters and have them working on my local installation. I will add them to a PR but its my first home assistant custom_component coding so i need a hand.

How can i run the tests? Is it neccesary to install the full dev env of home assistant or can i install some dependencies and run them?

I've found a couple of templates that install a requirements.txt in order to test but i dont see the same structure here.

Thanks and sorry if im asking something stupid 😅

@ofalvai
Copy link
Owner

ofalvai commented Sep 16, 2021

@thorin8k if you only want to run the unit tests, you need to install some packages from requirements_test.txt and run pytest. This is how the CI job sets up the environment and runs tests: https://github.com/ofalvai/home-assistant-candy/blob/main/.github/workflows/test.yml#L18

If you want to load the whole component into Home Assistant though, then the best idea is to set up the full dev env.

@ofalvai
Copy link
Owner

ofalvai commented Oct 13, 2021

FYI @terminet85 extended the tumble dryer support in #22.

I'll keep this issue open for further discussion and improvements.

@thorin8k
Copy link
Contributor

Thanks! i was working on very similar things so i will merge those changes and see if something can be reused.

@terminet85
Copy link
Contributor

terminet85 commented Oct 15, 2021

I cannot full understand meaning of DryingManagerLevel and DryLev.
I've checked that DryingManagerLevel keep increasing when tumble dryer reach step-by-step dry levels. (So I've called it Dry level now), but dry_level have a strange behavior... it keeps increasing by unit each time.

Do you have more knowledge about it, @thorin8k ?

I keep to test and investigate...

Dry levels

  1. Ironing
  2. Dry no iron
  3. Dry closet
  4. Extra dry

@thorin8k
Copy link
Contributor

I am trying to identify the same. I keep testing while using the dryer but i think i will try to open the apk and see if there is something that can guide us.

I'll keep you posted if i find something.

@thorin8k
Copy link
Contributor

I've just created a PR with some little improvements i've been testing at home (#29).

I'm still searching in the simply-fi app code but i think the DryLevel works as folowing:

  • DryingManagerLevel: dry level of the current run
  • DryLev: target dry level of the current run

It's a theory because i wasn't able to test it. In the PR i have created a specific sensor to track DryingManagerLevel so i will trace the value changes of it and see.

Let me know if you want me to send you the simply-fi app decompiled code. (its a little mess but understandable)

@ofalvai
Copy link
Owner

ofalvai commented Oct 17, 2021

Thanks @thorin8k for the improvements! I'll leave the PR open while you test the changes in practice, let me know about the results!

@terminet85
Copy link
Contributor

Thanks for your effort, but doesn't sounds so good. I'm expect that DryingManagerLevel and DryLev are at the same number when cycle is finished. But it isn't.

DryingManagerLevel is always +1 from DryLev... and I dunno why.

Will be better to wait further investigations prior to make a PR with a new sensor... my two cents

@terminet85
Copy link
Contributor

Keep some reverse. Looking apk:

.method public static dryingLevelFromALC(Ljava/lang/String;)I
    .locals 5

    const-string v0, ""

    const-string v1, "IRON"

    const-string v2, "HANG"

    const-string v3, "STORE"

    const-string v4, "BONE"

    .line 839
    filled-new-array {v0, v1, v2, v3, v4}, [Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    move v2, v1

    :goto_0
    const/4 v3, 0x5

    if-ge v1, v3, :cond_1

    .line 842
    aget-object v3, v0, v1

    .line 843
    invoke-virtual {v3, p0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    return v2

    :cond_0
    add-int/lit8 v2, v2, 0x1

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    const/4 p0, -0x1

    return p0
.end method

.method public static final dryingLevels()[Ljava/lang/String;
    .locals 5

    const-string v0, "TD_DRY_LEVEL_NONE"

    const-string v1, "TD_DRY_LEVEL_IRON_DRY"

    const-string v2, "TD_DRY_LEVEL_HANG_DRY"

    const-string v3, "TD_DRY_LEVEL_STORE_DRY"

    const-string v4, "TD_DRY_LEVEL_BONE_DRY"

    .line 828
    filled-new-array {v0, v1, v2, v3, v4}, [Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

So is correct. DryLev keeps the selected dry program and can be from 1 to 4.

Repository owner locked and limited conversation to collaborators Nov 22, 2021
@ofalvai ofalvai closed this as completed Nov 22, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants