ericmagnuson / rmcontrol

RM Control — A python app to control an RM2 from BroadLink.
MIT License
34 stars 5 forks source link

config error #3

Closed preamptive closed 7 years ago

preamptive commented 7 years ago

I seem to be doing something wrong in the config file.

It seems to keep throwing an error any chance you could point out where I'm going wrong?

thanks in advance

"accessories": [{ "accessory": "HttpMulti", "name": "Light", "on_url": "http://127.0.0.1:5000/POST /commands/living%20room%20lights%20on HTTP/1.1", "off_url": "http://127.0.0.1:5000/POST /commands/living%20room%20lights%20off HTTP/1.1", "status_url": "http://127.0.0.1:5000/status%28light%29", "deviceType": "light" }

ericmagnuson commented 7 years ago

Hey @preamptive! Your on and off URLs are pretty close but need to be tweaked.

Instead, try the following:

"accessories": [{
    "accessory": "HttpMulti",
    "name": "Light",
    "on_url": "http://127.0.0.1:5000/commands/living%20room%20lights%20on",
    "off_url": "http://127.0.0.1:5000/commands/living%20room%20lights%20off",
    "status_url": "http://127.0.0.1:5000/status%28light%29",
    "deviceType": "light"
}

This assumes your on and off commands are named "living room lights on" and "living room lights off", respectively.

ericmagnuson commented 7 years ago

Also, RM Control doesn't have a status endpoint, so you can leave the "status_url" string empty ("").

NightRang3r commented 7 years ago

@preamptive It looks like the URL in your config file is incorrect, you should remove the "POST /commands/living%20room%20lights%20on HTTP/1.1" and insert the URL to the command and specify the method.

like this:

"bridge": {
                "name": "RM Control",
                "username": "CC:22:3D:E3:CE:31",
                "port": "51826",
                "pin": "123-45-678"
        },
        "description": "This is an example configuration file for using Homebridge with RM Control",
        "accessories": [
                {
                        "accessory": "HttpMulti",
                        "name": "TV",
                        "on_url": "http://10.0.0.17:5000/commands/POWERTV",
                        "off_url": "http://10.0.0.17:5000/commands/POWERTV",
                        "deviceType": "switch",
                        "http_method": "POST"
                }
],
    "platforms": []
}
preamptive commented 7 years ago

For some reason i could not get it working with the plugin 'httpmulti 'but found 'switcheroo' worked...

"accessory": "Switcheroo", "switch_type": "Switch", "name": "Light Two", "http_method": "POST", "base_url": "http://127.0.0.1:5000/commands", "on_url": "/light_2_on", "off_url": "/light_2_off"

Thanks for your help! I have everything connected and working so thanks for your help! its a great application! and does just about everything i require, but I have a another issue that i think maybe more difficult to achieve. I will open a separate thread and see if its possible. Thanks again!

ericmagnuson commented 7 years ago

Glad you got it working! Switcheroo may prove to be a better homebridge plugin for this app. We'll have to see if others have problems with homebridge-httpmulti.