Closed thunderwood19 closed 3 years ago
The dscalarm.yaml format is different with the dev and master versions. The master yaml only works with the master branch library. If you use the deb branch you must use the dev yaml since a few things are changed such as the missing onzonealarmchange call.
config:
for documentation see project at https://github.com/Dilbert66/esphome-dsckeybus
substitutions: systemName: "dscalarm" accessCode: !secret code 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: d1_mini
includes:
wifi: ssid: !secret wifi_ssid password: !secret wifi_password domain: ".iot.locallan.digitalmetaverse.com" manual_ip: static_ip: 192.168.101.58 gateway: 192.168.101.2 subnet: 255.255.255.0 logger: baud_rate: 0 level: debug
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=2; // 0 = off, 1 = status change data, 2 = + 05/27 packets, 3 = + all packets received
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; case 2: id(p2).publish_state(statusCode); break; } }); DSCkeybus->onPartitionMsgChange([&](uint8_t partition,std::string msg) { switch(partition) { case 1: id(m1).publish_state(msg); break; case 2: id(m2).publish_state(msg); break; } }); 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->onFireStatusChange([&](uint8_t partition, bool open) { switch (partition) { case 1: id(f1).publish_state(open); break; } }); DSCkeybus->onZoneStatusChange([&](uint8_t zone, bool open) { switch (zone) { case 9: id(z9).publish_state(open); break; case 10: id(z10).publish_state(open); break; case 11: id(z11).publish_state(open); break; case 12: id(z12).publish_state(open); break; case 13: id(z13).publish_state(open); break; } }); DSCkeybus->onZoneAlarmChange([&](uint8_t zone, bool open) { switch (zone) { case 9: id(za9).publish_state(open); break; case 10: id(za10).publish_state(open); break; case 11: id(za11).publish_state(open); break; case 12: id(za12).publish_state(open); break; case 13: id(za13).publish_state(open); break; } }); return {DSCkeybus};
binary_sensor:
zone status
platform: template id: z9 name: "$systemName Garage Entry" device_class: door
platform: template id: z10 name: "$systemName Main Entrance" device_class: door
platform: template id: z11 name: "$systemName South West Deck" device_class: door
platform: template id: z12 name: "$systemName South Patio" device_class: door
platform: template id: z13 name: "$systemName Living Room Motion" device_class: motion
zone alarm status
device_class: safety
platform: template id: za9 name: "$systemName Garage Entry alarm"
device_class: safety
platform: template id: za10 name: "$systemName Main Entrance alarm"
device_class: safety
platform: template id: za11 name: "$systemName South West Deck alarm"
device_class: safety
platform: template id: za12 name: "$systemName South Patio alarm"
device_class: safety
platform: template id: za13 name: "$systemName Living Room Motion 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:
switch: