Custom http device carriage returns for body

2021 · 3 replies · Devices

This discussion is from 2021, preserved from the original Roomie Remote forum. Steps and device details may reference older versions of the app — see Support and current compatibility for up-to-date guidance.

In short

Trying to send http command that has json payload and needs the payload in the body like in the ddk example below. — Staff replied: “Getting detailed encoding correct in a text field when you need exacting control over each byte is not likely to be the best path.”

Questionvmbray

Trying to send http command that has json payload and needs the payload in the body like in the ddk example below. With the new custom device option in the app, is there a way to add a carriage return so that roomie sees it as the body option as below? The key in the app is Done when editing the line so it won't insert a CR. Should I just do this on a mac?

My goal device command (would be entered in app custom device)

<key>CONFIG 0</key>

<string>POST /devices/0/config/post.schema

{"master_status": {"preset": 0}}</string>

The example from doc:

<key>CURSOR DOWN</key>

<string>POST /upnp/control/IRCC

Soapaction: &quot;urn:schemas-sony-com:service:IRCC:1#X_SendIRCC&quot;

Content-Type: text/xml; charset=UTF-8

&lt;?xml version=&quot;1.0&quot;?&gt;

&lt;s:Envelope xmlns:s=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;

s:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&gt;

&lt;s:Body&gt;

&lt;u:X_SendIRCC xmlns:u=&quot;urn:schemas-sony-com:service:IRCC:1&quot;&gt;

&lt;IRCCCode&gt;AAAAAwAAHFoAAAA6Aw==&lt;/IRCCCode&gt;

&lt;/u:X_SendIRCC&gt;

&lt;/s:Body&gt;

&lt;/s:Envelope&gt;</string>

vmbray

Also, the double quotes are getting converted to three decimal points, this is what is being received by the device being controlled. Tried escaping them or using &quot without success.

POST /devices/0/config/post.schema {...master_status...:{...preset...:0}}

Roomie Staff

Getting detailed encoding correct in a text field when you need exacting control over each byte is not likely to be the best path. You should import/export for changes and use Xcode or BBEdit as per the DDK to ensure proper encoding.

vmbray

Thanks Will, it works fine in mac os bbedit.

<dict>

<key>brand</key>

<string>mrene</string>

<key>cat</key>

<string>minidsp-rs</string>

<key>codes</key>

<dict>

<key>CONFIG 1</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"preset":0}}</string>

<key>CONFIG 2</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"preset": 1}}</string>

<key>CONFIG 3</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"preset": 2}}</string>

<key>CONFIG 4</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"preset": 3}}</string>

<key>SOURCE ANALOG</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"source": "Analog"}}</string>

<key>SOURCE TOSLINK</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"source": "Toslink"}}</string>

<key>SOURCE USB</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"source": "Usb"}}</string>

<key>MUTE ON</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"mute": true}}</string>

<key>MUTE OFF</key>

<string>POST /devices/0/config

Content-Type: application/json; charset=utf-8.

{"master_status":{"mute": false}}</string>

</dict>

<key>method</key>

<string>http</string>

<key>type</key>

<integer>1</integer>

</dict>

Related threads

Today's Roomie controls 400,000+ devices.

Roomie Remote X brings TVs, receivers, streamers, lights, and whole-home audio into one app on iPhone, iPad, Mac, and Apple TV.

Download Roomie Remote X