diff --git a/src/components/entity/ha-state-label-badge.js b/src/components/entity/ha-state-label-badge.js
index acaa4703d6..6dcf8193fe 100644
--- a/src/components/entity/ha-state-label-badge.js
+++ b/src/components/entity/ha-state-label-badge.js
@@ -66,6 +66,7 @@ export default new Polymer({
case 'sun':
case 'scene':
case 'script':
+ case 'alarm_control_panel':
return undefined;
case 'sensor':
return state.attributes.unit_of_measurement && state.state;
@@ -76,6 +77,9 @@ export default new Polymer({
computeIcon(state) {
switch (state.domain) {
+ case 'alarm_control_panel':
+ return state.state === 'disarmed' ?
+ 'icons:lock-open' : 'icons:lock';
case 'device_tracker':
return !state.attributes.entity_picture && domainIcon(state.domain);
case 'scene':
@@ -109,6 +113,8 @@ export default new Polymer({
return state.attributes.unit_of_measurement || state.state;
case 'device_tracker':
return state.state === 'not_home' ? 'Away' : state.state;
+ case 'alarm_control_panel':
+ return state.state;
default:
return state.attributes.unit_of_measurement;
}
diff --git a/src/components/ha-zone-cards.js b/src/components/ha-zone-cards.js
index 8c6430f15c..720c1e237e 100644
--- a/src/components/ha-zone-cards.js
+++ b/src/components/ha-zone-cards.js
@@ -12,9 +12,10 @@ const PRIORITY = {
a: -1,
sun: 0,
device_tracker: 1,
- sensor: 2,
- scene: 3,
- script: 4,
+ alarm_control_panel: 2,
+ sensor: 3,
+ scene: 4,
+ script: 5,
thermostat: 40,
media_player: 50,
camera: 60,
diff --git a/src/more-infos/more-info-alarm_control_panel.html b/src/more-infos/more-info-alarm_control_panel.html
new file mode 100644
index 0000000000..512b529b6f
--- /dev/null
+++ b/src/more-infos/more-info-alarm_control_panel.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
Disarm
+
Arm Home
+
Arm Away
+
+
+
diff --git a/src/more-infos/more-info-alarm_control_panel.js b/src/more-infos/more-info-alarm_control_panel.js
new file mode 100644
index 0000000000..f183e4b2a0
--- /dev/null
+++ b/src/more-infos/more-info-alarm_control_panel.js
@@ -0,0 +1,33 @@
+import { serviceActions } from '../util/home-assistant-js-instance';
+
+import Polymer from '../polymer';
+import attributeClassNames from '../util/attribute-class-names';
+
+const ATTRIBUTE_CLASSES = [];
+
+export default new Polymer({
+ is: 'more-info-alarm_control_panel',
+ handleDisarmTap(number) {
+ this.callService('alarm_disarm', {code: this.entered_code});
+ },
+ handleHomeTap(number) {
+ this.callService('alarm_arm_home', {code: this.entered_code});
+ },
+ handleAwayTap(number) {
+ this.callService('alarm_arm_away', {code: this.entered_code});
+ },
+ properties: {
+ entered_code: {
+ type: String,
+ value: '',
+ },
+ },
+ enteredCodeChanged(ev) {
+ this.entered_code = ev.target.value;
+ },
+ callService(service, data) {
+ const serviceData = data || {};
+ serviceData.entity_id = this.stateObj.entityId;
+ serviceActions.callService('alarm_control_panel', service, serviceData);
+ },
+});
diff --git a/src/more-infos/more-info-content.html b/src/more-infos/more-info-content.html
index 1e7a028c72..f7b59075b1 100644
--- a/src/more-infos/more-info-content.html
+++ b/src/more-infos/more-info-content.html
@@ -10,6 +10,7 @@
+