Get a sensor value on your Apple Watch

I started playing with this last week, ended up using the modular watch face to include 4 elements available in the Glances API that @jenslj linked to.

Title (Top in blue)
Text (Middle)
Subtext (Bottom)
Percent (Can be anywhere where you can put an icon, in my example it’s bottom right and was set to ‘count’ rather than percentage in my screenshots… doh!)

I now have 3 main different modules that change depending on presence at home:

If I’m home:
17-10-06 01-07-15 5680

  • Title: Current Weather Summary at Home

  • Text: Home Energy Consumption in Watts, Nest Thermostat Temperature (Soon to be replaced with a house average across multiple temp sensors), and How many times my letter box was opened today (Between midnight > midnight)

  • SubText: How many lights are on, How many Doors and/or Windows are open

  • Percentage(bottom right): Probability of rain at Home.

If I’m not Home but someone else is Home:
17-10-06 01-15-06 5682

  • Title: Alarm Panel Status, followed by the initials of people at home (could be any combination of 3 other people)

  • Text: Home Energy Consumption in Watts, Nest Thermostat Temperature (Soon to be replaced with a house average across multiple temp sensors), and How many times my letter box was opened today (Between midnight > midnight)

  • SubText: How many lights are on, How many Doors and/or Windows are open

  • Percentage(bottom right): Probability of rain at Home.

When no one is home:
17-10-06 01-18-58 5683

  • Title: Alarm Panel Status, Status of my presence simulation script.

  • Text: How many times someone has triggered front door motion while no one was at home, and How many times my letter box was opened today (Between midnight > midnight)

  • SubText: How many lights are on, How many Doors and/or Windows are open

  • Percentage(bottom right): Probability of rain at Home

Shell Command:

shell_command:
  pushover_glance: 'curl --data "token=token&user=user&title={{ states.sensor.pushover_title_glance.state }}&text={{ states.sensor.pushover_text_glance.state }}&subtext=Lights:{{ states.sensor.lights_on.state }} Door/Win:{{ states.sensor.doors_open.state }}&percent={{ states.sensor.dark_sky_precip_probability.state }}" https://api.pushover.net/1/glances.json'

Sensors:

- platform: template
  sensors:
      
    pushover_title_glance:
      friendly_name: "Alarm Glance"
      value_template: >-
        {% if is_state('input_boolean.mike_home', 'off') %}
          {% if is_state('alarm_control_panel.ha_alarm', 'armed_away') %}Armed Away{% else %}{% endif %}{% if is_state('input_boolean.presence_simulation', 'on') %}:SimON{% else %}{% endif %}{% if is_state('alarm_control_panel.ha_alarm', 'armed_home') %}ArmHome:{% else %}{% endif %}{% if is_state('alarm_control_panel.ha_alarm', 'disarmed') %} {% if is_state('group.household', 'on') %}Home:{% else %}{% endif %} {% if is_state('group.household', 'off') %}House Empty{% else %}{% endif %}{% else %}{% endif %}{% if is_state('alarm_control_panel.ha_alarm', 'pending') %}Pend{% else %}{% endif %}{% if is_state('group.alex', 'home') %}AJ{% else %}{% endif %} {% if is_state('group.joy', 'home') %}JK{% else %}{% endif %} {% if is_state('group.patrick', 'home') %}PK{% else %}{% endif %}
        {% elif is_state('input_boolean.mike_home', 'on') %}
          {% if is_state('alarm_control_panel.ha_alarm', 'disarmed') %}{{ states.sensor.dark_sky_summary.state }}{% else %}{% endif %}{% if is_state('alarm_control_panel.ha_alarm', 'armed_home') %}Armed Home{% else %}{% endif %}
        {% else %}
          Error
        {% endif %}
        
    pushover_text_glance:
      friendly_name: "Pushover Text Glance"
      value_template: >-
        {% if is_state('group.household', 'on') %}
          {{ states.sensor.mains_electricity_energy_usage.state }}w {{ states.climate.living_room.attributes.current_temperature }}° Mail:{{ states.counter.letters_today.state }}
        {% elif is_state('group.household', 'off') %}
          Motion:{{ states.counter.door_motion_away.state }} Mail:{{ states.counter.letters_today.state }}
        {% else %}
          Error
        {% endif %}
        
    lights_on:
      friendly_name: "Lights On"
      value_template: >-
        {% for state in states.light if state.state == 'on' %}{% if loop.last %}{{loop.index}}{% endif %}{% endfor %}
        
    doors_open:
      friendly_name: "Doors Open"
      value_template: >-
        {% for state in states.sensor if state.state == 'open' %}{% if loop.last %}{{loop.index}}{% endif %}{% endfor %}

Counters:

counter:
  letters_today:
    initial: 0
    step: 1

  door_motion_away:
    initial: 0
    step: 1

Automation:

NOTE: Remember to add “seconds” to the time trigger, other wise it will trigger a Pushover API update every second on the half hour (60 times), 86,400 times in a month! limit for free Pushover messages is 7,500 a month, I learnt this the hard way, haha!

- alias: Update Pushover Complication 
  initial_state: 'on'
  trigger:
   - minutes: '/30'
     seconds: 00
     platform: time
  action:
    - service: shell_command.pushover_glance

I have also tagged this as an action:

- service: shell_command.pushover_glance

in automations that trigger on presence changes or alarm state changes (doesn’t seem to be using too many API posts to PO) using around 50 a day in total, so 1,500 a month.

This is how I’m using my counters and also resetting them in Automations:

- alias: Front Door Motion Counter While Away
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: binary_sensor.door_cam_motion
    to: 'on'

  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: alarm_control_panel.ha_alarm
        state: 'armed_away'

  action:
    - service: counter.increment
      entity_id: counter.door_motion_away
    - service: shell_command.pushover_glance
      
- alias: Front Door Motion Counter White Away Reset
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: alarm_control_panel.ha_alarm
      from: 'armed_away'
    - platform: time
      at: '00:00:00'
      


  action:
    - service: counter.reset
      entity_id: counter.door_motion_away
    - service: shell_command.pushover_glance
    
- alias: Letters Today Midnight Reset
  initial_state: 'on'
  trigger:
    - platform: time
      at: '00:00:00'

  action:
    - service: counter.reset
      entity_id: counter.letters_today
    - service: shell_command.pushover_glance

It could do with a tidy up, and I think I’ll end up changing things as I find more/less useful features but it’s been really handy the last weeks knowing who’s home, how much energy is being used (left the oven on this week and noticed high wattage on watch), how many doors/windows are open before I go to bed and peace of mind with alarm glance.

Hopefully someone will find it useful, adapt, improve, simplify :slight_smile:

Thanks again @jenslj for the inspiration and guide!

7 Likes