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

Add support for Sprinklers, Faucets, Doorbell, Security, etc... #179

Open
TheReiner opened this issue Feb 19, 2019 · 4 comments
Open

Add support for Sprinklers, Faucets, Doorbell, Security, etc... #179

TheReiner opened this issue Feb 19, 2019 · 4 comments

Comments

@TheReiner
Copy link

Maybe we can simplify by determining in the JSON configuration the type of switch ?

Sample...

"platforms": [
    {
        "platform": "eDomoticz",
        "name": "eDomoticz",
        "server": "127.0.0.1",
        "port": "8080",
        "ssl": 0,
        "roomid": 0,
        "mqtt": 1,
        "excludedDevices": [],  
 
       "doorbellDevices": [],
       "faucetDevices": ["idxDevice1", "idxDevice2"],
       "sprinklersDevices": ["idxDevice3", "idxDevice4"]


    }
@RienduPre
Copy link

+1

1 similar comment
@superjunky
Copy link

+1

@ronzelver
Copy link

+1 I would like to be able to do this as well. I saw in the code that for MQTT there is some device type handling depending on the selected image in Domoticz.

@superjunky
Copy link

You can use the Homebridge plugin "MQTTthing" for those device types. Check the example config for use with Domoticz devices;

"accessories": [
        {
            "accessory": "mqttthing",
            "type": "valve",
            "valveType": "sprinkler",
            "name": "Garden Sprinkler",
            "topics": {
                "setActive": {
                    "topic": "domoticz/in",
                    "apply": "return JSON.stringify({command: 'switchlight', idx: 1234, switchcmd: message})"
                },
                "getActive": {
                    "topic": "domoticz/out/mqtt/MQTTthing",
                    "apply": "return JSON.parse(message).idx == 1234 ? JSON.parse(message).nvalue > 0 ? 'On' : 'Off' : ''"
                },
                "getInUse": {
                    "topic": "domoticz/out/mqtt/MQTTthing",
                    "apply": "return JSON.parse(message).idx == 1234 ? JSON.parse(message).nvalue > 0 ? 'On' : 'Off' : ''"
                },
                "getStatusActive": {
                    "topic": "domoticz/out/mqtt/MQTTthing",
                    "apply": "return JSON.parse(message).idx == 1234 ? JSON.parse(message).nvalue > 0 ? 'On' : 'Off' : ''"
                }
            },
            "startPub": [
                {
                    "topic": "domoticz/in",
                    "message": "{\"command\": \"getdeviceinfo\", \"idx\": 1234 }"
                }
            ],
            "integerValue": "true",
            "onValue": "On",
            "offValue": "Off",
            "durationTimer": true,
            "manufacturer": "Superjunky",
            "model": "Garden Sprinkler",
            "serialNumber": "Sprinkler 1.0"
        },
        {
            "accessory": "mqttthing",
            "type": "securitySystem",
            "name": "Home Security",
            "topics": {
                "setTargetState": {
                    "topic": "domoticz/in",
                    "apply": "return JSON.stringify({command: 'switchlight', idx: 9876, switchcmd: 'Set Level', level: message})"
                },
                "getTargetState": {
                    "topic": "domoticz/out/mqtt/MQTTthing",
                    "apply": "return JSON.parse(message).idx == 9876 ? JSON.parse(message).svalue1 : ''"
                },
                "getCurrentState": {
                    "topic": "domoticz/out/mqtt/MQTTthing",
                    "apply": "return JSON.parse(message).idx == 9876 ? JSON.parse(message).svalue1 : ''"
                }
            },
            "targetStateValues": [
                "10",
                "20",
                "30",
                "0"
            ],
            "currentStateValues": [
                "10",
                "20",
                "30",
                "0",
                "40"
            ],
            "restrictTargetState": [
                1,
                2,
                3
            ],
            "startPub": [
                {
                    "topic": "domoticz/in",
                    "message": "{\"command\": \"getdeviceinfo\", \"idx\": 9876 }"
                }
            ],
            "manufacturer": "Superjunky",
            "model": "ProGuard800",
            "serialNumber": "Alarm 1.0"
        }
]

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