Closed 17844 closed 3 years ago
You have an invalid character or formating issue somewhere in the yaml before line 43. It might have happened while you were editing. I can't see it in what you posted since the formating is missing from your paste. Also not sure if this is a cut and paste issue but the normal dash (-) yaml character looks like a dot in your post.
Hello thanks for in general great work.
After latest update of Esphome I get this error when I try to validate:
INFO Reading configuration /config/esphome/DscAlarm.yaml... ERROR Error while reading config: Invalid YAML syntax:
while scanning a simple key in "/config/esphome/DscAlarm.yaml", line 41, column 3: auto DSCkeybus = new DSCkeybusho ... ^ could not find expected ':' in "/config/esphome/DscAlarm.yaml", line 43, column 3: DSCkeybus->accessCode="$accessCode"; ^
Here is my yaml: substitutions: systemName: "tradgards_alarm" accessCode: !secret tradgards_access_code #Only comes into effect if a password prompt occurs when arming eg. night mode cmdWaitTime: "0" # milliseconds. set how long to delay before accepting a new 05 cmd as valid to filter out intermittent short duration bogus commands that some panels send. default = 0
esphome: name: $systemName platform: ESP8266 board: nodemcuv2
includes:
wifi: ssid: !secret wifi_ssid password: !secret wifi_password
ap: ssid: "$systemName" password: !secret wifi_password
logger: baud_rate: 0 level: info
api: password: !secret api_password
ota: password: !secret ota_password safe_mode: True
status_led: pin: number: D4 inverted: yes
custom_component:
lambda: |- auto DSCkeybus = new DSCkeybushome();
DSCkeybus->accessCode="$accessCode"; DSCkeybus->cmdWaitTime=$cmdWaitTime; DSCkeybus->debug=1; // 0 = off, 1 = minimal, 2 = all packets shown on console 3 = + serial port debugging DSCkeybus->expanderAddr1=$expanderAddr1; //zone expander DSCkeybus->expanderAddr2=$expanderAddr2;
DSCkeybus->onSystemStatusChange([&](std::string statusCode) { id(system_status).publish_state(statusCode); });
DSCkeybus->onPartitionStatusChange([&](uint8_t partition,std::string statusCode) { switch(partition) { case 1: id(p1).publish_state(statusCode); break; } // if you only have one partition, remove the case 2 and corresponding p2 sensor. You can also add more partitions if needed });
DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) { switch(partition) { case 1: id(m1).publish_state(msg); break; } // if you only have one partition, remove the case 2 statement and corresponding p2 sensor. You can also add more partitions if needed });
DSCkeybus->onTroubleStatusChange([&](troubleStatus ts,bool open) { switch(ts) { case trStatus: id(tr).publish_state(open);break; case batStatus: id(bat).publish_state(open);break; case acStatus: id(ac).publish_state(open);break; case panicStatus: id(panic).publish_state(open);break; default: break; } }); DSCkeybus->onZoneMsgStatus([&](std::string msg) { id(zone_status).publish_state(msg); }); DSCkeybus->onFireStatusChange([&](uint8_t partition, bool open) { switch (partition) { case 1: id(f1).publish_state(open); break; } }); DSCkeybus->onTroubleMsgStatus([&](std::string msg) { id(tr_msg).publish_state(msg); }); DSCkeybus->onZoneStatusChange([&](uint8_t zone, bool open) { switch (zone) { case 1: id(z1).publish_state(open); break; case 2: id(z2).publish_state(open); break; case 3: id(z3).publish_state(open); break; case 4: id(z6).publish_state(open); break; } // add or delete any zone you need above. Add the coresponding sensor id in the binary_sensor section }); DSCkeybus->onRelayChannelChange([&](uint8_t channel, bool state) { switch (channel) { case 1: id(r1).publish_state(state); break; case 2: id(r2).publish_state(state); break; case 3: id(r3).publish_state(state); break; case 4: id(r4).publish_state(state); break; case 5: id(r5).publish_state(state); break; case 6: id(r6).publish_state(state); break; case 7: id(r7).publish_state(state); break; case 8: id(r8).publish_state(state); break; } }); return {DSCkeybus};
binary_sensor:
zone status
platform: template id: z1 name: "$systemName Hall Motion" device_class: motion
platform: template id: z2 name: "$systemName Kök Motion" device_class: motion
platform: template id: z3 name: "$systemName Brand Rökdetector" device_class: smoke
platform: template id: z6 name: "$systemName Panelsabotage" device_class: window
zone alarm status
platform: template id: za1 name: "$systemName Hall Alarm"
device_class: safety
platform: template id: za2 name: "$systemName Kok Alarm"
device_class: safety
platform: template id: za3 name: "$systemName Brand Alarm"
device_class: safety
platform: template id: za6 name: "$systemName Panelsabotage Alarm"
device_class: safety
platform: template id: tr name: "$systemName Trouble Status" device_class: problem
platform: template id: bat name: "$systemName Battery Status" device_class: problem
platform: template id: ac name: "$systemName AC Status" device_class: plug
platform: template id: panic name: "$systemName Panic Status" device_class: safety
platform: template id: f1 device_class: safety name: "$systemName Fire Status"
text_sensor:
general system status online/disconnected
battery level status for wireless channels, tamper , in alarm, etc for individual zones
partition status ie read/unavailable, in alarm, etc
switch: