Created
May 21, 2021 16:36
-
-
Save pedrolamas/fb6aa1600fca1be9104600947d143484 to your computer and use it in GitHub Desktop.
Home Assistant sensor for IKEA Tradfri feed update check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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