Skip to content

Instantly share code, notes, and snippets.

@pedrolamas
Created May 21, 2021 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrolamas/fb6aa1600fca1be9104600947d143484 to your computer and use it in GitHub Desktop.
Save pedrolamas/fb6aa1600fca1be9104600947d143484 to your computer and use it in GitHub Desktop.
Home Assistant sensor for IKEA Tradfri feed update check
sensor:
- platform: command_line
name: IKEA Tradfri OTA feed
command: >-
python3 -c "import hashlib, json, requests; response = requests.get('http://fw.ota.homesmart.ikea.net/feed/version_info.json'); ret = { 'ETag': response.headers.get('ETag'), 'Date': response.headers.get('Date'), 'Hash': hashlib.sha256(response.content).hexdigest() }; print(json.dumps(ret))"
value_template: '{{ value_json.Hash }}'
json_attributes:
- Date
- ETag
scan_interval: 10800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment