09-28-2022, 03:41 PM
Hello Guys,
I have KC868 Server connected to HA by mqtt, i can read the entities and works well, in the relay board i connect 5 different lights also i add a wall switch which i connected to relay board and make an automation in HA to read the state of lights.
To connect relay and HA i manually add code to configuration yaml file.
My problem is that i have errors since i add switch code to yaml file. what im doing wrong??
Keep in mind that the automation works but when i press the button it has a delay 3 sec until light on
this is log details
Error parsing value: ‘dict object’ has no attribute ‘sw12’ (value: {“relay1”:{“on”:1},“relay2”:{“on”:1},“relay3”:{“on”:1},“relay4”:{“on”:1},“relay5”:{“on”:0},“relay6”:{“on”:0},“relay7”:{“on”:0},“relay8”:{“on”:0},“relay9”:{“on”:0},“relay10”:{“on”:0},“relay11”:{“on”:0},“relay12”:{“on”:0},“relay13”:{“on”:0},“relay14”:{“on”:0},“relay15”:{“on”:0},“relay16”:{“on”:0},“input1”:{“on”:0},“input2”:{“on”:0},“input3”:{“on”:0},“input4”:{“on”:0},“input5”:{“on”:0},“input6”:{“on”:0},“input7”:{“on”:0},“input8”:{“on”:0},“analog1”:{“value”:0},“analog2”:{“value”:0},“analog3”:{“value”:1},“analog4”:{“value”:1}}, template: {{ value_json.sw12.on }})
Template variable error: ‘dict object’ has no attribute ‘sw12’ when rendering ‘{{ value_json.sw12.on }}’
my code is:
binary_sensor:
name: ‘sw12’
unique_id: sw-12
state_topic: ‘server/xxxxxxxxxxxxxxxxxxxxxxxx/state’
value_template: ‘{{ value_json.sw12.on }}’
payload_on: 1
payload_off: 0
I have KC868 Server connected to HA by mqtt, i can read the entities and works well, in the relay board i connect 5 different lights also i add a wall switch which i connected to relay board and make an automation in HA to read the state of lights.
To connect relay and HA i manually add code to configuration yaml file.
My problem is that i have errors since i add switch code to yaml file. what im doing wrong??
Keep in mind that the automation works but when i press the button it has a delay 3 sec until light on
this is log details
Error parsing value: ‘dict object’ has no attribute ‘sw12’ (value: {“relay1”:{“on”:1},“relay2”:{“on”:1},“relay3”:{“on”:1},“relay4”:{“on”:1},“relay5”:{“on”:0},“relay6”:{“on”:0},“relay7”:{“on”:0},“relay8”:{“on”:0},“relay9”:{“on”:0},“relay10”:{“on”:0},“relay11”:{“on”:0},“relay12”:{“on”:0},“relay13”:{“on”:0},“relay14”:{“on”:0},“relay15”:{“on”:0},“relay16”:{“on”:0},“input1”:{“on”:0},“input2”:{“on”:0},“input3”:{“on”:0},“input4”:{“on”:0},“input5”:{“on”:0},“input6”:{“on”:0},“input7”:{“on”:0},“input8”:{“on”:0},“analog1”:{“value”:0},“analog2”:{“value”:0},“analog3”:{“value”:1},“analog4”:{“value”:1}}, template: {{ value_json.sw12.on }})
Template variable error: ‘dict object’ has no attribute ‘sw12’ when rendering ‘{{ value_json.sw12.on }}’
my code is:
binary_sensor:
name: ‘sw12’
unique_id: sw-12
state_topic: ‘server/xxxxxxxxxxxxxxxxxxxxxxxx/state’
value_template: ‘{{ value_json.sw12.on }}’
payload_on: 1
payload_off: 0