#-------------------------------------------
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# Try to leverage iPhone Mobile App Data for Activity Tweets!
# You can read more about this on https://www.vCloudInfo.com
#-------------------------------------------

##############################################################################
###  Automations
##############################################################################
automation:
  - alias: 'Step Tracker' # https://github.com/CCOSTAN/Home-AssistantConfig/issues/786
    id: 9d6bd104-d51f-4d1c-9812-35073bb02c0c
    trigger:
      - platform: numeric_state
        entity_id:
          - sensor.carlo_xsmax_steps
          - sensor.paige_6s_steps
          - sensor.steps_3
        above: 5000

    action:
      - service: script.tweet_engine_image
        data_template:
          tweet: >
            {{ [
            "Somebody just hit {{ states('trigger.entity_id') }} steps on the #Fitbit!",
            "Keep on moving.  Somebody just hit {{ states('strigger.entity_id') }} #Fitbit steps.",
            "#Fitness Tracking at home BY the home. Somebody just hit {{ states('trigger.entity_id') }} #Fitbit steps"
            ] | random + " #Self #Data"}}
          image: >-
            {{ [
            "/config/www/custom_ui/floorplan/images/branding/fitness.png",
            "/config/www/custom_ui/floorplan/images/branding/fitness2.png",
            "/config/www/custom_ui/floorplan/images/branding/fitness3.png"
            ] | random }}