arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
468 stars 103 forks source link

GetWatts for lights #492

Open bmpalmeida opened 3 years ago

bmpalmeida commented 3 years ago

I have a bunch of Shelly devices that control lights and expose the power consumption via the eve app. Will be possible to add the power consumption to the lights via mqtt?

FermedePommerieux commented 3 years ago
    {
        "accessory": "mqttthing",
        "type": "lightSensor",
        "name": "power consumption",
        "url": "url",
        "username": "username",
        "password": "password",
        "topics": {
            "getCurrentAmbientLightLevel": {
                "topic": "shellies/shellyXXX-XXX/relay/0/power",
                "apply": "if (message < 0.0001) message = 0.0001; return message;"
            },
            "getStatusActive": "shellies/shellyXXX-XXX/relay/0"
        },
        "integerValue": false,
        "onlineValue": "true"
    },
rbswift commented 2 years ago

only these characteristics are supported by Apple:

https://developer.apple.com/documentation/homekit/hmcharacteristic/characteristic_types