Sonos speaker - morning play

You have a full overview of what the media_player service can do here:


For the flow mentioned above here is the source code:

{
  "Id": "7i3QP3PwMv6Y2eG",
  "ClassId": "7i3QP3PwMv6Y2eG",
  "Author": "espenh.no",
  "Version": 0,
  "CreatedAt": "2020-07-05T19:22:52.311888789+02:00",
  "UpdatedAt": "2020-08-29T13:47:41.69831476+02:00",
  "Name": "sonos_bad on when speil is on",
  "Group": "sonos",
  "Description": "sonos_bad on when speil is on",
  "Nodes": [
    {
      "Id": "1",
      "Type": "trigger",
      "Label": "speil evt.binary.report",
      "SuccessTransition": "2",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:out_bin_switch/ad:22_1",
      "Service": "out_bin_switch",
      "ServiceInterface": "evt.binary.report",
      "Config": {
        "InputVariableType": "",
        "IsValueFilterEnabled": false,
        "LookupServiceNameAndLocation": false,
        "PropFilterName": "",
        "PropFilterValue": "",
        "RegisterAsVirtualService": false,
        "Timeout": 0,
        "ValueFilter": {
          "Value": null,
          "ValueType": ""
        },
        "ValueJPath": "",
        "ValueJPathResultType": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": null
      },
      "Ui": {
        "nodeType": "",
        "x": 70,
        "y": 170
      }
    },
    {
      "Id": "2",
      "Type": "if",
      "Label": "if home or sleep",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "or",
            "LeftVariableIsGlobal": true,
            "LeftVariableName": "fh.home.mode",
            "Operand": "eq",
            "RightVariable": {
              "Value": "home",
              "ValueType": "string"
            }
          },
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": true,
            "LeftVariableName": "fh.home.mode",
            "Operand": "eq",
            "RightVariable": {
              "Value": "sleep",
              "ValueType": "string"
            }
          }
        ],
        "FalseTransition": "",
        "TrueTransition": "9"
      },
      "Ui": {
        "nodeType": "",
        "x": 76,
        "y": 322
      }
    },
    {
      "Id": "9",
      "Type": "if",
      "Label": "if true",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": false,
            "LeftVariableName": "",
            "Operand": "eq",
            "RightVariable": {
              "Value": true,
              "ValueType": "bool"
            }
          }
        ],
        "FalseTransition": "10",
        "TrueTransition": "11"
      },
      "Ui": {
        "nodeType": "",
        "x": 79,
        "y": 518
      }
    },
    {
      "Id": "10",
      "Type": "if",
      "Label": "if false",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "",
      "Service": "",
      "ServiceInterface": "",
      "Config": {
        "Expression": [
          {
            "BooleanOperator": "",
            "LeftVariableIsGlobal": false,
            "LeftVariableName": "",
            "Operand": "eq",
            "RightVariable": {
              "Value": false,
              "ValueType": "bool"
            }
          }
        ],
        "FalseTransition": "",
        "TrueTransition": "12"
      },
      "Ui": {
        "nodeType": "",
        "x": 272,
        "y": 520
      }
    },
    {
      "Id": "11",
      "Type": "action",
      "Label": "set playback play",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:sonos/ad:1/sv:media_player/ad:347E5C3E36DC01400",
      "Service": "media_player",
      "ServiceInterface": "cmd.playback.set",
      "Config": {
        "DefaultValue": {
          "Value": "play",
          "ValueType": "string"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 66,
        "y": 717
      }
    },
    {
      "Id": "12",
      "Type": "action",
      "Label": "set playback pause",
      "SuccessTransition": "13",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:sonos/ad:1/sv:media_player/ad:347E5C3E36DC01400",
      "Service": "media_player",
      "ServiceInterface": "cmd.playback.set",
      "Config": {
        "DefaultValue": {
          "Value": "pause",
          "ValueType": "string"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 282,
        "y": 717
      }
    },
    {
      "Id": "13",
      "Type": "action",
      "Label": "set volume 10%",
      "SuccessTransition": "",
      "TimeoutTransition": "",
      "ErrorTransition": "",
      "Address": "pt:j1/mt:cmd/rt:dev/rn:sonos/ad:1/sv:media_player/ad:347E5C3E36DC01400",
      "Service": "media_player",
      "ServiceInterface": "cmd.volume.set",
      "Config": {
        "DefaultValue": {
          "Value": 10,
          "ValueType": "int"
        },
        "IsVariableGlobal": false,
        "Props": {},
        "RegisterAsVirtualService": false,
        "ResponseToTopic": "",
        "VariableName": "",
        "VirtualServiceGroup": "",
        "VirtualServiceProps": {}
      },
      "Ui": {
        "nodeType": "",
        "x": 279,
        "y": 875
      }
    }
  ],
  "Settings": null,
  "IsDisabled": false,
  "IsDefault": false,
  "ParallelExecution": "keep_last"
}
1 Like