Skip to main content

Webex Status Light

Place in configuration.yaml

command_line: !include command_line.yaml
automation: !include automations.yaml


Place in command_line.yaml

command_line:
  - sensor:
      name: Webex Status Curl
      command: "curl -H 'Authorization:Bearer <long-lived token>' https://webexapis.com/v1/people/<your person ID>"
      # Since the response is JSON, we can parse out the Status key
      value_template: "{{ value_json.status }}"
      scan_interval: 10


Place in automations.yaml

- id: '1690190769903'
  alias: Webex Teams DND Update
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.webex_status_curl
  condition: []
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: active
      sequence:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: call
      sequence:
      - service: light.turn_on
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: DoNotDisturb
      sequence:
      - service: light.turn_on
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: inactive
      sequence:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: meeting
      sequence:
      - service: light.turn_on
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: OutOfOffice
      sequence:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: pending
      sequence:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: presenting
      sequence:
      - service: light.turn_on
        data: {}
        target:
          entity_id: light.brian_dnd_light
    - conditions:
      - condition: state
        entity_id: sensor.webex_status_curl
        state: unknown
      sequence:
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.brian_dnd_light
    default:
    - service: light.turn_on
      data: {}
      target:
        entity_id: light.brian_dnd_light
  mode: single