Flow Details
- You need to create a sensor in the configuration.yaml file or add a link to the file where the Instagram sensor is recorded. In my case, I added the following lines to the configuration.yaml:
homeassistant:
packages: !include_dir_merge_named includes/packages
Place the instagram.yaml file in the packages folder. In the instagram.yaml file, in the resource_template: template, enter your channel name (YOURS_NAME). Run the instagram sensor (scan_interval) no more than once every 2 hours!
-
Create your automation. I added my automation to the automations.yaml file. In this file, set your AWTRIX MQTT prefix in topic: instead of awtrix_565c3c.
-
Do not forget to download the icons mentioned in the project: instagram.
If you have any questions, please contact me on Discord at megadimich.
1. File instagram.yaml:
instagram_sensor:
sensor:
- platform: rest
name: instagram_api
resource_template: "https://i.instagram.com/api/v1/users/web_profile_info/?username=YOURS_NAME"
method: GET
headers:
content-type: 'application/json'
user-agent: 'Instagram 76.0.0.15.395 Android (24/7.0; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890; en_US; 138226743)'
value_template: "{{ value_json.data.user.edge_followed_by.count }}"
json_attributes:
- "data"
scan_interval: 7200 # 2 Hours
2. File automations.yaml:
- id: '1703179553265'
alias: 'AWTRIX: Monitoring Instagram'
description: ''
trigger:
- platform: time_pattern
minutes: /2
condition: []
action:
- service: mqtt.publish
data:
qos: '0'
retain: false
topic: awtrix_565c3c/custom/instagram
payload: '{"icon": "instagram", "text": "{{ states(''sensor.instagram_api'')}}", "duration": 5 }'
mode: single
-- Flow first published on January 3, 2024.