Please hep develop TCP/ IP integration for a lighting brand

Hi,

I am looking for assistance in integrating a lighting control brand with HA. It needs TCP/IP integration I’m told by the brand. The device categories carried by the brand include lights, covers, relays, sensors, fans. The native app allows all the typical features available for controlling such a device set.

In HA, basic control is possible at the moment using telnet. eg issuing a command such as

switch:

platform: telnet
  switches:
    scene1:
      resource: 192.168.1.199
      port: 5050
      command_on: "AR=000F040100\n"
      command_off: "AR=0036040100\n"
      timeout: 0.9

In the above example, the area is 4
scene number is 1
the IP address is that of the brand’s IP gateway.
Obviously this provides no feedback, its not possible to have light entity etc.

How could one go about creating a proper integration for such a platform? I am totally incapable of creating one unless there is some identical template which allows me to replace values.

The brand ( www.raylogic.in ) has working integrations with Control4, Crestron and RTI. Any further documentation can be made available by the brand. Let me know what would be needed.

Would greatly appreciate any help. Thank you.

Good luck with that but basically you need to know how to program in Python :wink: I tried in the past to develop a custom integration for some A/V devices controlled in a similar way but I could not do much as my Python knowledges are nearly zero :frowning:

1 Like

So the way these Feature Requests work, there’s not really enough information there to entice someone to come and help. See the pinned post.

I would edit your top post to provide brand names, links to the equipment, anything else you know or have tried, etc.

2 Likes

Frankly the fact that no feedback is given tells me that this platform is probably a waste of time.

1 Like

The brand is what? Step one is to find out what’s been done previously. Being cagey around what brand /device it is doesn’t help.

Without any further information I doubt you get any assistance, while if you define - exactly- what you are try to integrate (down to model number and firmware level if possible) I’m sure plenty of people have tried previously and we can start with thier work.

3 Likes

Done as requested. Thank you.

Ask them for their API.

1 Like

Kindly download from this yandex disk link -

(since I cannot attach pdf)

Those documents don’t mention telnet, but if it truely is telnet, you can implement this without any code using the current telnet yaml integration. You just need to figure out what the command on and command off is for your device using that document.

It provides no feedback because you didn’t add that to the configuration.

command_state is the polling command you should use, and value_template allows you to take the commands response and transform it into on or off (a value template that returns true is on, false is off)

I am able to construct on/ off and scene recall commands. Thats no issue at all. I would have loved proper integration where lights state feedback would be available etc. And the manufacturer says that the integration is possible using TCP/IP.

read my second response.

TBH, it sounds like you just want a telnet light platform because the telnet switch platform does not do what you want.

1 Like

I didnt even know that was possible. Let me check that out. Thank you. Any pointers towards a sample construct that includes feedback would be pretty handy for a noob like me.

What command would you use to query the state?
Whats the response when you query the state and it’s on?
Whats the response when you query the state and it’s off?

Provide that information and I can help you build the configuration.

2 Likes

The instructions are as below

The device that is queried with the QUERY DEVICE command will reply
using this format.

+AR40=abcdefghijklmnopqrtsuvwxyzAAX 

of which

ab = Start Address of the device = 01 (all devices have an addressing system and each channel takes an address number, start address is the address number of the first channel of the device. So if its a 4 channel device, the addresses are lets say 9 to 12, and thus start address is 9)

cd = Current Scene of the device = 01 (current scene on the device)

ef = Channel count of the device = 04 (there are 2 channel and 4 channel devices)

gh = Channel 1 type = 01 (01 = Dimmer, 02 = Relay, 03 = Fan, 04 = Curtain pair)

ij = Channel 1 level = 02 (The channel level is a 2 digit ASCII HEX value. For Dimmer channels Level 0x01 is maximum brightness, Level 0xFF is OFF.
For Switching channels [Relays] Level 0x01 = OFF, Level 0x02 = ON, Level 0x03 - 0xFF = ON for a duration [1] to [252] seconds. The relay will automatically switch OFF after this duration.
For Fan channels Level 0x01 = OFF, Level 0x02 = Speed 1, Level 0x03 = Speed 2, Level 0x04 = Speed 3, level 0x05 = Full Speed.)

Similarly for other channels

kl = Channel 2 type = 01
mn = Channel 2 level = 02
op = Channel 3 type = 01
qr = Channel 3 level = 02
st = Channel 4 type = 01
uv = Channel 4 level = 02

wx = Current running scheduler = 00
yz = Current running timer = 00
AA = current running timer activity = 00
X = Delimiter (\r) = CR

ab,cd,ef,gh,ij,kl,mn,op,qr,st,uv,uv,wx,yz,AA are 2 digit ASCII HEX
values

X = 1 character = CR ( \r ) or hex 0x0D
Size of command = For 2 channel light/relay device 27 bytes
Size of command = For 2 channel fan device 23 bytes
Size of command = For 4 channel light/ relay device 35 bytes

Sample replies

?AR40=01\r

4 ch light/ relay reply → +AR40 =0101040102010201020102000000\r
2 ch light/ relay reply → +AR40 =01010201020102000000\r
2 ch fan device reply → +AR40 =0101010102000000\r

You can only poll using 1 command, you can only send 1 state for on, and 1 state for off.

If you want brightness at different levels, you’ll need to make a switch for each brightness level with the current implementation. I’m not going to reverse engineer the protocol for you. So if you provide me with the on off states, and the polling state, I’ll show you how to make a switch for that specific brightness. Then I’ll show you how to combine all switches into a light.

3 Likes

Below are the responses received when commands to turn on/ off lights, relays and fan speed etc are sent. @petro

RELAY

Sorry for the multiple posts, my newbie membership only permits 1 attachment per post

DIMMER

FAN CONTROLLER