Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-Server integrate to home asssitant by MQTT configuration.yaml
#13
I am facing the same , used the sample yaml but gives errors. So i had to modify it. but the relays do not respond.

I have changed the code for relay1 but that does not work either.

Code:
default_config:

tts:
  - platform: google_translate

mqtt:
  - switch:
       - name: "KC_relay1"
         unique_id: output-1
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/relay/set’
         payload_on:  "on"
         payload_off:  "off"
         value_template: ‘{{ value_json.relay1.on }}’
         state_on: 1
         state_off: 0

       - name: "KC_relay2"
         unique_id: output-2
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay2":{"on":1}}'
         payload_off:  '{"relay2":{"on":0}}'
         value_template: '{{ value_json.relay2.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay3"
         unique_id: output-3
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay3":{"on":1}}'
         payload_off:  '{"relay3":{"on":0}}'
         value_template: '{{ value_json.relay3.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay4"
         unique_id: output-4
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay4":{"on":1}}'
         payload_off:  '{"relay4":{"on":0}}'
         value_template: '{{ value_json.relay4.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay5"
         unique_id: output-5
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay5":{"on":1}}'
         payload_off:  '{"relay5":{"on":0}}'
         value_template: '{{ value_json.relay5.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay6"
         unique_id: output-6
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay6":{"on":1}}'
         payload_off:  '{"relay6":{"on":0}}'
         value_template: '{{ value_json.relay6.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay7"
         unique_id: output-7
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay7":{"on":1}}'
         payload_off:  '{"relay7":{"on":0}}'
         value_template: '{{ value_json.relay7.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay8"
         unique_id: output-8
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay8":{"on":1}}'
         payload_off:  '{"relay8":{"on":0}}'
         value_template: '{{ value_json.relay8.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay9"
         unique_id: output-9
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay9":{"on":1}}'
         payload_off:  '{"relay9":{"on":0}}'
         value_template: '{{ value_json.relay9.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay10"
         unique_id: output-10
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay10":{"on":1}}'
         payload_off:  '{"relay10":{"on":0}}'
         value_template: '{{ value_json.relay10.on }}'
         state_on: 1
         state_off: 0

       - name: "KC_relay11"
         unique_id: output-11
         state_topic: ‘server/7ffd88f939adfbe3340ee686/state’
         command_topic: ‘server/7ffd88f939adfbe3340ee686/set’
         payload_on:  '{"relay11":{"on":1}}'
         payload_off:  '{"relay11":{"on":0}}'
         value_template: '{{ value_json.relay11.on }}'
         state_on: 1
         state_off: 0
Reply


Messages In This Thread
RE: KC868-Server integrate to home asssitant by MQTT configuration.yaml - by zakhan - 02-16-2024, 02:07 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)