Smart Home Automation Forum
Lesson9 - integrate KC868-Server to home assistant by MQTT - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=1)
+--- Forum: Home automation training courses (https://www.kincony.com/forum/forumdisplay.php?fid=18)
+--- Thread: Lesson9 - integrate KC868-Server to home assistant by MQTT (/showthread.php?tid=1781)

Pages: 1 2 3 4 5 6


Lesson9 - integrate KC868-Server to home assistant by MQTT - admin - 03-27-2022


1.MQTT communication structure diagram

   

KC868-Server--------

publish message: status of switch (status topic)
Subscription message: turn on / off command (command topic)


home assistant------

publish message:  turn on / off command (command topic)
Subscription message: status of switch (status topic)

2.KC868-Server digital output , digital input , analog input config sample code in configuration.yaml

# Example configuration.yaml entry
switch:
  - platform: mqtt
    name: 'output-1'
    unique_id: output-1
    state_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /state'
    command_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /set'
    payload_on:  '{"relay1":{"on":1}}'
    payload_off:  '{"relay1":{"on":0}}'
    value_template: '{{ value_json.relay1.on }}'
    state_on: 1
state_off: 0


binary_sensor:
  - platform: mqtt
    name: 'input-1'
    unique_id: input-1
    state_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /state'
    value_template: '{{ value_json.input1.on }}'
    payload_on: 1
    payload_off: 0


sensor:
  - platform: mqtt
    name: 'analog-1'
    unique_id: analog-1
    state_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /state'
    unit_of_measurement: 'v'
    value_template: '{{ value_json.analog1.value }} ' 

Note: xxxxxxxxxxxxxxxxxxxxxxxx is UID of controller, just replace with your device UID. You can find the UID in ethernet setting.

3.KC868-Server 16 channel output, 16 channel digital input, 4 channel analog input all use in configuration.yaml


.txt   KC868-Server-home-assistant-config.txt (Size: 8.15 KB / Downloads: 1,000)


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - Almhlws - 12-05-2022

I try to integrate KC868-Server to the home assistant by MQTT
but I can't find the IP for the server 

the IP for  the home assistant is http://192.168.100.172:8123/

see the photo 

https://ibb.co/G2V4wQc
https://ibb.co/47cJmTn

https://ibb.co/rMMmr19


can you help me find the IP


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - admin - 12-05-2022

because your KC868-Server ip is 192.168.1.200
your network is 192.168.100.x

you should set KC868-Server ethernet for "DHCP" mode. let it's ip became 192.168.100.x so that you can find it.
how to set :
d.) Hold on Ethernet mode button, when the [yellow and white LED] all is ON, release it, then work mode in “UDP” and IP by DHCP mode;
here is online guide details: https://www.kincony.com/how-to-use-kc868-server.html


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - Almhlws - 12-06-2022

Than you  Working now Smile


I get error message 


Your manually configured MQTT switch(s) needs attention


This stops working in version 2022.12.0. Please address before upgrading.
Manually configured MQTT switch(s) found under platform key 

Code:
switch
.
Please move the configuration to the 

Code:
mqtt
 integration key and restart Home Assistant to fix this issue. See the documentation, for more


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - admin - 12-06-2022

yes, new home assistant version have changed mqtt format, you can see here:
https://www.kincony.com/forum/showthread.php?tid=1998


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - Almhlws - 12-08-2022

thank you 


can you check attach


.txt   switch.txt (Size: 7.8 KB / Downloads: 319)
.txt   switch.txt (Size: 7.8 KB / Downloads: 319)


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - admin - 12-09-2022

yes, whether work well with your config file?


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - Almhlws - 12-09-2022

Not working


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - admin - 12-09-2022

which board you are using?


RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - Almhlws - 12-09-2022

Kincony KC868-Server