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.
REST Sensor for LTA Traffic
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment