This project will only work if you have the Pro-Bridge form lutron.
Update: I have also added LOXONE sync to the code base, now all changes in lutron state will be directly updated into loxone. (i.e. pressing a lutron switch on the wall will also toggle the state of a virtual switch in the LOXONE controller) Helps in keeping LOXONE dashboard in sync,(Othewise I was having the problem where loxone will say light is off but it may have been turned on by someone pressing the switch on the wall). This is achived by putting information on what you want to sync in the file loxone-cfg.ts, you will need to add an entry there for the switch that you want to sync and the lutron device id that you want the switch to sync to. The lutron device ID can be found by looking at the log when activating the lutron device. You will see a log message with the device id. The loxone device uuid can be found by running "npm run watch", this will print out uuid's as you interact with the loxone controller.
If you have problem with this or want some help open a issue on github.
A NodeJS server which accepts REST commands and configures Lutron Caseta Gateway
I have it connected to some Dimmer and switches so far and it work well. I am primarily using it for connecting all the Lutron devices to LOXONE home automation system.
npm install
npm run build
LUTRON_SERVER_IP="xx.xx.xx.xx" npm run server
npm run watch this will show all the events generated in the LOXONE controller.
cd docker ./build_lutronjs
docker run --net=host -d --name lutronjs --restart unless-stopped --tmpfs /run --tmpfs /run/lock sushilks/lutronjs /bin/bash -c ". /root/.nvm/nvm.sh && LUTRON_SERVER_PORT= LUTRON_SERVER_IP= /root/run_lutronjs.sh"
./attach_lutronjs
docker logs -f lutronjs
curl http://:8082/v0/devices Returns a JSON Blob of devices i.e. Here is an example output
[
{
"href": "/device/1",
"Name": "Smart Bridge",
"FullyQualifiedName": [
"Smart Bridge"
],
"Parent": {
"href": "/project"
},
"SerialNumber": 123456,
"ModelNumber": "L-BDG2-WH",
"DeviceType": "SmartBridge",
"RepeaterProperties": {
"IsRepeater": true
}
},
{
"href": "/device/2",
"Name": "Master Light",
"FullyQualifiedName": [
"Master Light"
],
"Parent": {
"href": "/project"
},
"SerialNumber": 12345678,
"ModelNumber": "PD-6WCL-XX",
"DeviceType": "WallDimmer",
"LocalZones": [
{
"href": "/zone/1"
}
]
},
{
"href": "/device/3",
"Name": "Master Light Remote 1",
"FullyQualifiedName": [
"Master Light Remote 1"
],
"Parent": {
"href": "/project"
},
"SerialNumber": 12345678,
"ModelNumber": "PJ2-3BRL-GXX-X01",
"DeviceType": "Pico3ButtonRaiseLower",
"ButtonGroups": [
{
"href": "/buttongroup/2"
}
]
},
{
"href": "/device/15",
"Name": "Outside Front Light",
"FullyQualifiedName": [
"Outside Front Light"
],
"Parent": {
"href": "/project"
},
"SerialNumber": 12345678,
"ModelNumber": "PD-8ANS-XX",
"DeviceType": "WallSwitch",
"LocalZones": [
{
"href": "/zone/11"
}
]
}
]
curl http://:8082/v0/device/
i.e. curl http://:8082/v0/device/2
{"deviceId":"2","value":100}
To set the zone 2 device to a value of 20 use the following command curl -X PUT http://:8082/v0/device/2/value/20
curl http://:8082/v0/name/
i.e. curl http://:8082/v0/Master%20Light
{"deviceId":"2","value":100}
To set the "Master Light" device to a value of 20 use the following command curl -X PUT http://:8082/v0/name/Master%20Light/value/20
To toggle the "Master Light" device (If the device value is non zero it will be flipped to zero. Otherwise it will be set to 100) curl -X PUT http://:8082/v0/toggle/Master%20Light
curl http://:8082/v0/status/all
i.e. example output
{"Master Light": 20, "Outside Front Light": 0}