home-assistant-candy icon indicating copy to clipboard operation
home-assistant-candy copied to clipboard

Washing machine state isn't universal

Open terminet85 opened this issue 3 years ago • 3 comments

I noticed that MachineState isn't applicable for each Machine. I got an state 6 that is a self-test in Tumble Dryer. Will be better create a class and extend it for each machine I guess.

{
        "statusTD":
{"StatoWiFi":"1",
                "StatoTD":"6",
                "CodiceErrore":"0",
                "Pr":"1",
                "PrPh":"2",
                "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":"2",
                "DelVal":"0",
                "DoorState":"1",
                "RecipeId":"NULL",
                "CheckUpState":"1"
        }
}
class MachineState(Enum):
    IDLE = 1
    RUNNING = 2
    PAUSED = 3
    DELAYED_START_SELECTION = 4
    DELAYED_START_PROGRAMMED = 5
    ERROR = 6
    FINISHED1 = 7
    FINISHED2 = 8

terminet85 avatar Oct 26 '21 09:10 terminet85

Yes, MachineState was initially the washing machine state only, but as we added more appliance types some of them reused MachineState. Some appliances have their own state enum in model.py (ovens for example), so if tumble dryers need their own state enum, I'm more than happy to fix this if you send me the list of values and their meaning.

ofalvai avatar Oct 29 '21 14:10 ofalvai

hello, for the washing machine it would be useful to have a binary sensor that indicates the status of the door, open or closed. it's possible? Thank you.

TheBisk avatar Nov 08 '21 15:11 TheBisk

@TheBisk does your washing machine expose this information in the API? My washing machine doesn't have this information in the response, but based on contributions from others, dishwashers and tumble dryers expose this.

ofalvai avatar Nov 08 '21 19:11 ofalvai