Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide more detailed example #1

Closed
johntdyer opened this issue Aug 19, 2019 · 12 comments
Closed

Please provide more detailed example #1

johntdyer opened this issue Aug 19, 2019 · 12 comments

Comments

@johntdyer
Copy link

It’s not clear to me exactly how I define the birthdays... I see from the readme which fields you expect but what’s not clear to me is where I define these... Do they go in the configuration.yaml ?

@houtknots
Copy link

Same problem here, I do not understand how add this compent in the configuration file

@point-4ward
Copy link
Owner

This isn't a component, it's a python script - to see how to use it in homeassistant please scroll down the README file to the section 'Example configuration.yaml entry' - it's pretty self-explanatory.

The automation in that example runs the python script once a day, which creates/updates the countdown sensors.

@stefancvetkovic
Copy link

If I understood this correctly, for each reminder, I will have separate yaml file inside python_scripts folder?

@point-4ward
Copy link
Owner

No, you just use an automation to run the script as many times as you need to create the number of sensors you need. Please see the example in the Readme

@stefancvetkovic
Copy link

@mf-social
Thanks, I saw, everything is clear, except for the lovelace representation?
In your example you provided sensor.anniversary_our_wedding but where did you registered this sensor? and this sensor is which type?

show_header_toggle: false
title: Our Events
entities:
  - entity: sensor.anniversary_our_wedding
    secondary_info: '[[ {entity}.attributes.nextoccur ]]  ( [[ {entity}.attributes.years ]] Years )'
    type: 'custom:secondaryinfo-entity-row'```

@point-4ward
Copy link
Owner

point-4ward commented Feb 18, 2020

Define 'type' of sensor?

The sensor is 'registered' in the automation that runs the script.

      - service: python_script.date_countdown
        data:
          name: Our wedding
          type: anniversary
          date: 14/02/1994

@stefancvetkovic
Copy link

I assumed, that this automation "register" sensors by its name right?
I tried to invoke automation with service call automation.turn_on but nothing happens, I cant see the sensors.
I also restarted HA, but sill nothing.
Even I changed trigger for my automation, to trigger on switch state on
So, definitely, I have a problem with recognising those sensors..

@stefancvetkovic
Copy link

Here is my automation example:

  trigger:
    - platform: state
      entity_id: switch.living_room_main_light
      from:  'off'
      to:  'on'
    # - platform: time
    #   at: '00:00:01'
    # - platform: homeassistant
    #   event: start
  action:
    - service: python_script.date_countdown
      data:
        name: Stefan's Birthday
        type: birthday
        date: 03/09/1989
    - service: python_script.date_countdown
      data:
        name: Ivan comming
        type: event
        date: 28/02/2020

@point-4ward
Copy link
Owner

Do you have

python_script:

Somewhere in your configuration.yaml?

@stefancvetkovic
Copy link

Yes, I have

@point-4ward
Copy link
Owner

When you trigger the automation, any errors in the log?

@point-4ward point-4ward reopened this Feb 19, 2020
@point-4ward
Copy link
Owner

@stefancvetkovic - is this still a problem or have you sorted it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants