Updated with some new Tweet Logic and easier names - #720 - YouTube Sensors as well.
This commit is contained in:
parent
199b79d6ec
commit
691ee15e9d
|
@ -49,7 +49,7 @@
|
|||
|
||||
- service: script.emergency
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: >
|
||||
{% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
data_template:
|
||||
NewDevice: "There has been a new device detected on the network. Be sure to appropriately catagorize {{trigger.event.data.host_name}} within Circle."
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
- service: ifttt.trigger
|
||||
data_template: {"event":"GitPost", "value1":"Wink Update is available. - {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %d%b%Y', true) }}", "value2":"{{ states.binary_sensor.carlowink.attributes }}"}
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
who: 'carlo'
|
||||
apns_id: 'ip-change'
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
|
|
|
@ -35,7 +35,7 @@ automation:
|
|||
value1: "{{ trigger.to_state.attributes.friendly_name }} is at {{ trigger.to_state.state }} "
|
||||
who: 'carlo'
|
||||
apns_id: 'information'
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data:
|
||||
tweet: 'Looks like my {{ trigger.to_state.attributes.friendly_name }} is LOW. @CCostan - Get me some more (https://amzn.to/2AnpFwD)'
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ automation:
|
|||
data_template:
|
||||
value1: "An emergency has been detected on {{ trigger.to_state.attributes.friendly_name }} Please investigate IMMEDIATELY."
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: "An emergency has been detected on {{ trigger.to_state.attributes.friendly_name }} @CCostan (https://www.vcloudinfo.com/2017/06/psa-check-out-your-smoke-detectors-once.html)"
|
||||
|
||||
|
@ -79,6 +79,6 @@ automation:
|
|||
who: "parents"
|
||||
apns_id: 'Nest-Protect'
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data:
|
||||
tweet: "Oh NO! {{ trigger.to_state.attributes.friendly_name }} is now in {{ (trigger.to_state.state)|replace('_', ' ') }} mode. @Nest. (https://www.vcloudinfo.com/2017/06/psa-check-out-your-smoke-detectors-once.html) #Safety"
|
||||
|
|
|
@ -56,7 +56,7 @@ automation:
|
|||
value1: 'Go Outside! There is a Rocket Launch very soon!'
|
||||
apns_id: 'information'
|
||||
|
||||
- service: script.tweet_engine
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: 'There is a Rocket launch happening right now! I can see it if I look closely. @BrianCribbs #SpaceX #Space'
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ automation:
|
|||
{%- endif -%}
|
||||
action:
|
||||
- delay: '0{{ range(0,2) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}'
|
||||
- service: script.tweet_engine_setup
|
||||
- service: script.tweet_engine_random
|
||||
data_template:
|
||||
pick: >-
|
||||
{% set pick = [
|
||||
|
|
|
@ -23,10 +23,20 @@ automation:
|
|||
entity_id: sensor.vcloudinfo
|
||||
|
||||
action:
|
||||
- service: script.tweet_engine_image
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
"New Video! {{ states('sensor.vcloudinfo_info') }} - {{ state_attr('sensor.vcloudinfo','url') }} "
|
||||
] | random }}
|
||||
image: "{{state_attr('sensor.vcloudinfo','entity_picture')}}"
|
||||
who: 'ccostan'
|
||||
|
||||
- delay: '00:10:00'
|
||||
|
||||
- service: script.tweet_engine_no_image
|
||||
data_template:
|
||||
tweet: >
|
||||
{{ [
|
||||
"New Video! {{ states('sensor.vcloudinfo_info') }} - {{ state_attr('sensor.vcloudinfo','url') }} "
|
||||
] | random }}
|
||||
who: 'BearStoneHA'
|
||||
|
|
|
@ -1,12 +1,56 @@
|
|||
######################################################################################################
|
||||
## Script to send notifications to Twitter as @BearStoneHA.
|
||||
## Publish on Facebook as well - https://www.facebook.com/vcloudinfo/
|
||||
## If you do end up using this package, please consider using one or two of the canned tweets that calls back to my main repo
|
||||
## so others can bring thier homes online as well. I have an active search for #Randomstats that helps me find new HA homes using my package online.
|
||||
## Enhancements by @dale3h
|
||||
######################################################################################################
|
||||
#-------------------------------------------
|
||||
# Visit The Main Blog for More Home Assistant Goodness - https://www.vCloudInfo.com
|
||||
# Follow me on the socials - @CCOSTAN
|
||||
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||
# Script to send notifications to Twitter as @BearStoneHA.
|
||||
# Publish on Facebook as well - https://www.facebook.com/vcloudinfo/
|
||||
# If you do end up using this package, please consider using one or two of the canned tweets that calls back to my main repo
|
||||
# so others can bring thier homes online as well. I have an active search for #Randomstats that helps me find new HA homes using my package online.
|
||||
#-------------------------------------------
|
||||
|
||||
tweet_engine_setup:
|
||||
tweet_engine_image:
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
topic: 'ifttt/message'
|
||||
payload: >-
|
||||
{{ tweet }}
|
||||
retain: true
|
||||
|
||||
- service_template: >
|
||||
{% if who == 'ccostan' %}
|
||||
notify.ccostan
|
||||
{% else %}
|
||||
notify.bearstoneha
|
||||
{% endif %}
|
||||
data_template:
|
||||
message: >-
|
||||
{{ tweet }} #IOT #SmartHome
|
||||
data:
|
||||
media: >-
|
||||
{{ image }}
|
||||
|
||||
tweet_engine_no_image:
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
topic: 'ifttt/message'
|
||||
payload: >-
|
||||
{{ tweet }}
|
||||
retain: true
|
||||
|
||||
- service_template: >
|
||||
{% if who == 'ccostan' %}
|
||||
notify.ccostan
|
||||
{% else %}
|
||||
notify.bearstoneha
|
||||
{% endif %}
|
||||
data_template:
|
||||
message: >-
|
||||
{{ tweet }} #IOT #SmartHome
|
||||
|
||||
|
||||
tweet_engine_random:
|
||||
sequence:
|
||||
- service: script.tweet_engine_image
|
||||
data_template:
|
||||
|
@ -239,44 +283,6 @@ tweet_engine_setup:
|
|||
{{ image(pick) }}
|
||||
{%- endif -%}
|
||||
|
||||
tweet_engine_image:
|
||||
sequence:
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
topic: 'ifttt/message'
|
||||
payload: >-
|
||||
{{ tweet }}
|
||||
retain: true
|
||||
|
||||
- service_template: >
|
||||
{% if who == 'ccostan' %}
|
||||
notify.ccostan
|
||||
{% else %}
|
||||
notify.bearstoneha
|
||||
{% endif %}
|
||||
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 }}"}
|
||||
|
|
Loading…
Reference in New Issue