# Getting started on TCP/IP CAN based devices

**URL:** <https://community.homey.app/t/getting-started-on-tcp-ip-can-based-devices/133744>\
**Category:** Developers\
**Created:** [March 30, 2025, 5:25pm UTC](https://community.homey.app/t/getting-started-on-tcp-ip-can-based-devices/133744 "2025-03-30T17:25:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![G\_X](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/g_x/32/93597_2.png) [@G\_X](https://community.homey.app/u/G_X)\
**Post date:** [March 30, 2025, 5:25pm UTC](https://community.homey.app/t/getting-started-on-tcp-ip-can-based-devices/133744/1 "2025-03-30T17:25:36Z")

</div>

Hello everyone, I am just new to creating a Homey app. Watched all 3 😁 YT videos on how to do it and it seems to be a no brainer. Now I would like to integrate my hobbyist Can based home automation system into Homey. It should be easy since all I have to do is send and read TCP/IP commands (also mentioned as frames). However since I’m new to node.js and generally haven’t done lot of programming since quite some time I am looking for a kind support here.

Let me start with a perhaps silly question: how to send a TCP/IP command from Homey app? For reference, here what I use in my local web server PHP script:

\<?php function SendHapcanCommand( $action ) { if(($sock = socket\_create(AF\_INET, SOCK\_STREAM, getprotobyname("tcp")))) { if(socket\_connect($sock, '192.168.1.100', 1001)) { $message = hex2bin($action); if( socket\_send ( $sock , $message , strlen($message) , 0)) { if(socket\_recv ( $sock , $buf , 2 , MSG\_WAITALL ) === FALSE) { $message = bin2hex($buf); return $message; } } } } return "Error"; } ?\>

And then I simply call the above function with the message that my Can system can understand:

Send\_Hapcan\_Form\_Cmd(“AA10A0ABCD0202080100FFFFFF32A5”)

Of course the value I am sending depends on a device (relays, shutters, LED dimmers etc.) but I am able to build it dynamically.

So, what would the best and elegant way to send such a command on ‘onoff’ capability in the Homey app?
