How can i generate network TCP commands ?

Tomcat shared this question 10 years ago
Answered

I would like to generate TCP commands in order to switch my Denon AVR on and off, directly from my iPhone App, or as part of a scene. How can i do that with rules engine as i could do in LUA with another box ?

Replies (6)

photo
1

You need to create one virtual switch and create rule with socket requests. Then you can use that virtual switch directly from mobile app, dashboard or from scenes.

Here is rule example:

NySszZfSHm50Bocruopa

photo
1

Thanks a lot Nenad.

One more question... in the 'Body' field, if i want to write hexadecimal values, which notation do i have to use ? (i.e i want to enter 0x0d for carriage return) .. do i insert 0x0D or 0D or the decimal value ? in other words, is the body field transformed and / or translated before being included in the tcp frame ?

photo
1

Not very clear what i can do with this 'Socket request' action. Where do i specify the action i want to take on the socket : read, write, set timeout and so on ?

thanks for your help

photo
1

Text in body will be sent as inputted. You can try with multiple values and see if your device is responding and on which one.

photo
1

so as fra as i understand, the only possible action is a "write", no "Read" available on the socket , or "Timeout" ?

is that something planned on the future ?

photo
1

Nenad, your post doesn't help very much.

It seems that body field only send text as it is shown

But how to send a carriage return code ?

I have tried :

\r

\\r

/r

SHIFT + ENTER

0x0D


Please help us

Leave a Comment
 
Attach a file