MacWyznawca / homebridge-mqtt-switch-tasmota

Plugin to HomeBridge optimized to work with firmware Sonoff-Tasmota, MQTT.
MIT License
57 stars 18 forks source link

More then one Sonoff device #38

Open KBlobner opened 6 years ago

KBlobner commented 6 years ago

How does the config.json file look like with more then one son off device?

I thought something like this:

"accessories": [{ "accessory": "mqtt-switch-tasmota", "switchType": "outlet",

        "name": "Sonoff S20",

        "url": "mqtt://",
        "username": "Sonoff S20",
        "password": "",

        "topics": {
            "statusGet": "stat/sonoff/RESULT",
            "statusSet": "cmnd/sonoff/POWER",
            "stateGet": "tele/sonoff/STATE"
        },
        "onValue": "ON",
        "offValue": "OFF",

        "activityTopic": "tele/sonoff/LWT",
        "activityParameter": "Online",

        "startCmd": "cmnd/sonoff/TelePeriod",
        "startParameter": "60",

        "manufacturer": "ITEAD",
        "model": "Sonoff",
        "serialNumberMAC": ""
    },
    {
        "accessory": "mqtt-switch-tasmota",
        "switchType": "",

        "name": "Sonoff Basic",

        "url": "mqtt://",
        "username": "Sonoff Basic",
        "password": "",

        "topics": {
            "statusGet": "stat/sonoff/RESULT",
            "statusSet": "cmnd/sonoff/POWER",
            "stateGet": "tele/sonoff/STATE"
        },
        "onValue": "ON",
        "offValue": "OFF",

        "activityTopic": "tele/sonoff/LWT",
        "activityParameter": "Online",

        "startCmd": "cmnd/sonoff/TelePeriod",
        "startParameter": "60",

        "manufacturer": "ITEAD",
        "model": "Sonoff",
        "serialNumberMAC": ""
    }
],

Both devices show up but i can not switch them one by one, just both at the same time

Edit:

I am using mosquitto and homebridge on a Mac mini

andyfitter commented 6 years ago

They both have the same topic so will act together.

deon-wentzel commented 6 years ago

"statusGet": "stat/sonoff/RESULT"

for each device the "sonoff" needs to be a unique name i.e. sonoff-1 and or sonoff-2, so replace all the sonoff in the first section with sonoff-1 and the 2nd section replace all the sonoff with sonoff-2. Also make sure that you change the sonoff to sonoff-1 or sonoff-2 on each device. If you using the WEB GUI select Configure MQTT and change "Topic = %topic% (sonoff)" to match you config.json