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

MQTTThing + Mi Flower Care #149

Open
clipse2004 opened this issue Sep 15, 2019 · 12 comments
Open

MQTTThing + Mi Flower Care #149

clipse2004 opened this issue Sep 15, 2019 · 12 comments

Comments

@clipse2004
Copy link

Hi Guys,
I use this plugin to get some informations from my Mi Flower Care to my HomeKit, but I have some Problems.
At the moment I get the humidity, battery and Temperatur. What I also need is:


"light" and "conductivity".
And is there a way to show (at homekit) all in 1 „device“?

Thanks!

@tobekas
Copy link
Contributor

tobekas commented Sep 17, 2019

Especially for iOS 13 this would be interesting. With iOS <=12 HomeApp will show one tile per Service(!) even if the belong to the same accessory.

With iOS 13 there will be one tile per Accessory. If an accessory held multiple services (e.g. TemperatureSensor, HumiditySensor, LightSensor) they will be grouped.

At the moment all "types" (=possible [combinations of] services and their characteristics) are defined by this MqttThing-Plugin. It would be great, if it was possible to offer kind of a „custom type“ accessory, where you can freely choose/mix multiple services. As a first step maybe only for a "custom sensor accessory" with just read-Characteristics. As a second step for completely free combinations. This would also be great for experimenting...

@tobekas
Copy link
Contributor

tobekas commented Sep 17, 2019

See also #144

@clipse2004
Copy link
Author

I already use iOS 13 and there is no custom accessory :/

@tobekas
Copy link
Contributor

tobekas commented Sep 17, 2019

There are no custom (service/characteristic) types, which will be shown within Apples Home App, right. (Different in Eve App, where custom characteristics are shown.) But for HomeKit default services, they will be grouped.
For example if you use weatherStation, with Temp and Humidity services, they will be grouped in iOS13 whereas two separate tiles appear in iOS12.

@arachnetech
Copy link
Owner

Interesting idea, and shouldn’t be too hard to do. I’ll have a look at your ‘custom sensor’ idea when I get a chance. It shouldn’t be too hard using the existing topics etc.

@clipse2004
Copy link
Author

But how can i do a sensor for "light" and "conductivity"? (for Mi Flower)?

regards

@bubez81
Copy link

bubez81 commented Jul 19, 2020

hello, there are news about this accessory? conductivity is not supported in home app but light is, it's a possibility to create an accessory with humidity, temperature and light sensor?

@arachnetech
Copy link
Owner

Yes, you should be able to configure that now.

Can you share example MQTT messages for the properties?

@bubez81
Copy link

bubez81 commented Jul 20, 2020

this is my solution for now:
{ "accessory": "mqttthing", "type": "weatherStation", "name": "Limone", "serviceNames": { "temperature": "Temperatura Limone", "humidity": "Umidità del Terreno Limone" }, "url": "mqtt://xxxxx", "username": "xxxxx", "password": "xxxxx", "topics": { "getCurrentTemperature": { "topic": "miflora/Limone", "apply": "return JSON.parse(message).temperature;" }, "getCurrentRelativeHumidity": { "topic": "miflora/Limone", "apply": "return JSON.parse(message).moisture;" }, "getStatusLowBattery": { "topic": "miflora/Limone", "apply": "return JSON.parse(message).battery;" } }, "history": "true" },

but so I can't insert the brightness

@bubez81
Copy link

bubez81 commented Jul 20, 2020

Yes, you should be able to configure that now.

Can you share example MQTT messages for the properties?

sure!

{"light": 14, "temperature": 26.5, "moisture": 39, "conductivity": 135, "battery": 100}

@arachnetech
Copy link
Owner

arachnetech commented Jul 20, 2020

Here's a configuration for humidity, temperature and light sensors:

        {
            "accessory": "mqttthing",
            "type": "custom",
            "name": "Flower Care",
            "url": "homebridge",
            "logMqtt": true,
            "codec": "json",
            "jsonCodec": {
                "properties": {
                    "currentRelativeHumidity": "moisture",
                    "currentTemperature": "temperature",
                    "currentAmbientLightLevel": "light",
                    "statusLowBattery": "battery"
                }
            },
            "services": [
                {
                    "type": "humiditySensor",
                    "topics": {
                        "getCurrentRelativeHumidity": "miflora/Limone",
                        "getStatusLowBattery": { "topic": "miflora/Limone", "apply": "return message < 20;" }
                    }
                }, 
                {
                    "type": "temperatureSensor",
                    "topics": {
                        "getCurrentTemperature": "miflora/Limone",
                        "getStatusLowBattery": { "topic": "miflora/Limone", "apply": "return message < 20;" }
                    }
                },
                {
                    "type": "lightSensor",
                    "topics": {
                        "getCurrentAmbientLightLevel": "miflora/Limone",
                        "getStatusLowBattery": { "topic": "miflora/Limone", "apply": "return message < 20;" }
                    }
                }
            ]
        },

Uses grouped (custom) accessories and the JSON codec.

@bubez81
Copy link

bubez81 commented Jul 21, 2020

wow thank you works great, only one thing, there is a possibility to add "history": "true",?

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

No branches or pull requests

4 participants