KMTronic Lan module need some help please

Hi, newbee to Home Assistant , i was wondering if somebody is using the LAN KMTronic switch on HA?KMTronic

Here is some more info , still didn’t figure this out , any help appriciated

A general purpose LAN Relay controller.
Features:
• Fully assembled and tested.
• Each relay has an LED to indicate when it is operated.
• Relay outputs can be used to turn ON/OFF lights, motors and other devices.

Model:
UD8CR

Complete including:

  • One LAN Eight relay controller

Required power:
12VDC / 1000 mA.

Specifications:
Relays have Normally Open (NO) and
Normally Closed (NC) Contacts each capable of switching max:

  • 12VDC/15A
  • 24VDC/15A
  • 125VAC/15A
  • 250VAC/10A

Dimensions:
KMTronic_8Relay_Dimension.pdf

Default Settings:
IP address: 192.168.1.199
Webserver Port: 80 (for initial configuration with username/password)
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
UDP Port: 12345
Username: admin
Password: admin

Reset to Default Settings:
Hold Reset button for 10 seconds

UDP Commands:
FF0000 - Status Read command (ASCII encoding)

FF0100 - Relay 1 OFF command (ASCII encoding)
FF0101 - Relay 1 ON command (ASCII encoding)

FF0200 - Relay 2 OFF command (ASCII encoding)
FF0201 - Relay 2 ON command (ASCII encoding)

FF0800 - Relay 8 OFF command (ASCII encoding)
FF0801 - Relay 8 ON command (ASCII encoding)

FFE000 - All relays OFF command (ASCII encoding)
FFE0FF - All relays ON command (ASCII encoding)

I’m also trying to use this board, it’s working for you?
Tnx

Hi there, did you managed to get it working with HA?

Found, this, but is a Modbus controller.

Just created:

Made it available on HACS meanwhile:

If someone can test it and give me feedback, I would appreciate!

I did a test with 2 versions of KMtronic that are available for me.

WEB LAN Ethernet IP Eight channels Relay Controller → works correctly
UDP LAN Ethernet IP Eight channels Relay Controller → incorrect authentication

Thanks for the feedback, unfortunantely I don’t have a UDP LAN model to test on :frowning:

If it truly only uses UDP, then this integration will definitely not work :frowning:

I have one KMTronic LAN Ethernet IP 8 channels UDP controlled Relay board and I can’t connect from Home Assistant, always ends with “failed to connect”.
Can someone confirm if exist option to add this device to Home Assistant?

any updates to UDP version?
New HA user here moved from OpenHAB 1.8 and there I have two (old) 8 channels UDP version in use to control home automation (HVAC, lights, car heater, etc.) so I really would like to use those from HA.

Hi @dgomes thats for the integration, i’m getting a error in HomeAssistant if I turn on/off a switch.

Fehler beim Aufrufen des Diensts switch/turn_off. 404, message='Not found', url=URL('http://192.168.178.172/FF0100')

(Translatetable to “Error on service execution”)

The WebUI of the KMTronic shows thats it changed the status correctly.

Probably something on your firmware version, can you provide more details on your hardware ? model ? version (if any) ?

Bought it directly at KMtronic:

LAN Ethernet IP 8 channels WEB Relay board
SKU: SS_WEB8REL_BOX

WebUI says Version 1.1

Manufacturer Link: LAN Ethernet IP Eight channels WEB Relay Controller

Some WebUI debugging:
GET http://192.168.178.172/status.xml

<response>
<relay0>1</relay0>
<relay1>0</relay1>
<relay2>0</relay2>
<relay3>0</relay3>
<relay4>0</relay4>
<relay5>0</relay5>
<relay6>0</relay6>
<relay7>0</relay7>
<relay8>0</relay8>
</response>

If I turn on/off switch:

GET http://192.168.178.172/relays.cgi?relay=1

Respons with inline HTML code.

Edit1: If I open http://192.168.178.172/FF0100 in the browser I get the error 404 described in the error message I posted yesterday.

Edit2: To clairify: I just want to get rid of the error message in Lovelance because the Webrelais works with the integration.

KMTronic API is not very consistent unfortunately

This is the API endpoint I figured out on my own device

but later another user pointed to the cgi script you just shared and I added the toggle service (because that’s what the cgi actually does, it doesn’t provide me the current state)

I would expect you to have an error in the logs, but I’m surprised you have an error on the UI (Lovelace) can you print screen it ?

1 Like

Ofc :slight_smile:

Interesting, 1st time I’m seen such kind of error message on the front end… always learning :slight_smile:

Could you possibly check on the KMTronic webpage what endpoint it uses to change the relay state ? is it only through the CGI service that it changes the relay state?

I checked the C# ecample code and the PHP example code - both using relays.cgi?relay=1 as endpoint and checking status with status.xml afterwards. This PHP example uses the FF0100 syntax.

If I curl the relais directly, it returns 404: File not found
but the relais got turned on:

curl -u admin:admin --request GET "http://192.168.178.172/FF0101"

(POST/GET doesn’t matter, same results)

Response:

404: File not found<br>

Result:

Edit: so I guess, its basically not a fault on your integration but a miscoded firmware of the webrelais.

So not sure how to address this :confused:

I’m guessing the false 404 should be ignored…

One possible solution would be to add a Checkbox to ignore 404 HTTP errors and ignore them in the backend.

image