Skip to content

Instantly share code, notes, and snippets.

@chpeck
Created November 3, 2022 05:51
Show Gist options
  • Save chpeck/402a54d24dfa7c555883328dccf145ed to your computer and use it in GitHub Desktop.
Save chpeck/402a54d24dfa7c555883328dccf145ed to your computer and use it in GitHub Desktop.

Revisions

  1. chpeck created this gist Nov 3, 2022.
    18 changes: 18 additions & 0 deletions configuration.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    rest:
    - resource: https://api.data.gov.sg/v1/transport/traffic-images
    scan_interval: 300
    sensor:
    - name: Causeway
    json_attributes_path: '$.items[0].cameras[?(@.camera_id == "2701")]'
    json_attributes:
    - image
    - camera_id
    - timestamp
    value_template: 'OK'
    - name: Tuas
    json_attributes_path: '$.items[0].cameras[?(@.camera_id == "2702")]'
    json_attributes:
    - image
    - camera_id
    - timestamp
    value_template: 'OK'