Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106467

Condition in google calander... create event if another event exist

$
0
0

Hey everybody,

i am struggling now a little while with google calandar intergration…

Tracking of working hours!

Isstate: (which is working pretty good)

creating a entry by pressing a button in HA. Startime (now), Endtime + 10 hours.

  • id: ‘1234567890’
    alias: Einstempeln
    description: Eingestempelt
    trigger:
    • platform: state
      entity_id:
      • input_boolean.working
        from: ‘off’
        to: ‘on’
        condition: []
        action:
    • service: google.create_event
      data:
      summary: Eingestempelt
      start_date_time: ‘{{ now().timestamp() | timestamp_custom(’’%Y-%m-%d %H:%M:%S’’,
      true)}}’
      end_date_time: ‘{{ (now().timestamp() + 36000) | timestamp_custom(’’%Y-%m-%d
      %H:%M:%S’’, true)}}’
      target:
      entity_id: calendar.abc_xyz_gmail_com
      mode: single

Should-state:

Once automation is triggered, it should check if event “Eingestempelt” is existing and calendar state is “on” to create a new event which is “Ausgestempelt”.

  • id: ‘635736576328756872’
    alias: Ausstempeln
    description: ‘’
    trigger:
    • platform: state
      entity_id:
      • input_boolean.working
        from: ‘on’
        to: ‘off’
        condition:
    • condition: state
      entity_id: calendar.abc_xyz_gmail_com
      attribute: description
      state: “on”
    • condition: template
      value_template: >
      {%- set event=states.calendar.abc_xyz_gmail_com.attributes.message %}
      {%- if event == “Eingestempelt” %}
      true
      {%- endif -%}
      action:
    • service: google.create_event
      data:
      summary: Ausgestempelt
      start_date_time: ‘{{ now().timestamp() | timestamp_custom(’’%Y-%m-%d %H:%M:%S’’,
      true)}}’
      end_date_time: ‘{{ (now().timestamp() + 300) | timestamp_custom(’’%Y-%m-%d %H:%M:%S’’,
      true)}}’
      target:
      entity_id: calendar.abc_xyz_gmail_com
      mode: single

Hope you can assist me :slight_smile:

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106467

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>