I setup my first automation to auto arm/disarm a simplisafe alarm I have installed at a vacant property. I am currently trying to sell the property so I could potentially have realtors showing the house during the day. Instead of having them have to remember to arm the alarm when they’re done. I just want the alarm to be off during the day, auto arming at night and auto disarming in the morning.
Below is what I came up with. The triggers haven’t occurred yet but one thing that made me suspect there might be a problem is that Automation shows up on the front page but Automation2 doesn’t. Unfortunately being new to HA I’m not sure what the expected behavior is and couldn’t find any info specific to “Automation rules not showing on the frontend.”
Also if anyone has any suggestions on a better or more efficient way to do this i’d appreciate the feedback.
I know you’re asking about displayed values, but, FYI, you can also customize the names of things by using a customize: block. It’s a child of homeassistant:
And if you want fine-grained control over the values that display, you can create template sensors that reflect the value of other sensors:
So I found this bit of code in the ha-state-label-badge.html file. Is this file on my RP3 somewhere or is HA calling back to github? Still pretty new to linux, github, and HA. So still figuring out how everything ties together.
Code Snippet
computeLabel: function (state) {
if (state.state === 'unavailable') {
return 'unavai';
}
switch (state.domain) {
case 'device_tracker':
return state.state === 'not_home' ? 'Away' : state.state;
case 'alarm_control_panel':
if (state.state === 'pending') {
return 'pend';
} else if (state.state === 'armed_away' || state.state === 'armed_home') {
return 'armed';
} else if (state.state === 'triggered') {
return 'trig';
}
// state == 'disarmed'
return 'disarm'; #<----Here is where the badge text is being defined
default:
return state.attributes.unit_of_measurement || null;
}
},
As an extension of what @ih8gates was mentioning, here’s how I reformatted the display of some sensors to make more sense in the front end. Templates are extremely powerful!
I use a split configuration setup, so that’s why your not seeing it like you may be used to. (I’ll link to that at the end). What your seeing in the code example is part of my sensors.yaml file. It’s included in the configuration file like this:
I can’t seem to get this to work. I started off with something that would seem simple. Something that I already know is working. Zone. I created a zone for work. So I cut the zone from config.yaml and patsed it into a new yaml file named zones. Saved that in the same dir as the config.yaml. After making this change I can’t log back into HA. I get an “Unexpected result from API” error. Checked for any indent errors. Also ran tab to space in notepad++ just to make sure.
Configuration.yaml
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: __redacted__
longitude: __redacted__
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 139
# metric for Metric, imperial for Imperial
unit_system: imperial
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/New_York
# Show links to resources in log and frontend
introduction:
# Enables the frontend
frontend:
http:
# Uncomment this to add a password (recommended!)
api_password: __redacted__
ssl_certificate: __redacted__
ssl_key: __redacted__
zone: !include zones.yaml
# Checks for available updates
updater:
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time.
history:
# View all events in a logbook
logbook:
# Track the sun
sun:
# Weather Prediction
sensor:
platform: yr
mqtt:
broker: __redacted__
port: 18857
client_id: home-assistant-1
keepalive: 60
username: __redacted__
password: __redacted__
birth_message:
topic: 'hass/status'
payload: 'online'
qos: 1
retain: true
will_message:
topic: 'hass/status'
payload: 'offline'
qos: 1
retain: true
device_tracker:
- platform: owntracks
# Simplisafe Control Panel
alarm_control_panel:
platform: simplisafe
username: __redacted__
password: __redacted__
automation:
- alias: Disable Alarm
trigger:
platform: sun
event: sunrise
condition:
condition: state
entity_id: alarm_control_panel.simplisafe
state: 'armed_away'
action:
service: alarm_control_panel.alarm_disarm
entity_id: alarm_control_panel.simplisafe
- alias: Enable Alarm
trigger:
platform: time
after: '22:00:00'
condition:
condition: state
entity_id: alarm_control_panel.simplisafe
state: 'disarmed'
action:
service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.simplisafe
zones.yaml
- name: Work
latitude: __redacted__
longitude: __redacted__
radius: 250
icon: mdi:briefcase
also tried:
- name: Work
latitude: __redacted__
longitude: __redacted__
radius: 250
icon: mdi:briefcase
Believe it was permissions issue. I have a samba share setup and I created the yaml file in Notepad++ on windows and saved it to the HA config directory. After doing an ls -la though putty i noticed all dir/files were owned by hass except zones.yaml, it was owned by root. Fixed that and after what seemed like forever I’m now able to get back in.
If you look at home-assistant.log in the same folder as your YAML, you’ll get a hint to what’s going awry.
Keep in mind the formatting for the platform you’re using. Some use lists (things that start with a hyphen/minus). But zones (like scripts and groups and others) don’t. So inside zones.yaml, you’d want:
zone:
name: Work
latitude: __redacted__
longitude: __redacted__
radius: 250
icon: mdi:briefcase
zone 2:
name: Home
etc...
Look to the components instructions for syntax. And when you split your config, the text usually starts at the left margin.
Here’s what I’m using and I have no errors and my zones are showing up in the map so I’m not sure that’s correct. (Nothing redacted becuase they are all public places)
#
# Zones
#
- name: Somerset Shopping Center
latitude: 40.577232
longitude: -74.627472
radius: 25
icon: mdi:store
- name: Watchung Shopping Center
latitude: 40.639901
longitude: -74.423001
radius: 25
icon: mdi:store
- name: Blue Star Shopping Center
latitude: 40.6511783
longitude: -74.4087588
radius: 25
icon: mdi:cart-outline
- name: Wilson Borough
latitude: 40.677898
longitude: -75.243573
radius: 100
icon: mdi:home-variant