Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KCS firmware - MQTT LWT?
#21
(10-11-2024, 10:48 PM)lpb19 Wrote: Could someone with more experience check the code? Input and output are working. DAC1 and DAC2 do not respond.
# placa ks868-a6
mqtt:
  switch:
  - name: 'KC868_A6-output-1'
    unique_id: KC868_A6-output-1
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    command_topic: 'KC868_A6/CC7B5C303EE0/SET'
    payload_on:  '{"output1":{"value":true}}'
    payload_off:  '{"output1":{"value":false}}'
    value_template: '{{ value_json.output1.value }}'
    state_on: true
    state_off: false

  - name: 'KC868_A6-output-2'
    unique_id: KC868_A6-output-2
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    command_topic: 'KC868_A6/CC7B5C303EE0/SET'
    payload_on:  '{"output2":{"value":true}}'
    payload_off:  '{"output2":{"value":false}}'
    value_template: '{{ value_json.output2.value }}'
    state_on: true
    state_off: false

  - name: 'KC868_A6-output-3'
    unique_id: KC868_A6-output-3
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    command_topic: 'KC868_A6/CC7B5C303EE0/SET'
    payload_on:  '{"output3":{"value":true}}'
    payload_off:  '{"output3":{"value":false}}'
    value_template: '{{ value_json.output3.value }}'
    state_on: true
    state_off: false

  - name: 'KC868_A6-output-4'
    unique_id: KC868_A6-output-4
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    command_topic: 'KC868_A6/CC7B5C303EE0/SET'
    payload_on:  '{"output4":{"value":true}}'
    payload_off:  '{"output4":{"value":false}}'
    value_template: '{{ value_json.output4.value }}'
    state_on: true
    state_off: false

  - name: 'KC868_A6-output-5'
    unique_id: KC868_A6-output-5
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    command_topic: 'KC868_A6/CC7B5C303EE0/SET'
    payload_on:  '{"output5":{"value":true}}'
    payload_off:  '{"output5":{"value":false}}'
    value_template: '{{ value_json.output5.value }}'
    state_on: true
    state_off: false

  - name: 'KC868_A6-output-6'
    unique_id: KC868_A6-output-6
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    command_topic: 'KC868_A6/CC7B5C303EE0/SET'
    payload_on:  '{"output6":{"value":true}}'
    payload_off:  '{"output6":{"value":false}}'
    value_template: '{{ value_json.output6.value }}'
    state_on: true
    state_off: false
   

  binary_sensor:
 
  - name: 'KC868_A6-input-1'
    unique_id: KC868_A6-input-1
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    value_template: '{{ value_json.input1.value }}'
    payload_on: true
    payload_off: false
   
  - name: 'KC868_A6-input-2'
    unique_id: KC868_A6-input-2
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    value_template: '{{ value_json.input2.value }}'
    payload_on: true
    payload_off: false
   
  - name: 'KC868_A6-input-3'
    unique_id: KC868_A6-input-3
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    value_template: '{{ value_json.input3.value }}'
    payload_on: true
    payload_off: false
   
  - name: 'KC868_A6-input-4'
    unique_id: KC868_A6-input-4
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    value_template: '{{ value_json.input4.value }}'
    payload_on: true
    payload_off: false
   
  - name: 'KC868_A6-input-5'
    unique_id: KC868_A6-input-5
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    value_template: '{{ value_json.input5.value }}'
    payload_on: true
    payload_off: false
   
  - name: 'KC868_A6-input-6'
    unique_id: KC868_A6-input-6
    state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
    value_template: '{{ value_json.input6.value }}'
    payload_on: true
    payload_off: false

  sensor:   
    - name: "Sensor 1 Temperature"
      unique_id: KC868_A6-sensor-temperature-1
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      value_template: "{{ value_json.sensor1.temperature }}"
      unit_of_measurement: "°C"
     
    - name: "Sensor 2 Temperature"
      unique_id: KC868_A6-sensor temperature-2
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      value_template: "{{ value_json.sensor2.temperature }}"
      unit_of_measurement: "°C"
     
     
    - name: "ADC-1"
      unique_id: KC868_A6-adc-1
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      value_template: "{{ value_json.adc1.value }}"
      unit_of_measurement: "Unità"
     
    - name: "ADC-2"
      unique_id: KC868_A6-adc-2
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      value_template: "{{ value_json.adc2.value }}"
      unit_of_measurement: "Unità"
     
    - name: "ADC-3"
      unique_id: KC868_A6-adc-3
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      value_template: "{{ value_json.adc3.value }}"
      unit_of_measurement: "Unità"
     
    - name: "ADC-4"
      unique_id: KC868_A6-adc-4
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      value_template: "{{ value_json.adc4.value }}"
      unit_of_measurement: "Unità"
     
     
  light:     
    - name: "dac1"
      unique_id: KC868_A6-dac1
      schema: template
      command_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      state_topic: 'KC868_A6/CC7B5C303EE0/STATE'
      command_on_template: >
      {%- if brightness is defined -%}
      ,{"dac1":{"value":{{(brightness / 255 * 100) | int - 1}}}
      {%- else -%}
      ,'{"dac1":{"value":99}}'
      {%- 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}}'

I Think your code looks correct, My KC868-A4 gives a similar problem;
When publishing a MQTT message with KC868_A4/XXXXXXXX/SET

The relay(s) respond to the output commands output1:{"value":true}
the dac(s) do not respond to the dac1:{"value":158} or any other value

Firmware in use : KCS_KC868_A4_V2.2.6.bin
think we found an issue with the mqtt integration

reg
Erik
Reply


Messages In This Thread
KCS firmware - MQTT LWT? - by Tarmas - 10-27-2023, 06:05 PM
RE: KCS firmware - MQTT LWT? - by admin - 10-28-2023, 12:27 AM
RE: KCS firmware - MQTT LWT? - by Tarmas - 11-07-2023, 07:06 PM
RE: KCS firmware - MQTT LWT? - by admin - 11-07-2023, 10:37 PM
RE: KCS firmware - MQTT LWT? - by Tarmas - 11-08-2023, 04:39 AM
RE: KCS firmware - MQTT LWT? - by admin - 11-08-2023, 06:30 AM
RE: KCS firmware - MQTT LWT? - by Fip - 01-08-2024, 08:42 PM
RE: KCS firmware - MQTT LWT? - by admin - 01-09-2024, 12:34 AM
RE: KCS firmware - MQTT LWT? - by DieterN - 03-11-2024, 07:30 AM
RE: KCS firmware - MQTT LWT? - by admin - 03-11-2024, 08:17 AM
RE: KCS firmware - MQTT LWT? - by DieterN - 03-11-2024, 09:10 AM
RE: KCS firmware - MQTT LWT? - by admin - 03-11-2024, 10:05 AM
RE: KCS firmware - MQTT LWT? - by DieterN - 03-11-2024, 11:16 AM
RE: KCS firmware - MQTT LWT? - by admin - 03-12-2024, 02:31 AM
RE: KCS firmware - MQTT LWT? - by admin - 03-12-2024, 02:48 AM
RE: KCS firmware - MQTT LWT? - by DieterN - 03-12-2024, 07:37 AM
RE: KCS firmware - MQTT LWT? - by admin - 03-12-2024, 11:45 AM
RE: KCS firmware - MQTT LWT? - by DieterN - 03-13-2024, 08:17 AM
RE: KCS firmware - MQTT LWT? - by lpb19 - 10-11-2024, 10:48 PM
RE: KCS firmware - MQTT LWT? - by erikwout - 11-03-2024, 12:02 AM
RE: KCS firmware - MQTT LWT? - by admin - 11-03-2024, 01:07 AM
RE: KCS firmware - MQTT LWT? - by erikwout - 11-03-2024, 08:13 AM
RE: KCS firmware - MQTT LWT? - by admin - 11-03-2024, 08:21 AM
RE: KCS firmware - MQTT LWT? - by erikwout - 11-03-2024, 09:34 AM
RE: KCS firmware - MQTT LWT? - by Witwicki - 11-03-2024, 10:34 AM
RE: KCS firmware - MQTT LWT? - by Witwicki - 11-03-2024, 01:22 PM
RE: KCS firmware - MQTT LWT? - by admin - 11-04-2024, 10:29 AM
RE: KCS firmware - MQTT LWT? - by Witwicki - 11-04-2024, 07:53 PM
RE: KCS firmware - MQTT LWT? - by admin - 11-05-2024, 12:17 AM
RE: KCS firmware - MQTT LWT? - by Witwicki - 11-05-2024, 07:48 AM
RE: KCS firmware - MQTT LWT? - by erikwout - 11-05-2024, 12:00 PM
RE: KCS firmware - MQTT LWT? - by erikwout - 11-06-2024, 09:27 PM
RE: KCS firmware - MQTT LWT? - by admin - 11-06-2024, 11:32 PM
RE: KCS firmware - MQTT LWT? - by admin - 11-09-2024, 12:02 PM
RE: KCS firmware - MQTT LWT? - by admin - 11-11-2024, 11:15 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)