arachnetech / homebridge-mqttthing

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

need help getting state of zigbee2mqtt outlet #558

Open bosu1787 opened 2 years ago

bosu1787 commented 2 years ago

need help to get state of zigbee2mqtt outlet the plugin z2m dosent have outlets so thats why i wana use mqtthing.

Tonitom commented 2 years ago

Hi, I have the same question.

Here is my configuration. { "type": "outlet", "name": "Filament", "url": "mqtt://ccu3:1883", "topics": { "getInUse": "zigbee2mqtt/Druckerraum.Steckdose Filament/", "getOn": "zigbee2mqtt/Druckerraum.Steckdose Filament/get/", "setOn": "zigbee2mqtt/Druckerraum.Steckdose Filament/set/" }, "onValue": "ON", "offValue": "OFF", "accessory": "mqttthing" }

Tonitom commented 2 years ago

got it

{ "type": "outlet", "name": "Filament", "url": "mqtt://ccu3:1883", "topics": { "getInUse": { "topic": "zigbee2mqtt/Druckerraum.Steckdose Filament", "apply": "return JSON.parse(message).state" }, "getOn": { "topic": "zigbee2mqtt/Druckerraum.Steckdose Filament", "apply": "return JSON.parse(message).state" }, "setOn": "zigbee2mqtt/Druckerraum.Steckdose Filament/set" }, "onValue": "ON", "offValue": "OFF", "accessory": "mqttthing" },

bosu1787 commented 2 years ago

i used this:

    {
        "type": "outlet",
        "name": "Priza Raul Birou",
        "topics": {
            "getOn": "zigbee2mqtt/Prize Birou Raul$.state",
            "setOn": "zigbee2mqtt/Prize Birou Raul/set"
        },
        "onValue": "ON",
        "offValue": "OFF",
        "accessory": "mqttthing"
    },