I’m a newbie to automation and HA . initially thought to buy kincony 32ch realy and do my automation. then after came to know about HA and Kincony relay. i wish to buy kincony and do the automation. so what i want to know is now integration kincony to HA is possible? so im going to but module. advice me?
Yes,we have the lesson for how to add KC868-Hx relay controller to HA.
We are trying to write a plug-in for HA, which can control the output of the relay and read the status of the input port, so that DIYer can use it more conveniently and easy.
I’ve written custom_component. Not as convenient as plugin, but much closer than python script.
It stops forking after network errors and ip is hard-cored, so not ready to by used. Gonna fix it on the weekend
good job. very simple to connect the card.
it only worked for ignition on the board, on hassio it is always off. so when I try to turn off it gives me a call error
@iozzi_giorgio you can try new version, i’ve fixed several bug including reconnection. I have also added ip and port customization. so don’t forget to add ip of your device.
Everyone is welcome to test the integration. The only known limitation is that the code supports only one device. I’m not going to add multi-device code (simply because i have only one device) but the code is open for modifications
great , thanks for your components to share everyone.
@shamruk congratulations you have been very quick in the modification … I find it a very functional and simple integration solution … thank you for the tips … in the test I did I modified the ip in the .py file … now you can edit from .yaml? have you thought if it is also possible to read the inputs? if I create many folders for the devices that I have and rename kincony-sha123456n and the same I do in the .yaml file could it work? @KinCony I hope the manufacturer will consider this integration … thank you very much
@shamruk I tried the new release … it’s perfect … feedback with a 15 second delay if I press on the card (on home assistan it’s instantaneous). for me it would be the best to use this card also the inputs … @kincony the firmware does not remember the state if it turns off? or timing without using home assistant?
- if you want to use multiple devices without writing code. yes, I think copy and rename folder would work, but you also need to rename
kincony-sha
inside__init__.py
and insidemanifest.json
. Also change var in__init__.py
DATA_DEVICE_REGISTER = "k_device_register"
toDATA_DEVICE_REGISTER = "k_DEVICE_ID_device_register"
- I don’t have the hardware to test the inputs even if i write the integration. but i does not look very difficult to extend this integration for any programmer
hope some programmer will solve these 2 issues (multi-device and input support). looks like 2 to 8 hours work
now i are making the new firmware for relay state remember function for other model relay controller and also make a bootloader tool, it will be soon.
@shamruk Thank you so much for your help … @KinCony are you also writing very simple home assistant integration like this?
Hi how can I integrate this with smartthings
Would this firmware upgrade “feedback” come from the module and go to HA, assuming HA has “listening code” code to receive such an unanticipated message? Or is the firmware upgrade “feedback” be stored in the module and then can be read by HA in some form of polling? When will this firmware upgrade “feedback” be available to us? Could you give us details on this firmware upgrade “feedback”, like what commands to send and what reply comes back.
Your video explains much about firmware upgrade to get which key is pressed. Your video is " Power down relay state memory remember and key data feedback fireware for KC868-H32L". This is your video: https://www.youtube.com/watch?v=0Jou7fme8do&feature=youtu.be
For those looking at the KinCony KC868-H32 with the firmware upgrade, note you must buy the “L” version which will cost more. Other “L” features is the connectors can be removed from the module.
More information: https://www.youtube.com/watch?v=Qknel82vPOI titled [Automation Module Project DIY] how to remote control relays many ways. You can now buy this 34 input switch module which connects to the KC868-H32L --L – and allows remote SPST momentary switches to turn on and turn off the respective relay. S1 control R1, S2 controls R2 and so forth. Looking at this video, it seems that this “switch module” toggles the respective relay.
With the firmware upgrade, the earlier video shows you can read the switch that was pressed. We need more information, but this “switch module” makes each KC868-H32L a 32-input 32-output module. Know that if a switch is pressed and you want a momentary pulse rather than a constant level, you may need to a) sense that a switch was pressed, and, b) reset the relay back to what is was before the switch was pressed.
This is exciting news and gives us 32 + 32 I/O for low (relatively) cost. In order for me to get my hands around this, I will need to study asynchronous I/O, scheduling, tasking, multi-threading. I’ll get back to this thread when I learn more. Reply if you have questions.
Now we have finished this firmware. it will feedback which key is pressed by “manual control board”, and now the new relay status after you controled.
For example : when you press key1 to turn OFF relay1. you will received the string “RELAY-KEY-255,1,0,OK” in TCP mode. first number “255” not need to see, it always is “255” number. “1” means relay1, just a relay’s channel. “0” means now the relay status is “OFF”.
if you press key1 again to turn ON relay1, then you will received the string “RELAY-KEY-255,1,1,OK” in TCP mode. first number “255” not need to see, it always is “255” number. “1” means relay1, just a relay’s channel. “1” means now the relay status is “ON”.
This function auto feedback is from KC868-H32 relay controller network port, not from home assistant.
Now , we have take some time to modify all kinds of KC868 controller’s firmware. for the news, all
controller(KC868-H2,KC868-H4,KC868-H8,KC868-H16,KC868-H32) have new firmware, and have new function
followings:
1:The function of power-off memory of relay switch is added. If the power is cut off suddenly or power
failure, the relay will automatically return to the state before the power cut when the power is called
again.
2:When press switch board , controller will auto send information to client software in TCP mode.
3:Add bootloader function, next time when need to update firmware can download to RS232 port, also can use
USB-RS232 adapter cable to flash program.
4.Add ALL relay ON command.
5.Add ALL relay OFF command.
6.Add reverse status control mode command. (Such as ON->OFF , OFF->ON,just opposite to the current state)
7.support new switch terminal board that can use 433MHz wireless remoter control MAX 32 channel relay.
new switch terminal board have 34 input port (32 relay switch + ALL ON switch + ALL OFF switch), but these are for switch button use, not for sensor use. if you want to use 32 input ports to read , you should use KC868-COL, that have 32 channel input ports for use.
Here is alternative
At much lower cost.
https://www.aliexpress.com/item/4000462972283.html
I do not think it works for US 120VAC only 220VAC but not sure.
It works with Kincony KC868-COL
https://www.aliexpress.com/item/4000336722335.html?spm=2114.12010615.8148356.2.452467f9fP3gZv