Hello everyone,
if someone is wondering how to bind a dimmer or switch to a plex home theater than this will help you out:
step 1:
install shell-execute plugin
step 2:
add a new device with the following config:
you need to change PLEXIP to the ip of the plex home theater
{
"id": "plex-status",
"name": "Plex status",
"class": "ShellSensor",
"attributeName": "plex-status",
"attributeType": "string",
"command": "curl -H 'Content-Type: application/json' --silent -X POST -d '{\"jsonrpc\": \"2.0\", \"method\": \"Player.GetProperties\", \"params\": {\"properties\": [\"speed\"],\"playerid\": 1}, \"id\": 1}' http://PLEXIP:3005/jsonrpc?request= | awk '{print substr($1,43,1); }' | awk '{ if($1 == \"\"){print \"Home / offline\"}else if($1 == 1){print \"Playing\"}else if($1 == 0){print \"Pause\"} }'",
"interval": 200
}
step 3:
add a rule like this one:
plex-status of plex-status is equal to “Pause” for 3 seconds
turn blabla on
and:
plex-status of plex-status is equal to “Pause” for 3 seconds
OR
plex-status of plex-status is equal to “”
turn blabla off
Enjoy!
ps. if someone wants to make a plugin for plex home theater, that would be great.