merdok / homebridge-miot

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

Question: How does the "New 'contains' value operator" work? #556

Closed CooperCGN closed 6 months ago

CooperCGN commented 6 months ago

This is actually what I am looking for but how I actually set this up in my config.json?

For example I want to check towards different values for the status of my vacuum. For a single value my entry would look like this:

"propertyMonitor": [
                {
                    "property": "vacuum:status",
                    "name": "Paused",
                    "value": 10,
                    "valueOperator": "equal"
                }
            ]

How do I set up the values parameter?

merdok commented 6 months ago

You have to specify an array (list) as value. Something like that:

"propertyMonitor": [
                {
                    "property": "vacuum:status",
                    "name": "Paused",
                    "value": [10,11,12,13,14],
                    "valueOperator": "contains"
                }
            ]

Any of those values specified in the array will then trigger the given property.

CooperCGN commented 6 months ago

Thank you, but is it equal or contains as operator?

merdok commented 6 months ago

As in my example and the documentation contains

CooperCGN commented 6 months ago

Thank you, awesome. That feature is reducing my automations a lot.