mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-16 18:24:36 +00:00
Added settings for strict upnp mode of checking ig it is a request for a
hue or not before responding. Updated Readme
This commit is contained in:
43
README.md
43
README.md
@@ -34,8 +34,51 @@ POST http://host:8080/api/devices
|
||||
"onUrl" : "http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&DeviceNum=41",
|
||||
"offUrl" : "http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=41"
|
||||
}
|
||||
Dimming
|
||||
----
|
||||
Dimming is also supported by using the expessions ${intensity.percent} or ${intensity.byte} for 0-100 and 0-255 respectively.
|
||||
e.g.
|
||||
```
|
||||
{
|
||||
"name": "entry light",
|
||||
"deviceType": "switch",
|
||||
"offUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=31",
|
||||
"onUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&DeviceNum=31&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=${intensity.percent}"
|
||||
}
|
||||
```
|
||||
See the echo's documentation for the dimming phrase.
|
||||
|
||||
POST/PUT support
|
||||
-----
|
||||
added optional fields
|
||||
* contentType (currently un-validated)
|
||||
* httpVerb (POST/PUT/GET only supported)
|
||||
* contentBody your post/put body here
|
||||
|
||||
This will allow control of any other application that may need mroe then GET.
|
||||
e.g:
|
||||
```
|
||||
{
|
||||
"name": "test device",
|
||||
"deviceType": "switch",
|
||||
"offUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=31",
|
||||
"onUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&DeviceNum=31&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=${intensity.percent}",
|
||||
"contentType" : "application/json",
|
||||
"httpVerb":"POST",
|
||||
"contentBody" : "{\"fooBar\":\"baz\"}"
|
||||
}
|
||||
```
|
||||
Anything that takes an action as a result of an HTTP request will probably work - like putting Vera in and out of night mode:
|
||||
```
|
||||
{
|
||||
"name": "night mode",
|
||||
"deviceType": "switch",
|
||||
"offUrl": "http://192.168.1.201:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=SetHouseMode&Mode=1",
|
||||
"onUrl": "http://192.168.1.201:3480/data_request?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=SetHouseMode&Mode=3"
|
||||
}
|
||||
```
|
||||
Ask Alexa
|
||||
----
|
||||
After this Tell Alexa: "Alexa, discover my devices"
|
||||
|
||||
Then you can say "Alexa, Turn on the office light" or whatever name you have given your configured devices.
|
||||
|
||||
Reference in New Issue
Block a user