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

Cannot change switch to on/off - on Sonoff minir3 from DIY mode. How to change the switch? #123

Open
IurieGaitur opened this issue Mar 15, 2022 · 1 comment

Comments

@IurieGaitur
Copy link

IurieGaitur commented Mar 15, 2022

Bought recently a Sonoff minir3. Did the configuration, found out that in order to get info, the deviceid should not be sent as it would return status 422.
So without it - on the info call /zeroconf/info with

{ 
	"data": {
    } 
 }

device returns multiple switches which is strange, should be only one :?.
Response:

{
    "seq": 15,
    "error": 0,
    "data": {
        "switches": [
            {
                "switch": "off",
                "outlet": 0
            },
            {
                "switch": "off",
                "outlet": 1
            },
            {
                "switch": "off",
                "outlet": 2
            },
            {
                "switch": "off",
                "outlet": 3
            }
        ],
        "configure": [
            {
                "startup": "off",
                "outlet": 0
            },
            {
                "startup": "off",
                "outlet": 1
            },
            {
                "startup": "off",
                "outlet": 2
            },
            {
                "startup": "off",
                "outlet": 3
            }
        ],
        "pulses": [
            {
                "pulse": "off",
                "switch": "on",
                "outlet": 0,
                "width": 0
            },
            {
                "pulse": "off",
                "switch": "on",
                "outlet": 1,
                "width": 0
            },
            {
                "pulse": "off",
                "switch": "on",
                "outlet": 2,
                "width": 0
            },
            {
                "pulse": "off",
                "switch": "on",
                "outlet": 3,
                "width": 0
            }
        ],
        "sledOnline": "on",
        "fwVersion": "1.2.0",
        "rssi": -62,
        "bssid": "ac:22:5:56:63:bd"
    }
}

When I want to to on, using zeroconf/switch .

{ 
	"data": {
        "switch": "on"
    } 
 }

It returns

{
    "seq": 16,
    "error": 400
}

Any ideas how I can switch on/off the switch? at least the first one

@oeildefeu
Copy link

Hello,
The answer is here: https://sonoff.tech/sonoff-diy-developer-documentation-minir3-http-api/

So you have to use such curl line for instance:
curl -v -d '{"deviceid":"XXXXXXXX","data":{"switches": [{ "switch": "on", "outlet": 0 },{"switch": "off", "outlet": 1 },{ "switch": "off", "outlet": 2 },{ "switch": "off", "outlet": 3 }]}}' POST http://192.168.0.XX:8081/zeroconf/switches

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

2 participants