######################################################################################################
###Script to send notifications to Twitter as @BearStoneHA.
## Publish on Facebook as well - https://www.facebook.com/BearStoneHA/
## Enhancements by @dale3h
######################################################################################################

tweet_engine_image:
   sequence:
    - service: mqtt.publish
      data_template:
        topic: 'ifttt/message'
        payload: >-
          {{ tweet }}
        retain: true

    - service: notify.BearStoneHA
      data_template:
        message: >-
          {{ tweet }} #IOT #SmartHome
        data:
          media: >-
            {{image}}

tweet_engine:
   sequence:
    - service: mqtt.publish
      data_template:
        topic: 'ifttt/message'
        payload: >-
          {{ tweet }}
        retain: true

    - service: notify.BearStoneHA
      data_template:
        message: >-
          {{ tweet }} #IOT #SmartHome




    # - service: ifttt.trigger
    #   data_template: {"event":"facebook_tweet", "value1":"{{ tweet }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"}

    # - service: ifttt.trigger
    #   data_template:
    #     event: >-
    #       facebook_tweet
    #     value1: >
    #         {{states.sensor.ifttt_formatted_message.state}} #IOT #SmartHome
