Generic Cam Fun

Input Select

input_select:
  cam_changer:
    name: Funny GIFs
    options:
      - Option 1
      - Option 2
      - Option 3
      - Option 4
      - Option 5
    initial: Option 1
    icon: mdi:image

Camera

camera:
  - platform: generic
    name: Tacos!
    still_image_url: "{% if is_state('input_select.cam_changer', 'Option 1') %} 
                       https://media1.giphy.com/media/DgLsbUL7SG3kI/giphy.gif
                     {% elif is_state('input_select.cam_changer', 'Option 2') %}
                       https://media1.giphy.com/media/zTfwFhYUrIrnO/giphy.gif
                     {% elif is_state('input_select.cam_changer', 'Option 3') %}
                       https://media3.giphy.com/media/3o6Zt1bnn4IFOgnGxi/giphy.gif
                     {% elif is_state('input_select.cam_changer', 'Option 4') %}
                       https://media2.giphy.com/media/GU4dMaayEX2Bq/giphy.gif
                     {% elif is_state('input_select.cam_changer', 'Option 5') %}
                       https://media0.giphy.com/media/fItgT774J3nWw/giphy.gif
                     {% else %}
                       Image Error
                     {% endif %}"
    limit_refetch_to_url_change: true

Automation

automation:
- id: bh
  alias: Random Gif
  trigger:
    platform: time
    minutes: '/1'
    seconds: 00
  action:
    - service: input_select.select_next
      data:
        entity_id: input_select.cam_changer
#        option: "{{ (['Option 1','Option 2','Option 3','Option 4','Option 5']|random) }}"  # I tried to get random working with the input_select.select_option service but couldn't. Let me know if you have any ideas...

Group

group:
tacos:
  name: Tacos
  entities:
    - automation.random_gif
    - input_select.cam_changer
    -  camera.tacos

Result

Changes GIF every minute. Turn off automation for a static GIF and then select the GIF of your choice from the input select

6 Likes

Thanks for sharing!

I’m doing something similar to disable camera feeds when someone is home.

1 Like

I’ll give you a like just for using Mr. Meseeks. Wubba lubba dub dub!!

1 Like

Thanks Robert! Tomorrow is the big day!

1 Like

Thank you for sharing your Project.

You can find example how to randomize stuff in the birthday package of Mahasri Kalavala at https://github.com/skalavala/smarthome/blob/master/packages/birthday.yaml

1 Like