merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
364 stars 62 forks source link

Air Fryer #519

Closed Tototimus closed 7 months ago

Tototimus commented 10 months ago

Good morning, I have some configuration problem, I did not find a solution either on the guides. I configured my Air Fryer (careli.fryer.maf05a) in custom but I don't have the desired display..

"actionButtons": [
                        {
                            "action": "air-fryer:start-cook",
                            "name": "Start",
                            "params": [
                                "air-fryer:start-cook"
                            ]
                        },
                        {
                            "action": "air-fryer:cancel-cooking",
                            "name": "Stop",
                            "params": [
                                "air-fryer:cancel-cooking"
                            ]
                        }
                    ],
                    "propertyControl": [
                        {
                            "property": "air-fryer:target-time",
                            "name": "Temps"
                        },
                        {
                            "property": "air-fryer:target-temperature",
                            "name": "Temperature"
                        }
                    ]
merdok commented 10 months ago

Hi,

custom accessory will always use generic controls as i cannot know in advance what the user actually wants and accessories like heatercooler require extra configuration which would be hard to do with propertyControl The same goes for the targe time, in homekit the best way to display a timer is unfortunately a lightbulb...

As for recipes, you need to create actions for every recipe which you would like to start, there is probably a dedicated action which starts a recipe with the name as parameter.

Tototimus commented 10 months ago

Hi, thank you for your reply ! It's strange because when I leave the default configuration the temperature setting is in heatercooler unlike in custom where it goes to bulb. What would be the way to arrange to get it in heatercooler format?

Ok for the time I understand I don't see how it could be done via homekit which does not provide any solution for entering data

Do you have any idea how to pass it as a parameter?

merdok commented 10 months ago

You will not be able to do a heatercooler with propertyControl as, like i already mentioned, this is a complex accessory and requires a lot of manual adjustments in code to work.

You have to specify the params for your action in the actionButtons. It should be either a list in the same order as the parameters are specified in the miot spec, or a key value map, where the key is the param id. You have to look at the "In (piid)" column in the miot spec to see what parameters can be passed to the action. The numbers represent property id's which are located on the same service id as the action. So you have to look in the properties to see what params those are.