Created
May 21, 2021 16:36
-
-
Save pedrolamas/fb6aa1600fca1be9104600947d143484 to your computer and use it in GitHub Desktop.
Revisions
-
pedrolamas created this gist
May 21, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ 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