Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-AP JSON not valid
#1
Have KC868-AP
Code:
Board Model
KC868_AP
Software Version
v2.2.12
Build Date
Feb 28 2025 14:41:30
Serial Number
C82E18C85DFC

I try integrate it to Home Assistant over MQTT, but it not working. 
I have this template:
Code:
mqtt:
  light:
  - name: 'KC868-AP-1-DIMM-1'
    unique_id: KC868-AP-1-DIMM-1
    schema: template
    command_topic: "KC868_AP/C82E18C85DFC/SET"
    state_topic: "KC868_AP/C82E18C85DFC/STATE"
    command_on_template: >
      {% if brightness is defined %}
      {"dac1":{"value":{{(brightness / 255  * 100) | int - 1}}}
      {% else %}
      {"dac1":{"value":255}}
      {% endif %}
    command_off_template: >
      {"dac1":{"value":0}}
    state_template: >
      {% if value_json.dac1.value == 0 %}
      off
      {% else %}
      on
      {% endif %}
    brightness_template: >
      {{ (value_json.dac1.value / 99 * 255) | int }}
when I change dimmer value in HA, message received on device and dimmer value is changed, but light state in HA still Unknown.
I try to check status JSON in linter and it have mistake:
Code:
{"input1":{"value":false},"input2":{"value":false},"input3":{"value":false},"input4":{"value":false},"input5":{"value":false},"input6":{"value":false},"input7":{"value":false},"input8":{"value":false},"input9":{"value":false},"input10":{"value":false},"input11":{"value":false},"input12":{"value":false},"input13":{"value":false},"input14":{"value":false},"input15":{"value":false},"input16":{"value":false},"input17":{"value":false},"input18":{"value":false},"output1":{"value":false},"output2":{"value":true},"dac1":{"value":0},"dac2":{"value":0},"dac3":{"value":0},"dac4":{"value":0},"dac5":{"value":0},"dac6":{"value":0},"dac7":{"value":0},"dac8":{"value":0},"dac9":{"value":0},"dac10":{"value":0},"dac11":{"value":0},"dac12":{"value":0},"dac13":{"value":0},"dac14":{"value":0},"dac15":{"value":0},"dac16":{"value":0},}
after  "dac16":{"value":0}, has extra comma.
if I publish valid JSON in status topic without extra comma HA gets status of dimmer channel correct:

Code:
{"input1":{"value":false},"input2":{"value":false},"input3":{"value":false},"input4":{"value":false},"input5":{"value":false},"input6":{"value":false},"input7":{"value":false},"input8":{"value":false},"input9":{"value":false},"input10":{"value":false},"input11":{"value":false},"input12":{"value":false},"input13":{"value":false},"input14":{"value":false},"input15":{"value":false},"input16":{"value":false},"input17":{"value":false},"input18":{"value":false},"output1":{"value":false},"output2":{"value":true},"dac1":{"value":0},"dac2":{"value":0},"dac3":{"value":0},"dac4":{"value":0},"dac5":{"value":0},"dac6":{"value":0},"dac7":{"value":0},"dac8":{"value":0},"dac9":{"value":0},"dac10":{"value":0},"dac11":{"value":0},"dac12":{"value":0},"dac13":{"value":0},"dac14":{"value":0},"dac15":{"value":0},"dac16":{"value":0}}
Reply
#2
why not use esphome for integration, it's locally.
here is yaml file: https://www.kincony.com/forum/showthread.php?tid=2476
Reply
#3
(04-17-2025, 12:01 PM)admin Wrote: why not use esphome for integration, it's locally.
here is yaml file: https://www.kincony.com/forum/showthread.php?tid=2476

ok. thnx. i will try it. but what about mqtt?
Reply
#4
what KCS firmware version you are using?
Reply
#5
(04-17-2025, 10:02 PM)admin Wrote: what KCS firmware version you are using?

Software Version
v2.2.12
Reply
#6
new firmware fixed the issue, you can download at here: https://www.kincony.com/forum/showthread.php?tid=8058
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)