Skip to content

MijnTuin.org will STOP all activities in May 2024 and this integration will stop to function. MijnTuin.org Home Assistant custom component HACS to manage garden plants and see activities for your garden

License

Notifications You must be signed in to change notification settings

myTselection/MijnTuin

Repository files navigation

HACS Default hacs_badge GitHub release GitHub repo size

GitHub issues GitHub last commit GitHub commit activity

⚠️ MijnTuin.org will STOP all activities by end of May 2024. As a consequence, this integration will no longer work and will soon be removed from HACS.

MijnTuin Home Assistant integration

MijnTuin.org Home Assistant custom component. This custom component has been built from the ground up to bring your Mijn Tuin garden planning details into Home Assistant to help you towards a better follow upon your garden. This integration is built against the public website provided by MijnTuin.org.

This integration is in no way affiliated with MijnTuin.org. At least a free account of the website MijnTuin.org is required. The management of your garden and plants in your garden needs to be setup on the website MijnTuin.org.

⚠️ Please don't report issues with this integration to MijnTuin.org, they will not be able to support you.

Installation

  • HACS: search for the integration in the list of HACS
    • Open your Home Assistant instance and open the repository inside the Home Assistant Community Store.
  • Restart Home Assistant
  • Add 'MijnTuin' integration via HA Settings > 'Devices and Services' > 'Integrations'
  • Provide MijnTuin username and password
  • Sensor mijntuin should become available with the number of action to take this month. The attributes provide further details on the type of activities in your garden, the plants and the number of activities per month.
  • For each type of activity a sensor should become available with the number of action for this activity to take this month. The attributes provide further details per month.
  • A service service: mijntuin.update is available that allows to 'force' refresh the data. This can be useful to quickly see the latest status of completed tasks. Standard data refresh is throttled and updated every hour.

Since the sensors of this Mijn Tuin integration may contain much data in the attributes, it might be desired to disable full detailed history logging in the recorder of Home Assistant. You may disable it by adding below in configuration.yaml:

recorder:
  exclude:
    entity_globs:
      - sensor.mijn_tuin*

Status

Still some optimisations are planned, see Issues section in GitHub.

Technical pointers

The main logic and API connection related code can be found within source code youfone.be/custom_components/youfone.be:

All other files just contain boilerplat code for the integration to work wtihin HA or to have some constants/strings/translations.

Example usage:

Markdown

Markdown card example code
type: markdown
content: >-
  ## Activiteiten deze maand: {{states('sensor.mijn_tuin')}}


  {% set activities = states | rejectattr("entity_id","eq","sensor.mijn_tuin") |
  selectattr("entity_id", "match","^sensor.mijn_tuin_*") | list %}

  {% for activity_device in activities %}

  {% set activity = activity_device.entity_id %}

  {% if state_attr(activity,"actionsThisMonth") > 0 %}

  {% set this_month = now().strftime("%B") %}

  {% set currplants = state_attr(activity,this_month) | list %}

  {% set currplantstodo = currplants | selectattr('buttons','defined') | list %}

  {% set currplantsdone = currplants | rejectattr('buttons','defined') | list %}


    <details>
    <summary>
    <b>{{state_attr(activity,'activityType') }}: </b> ({{state_attr(activity,this_month)|length }})</summary>
    
    {% if (currplantstodo | length) > 0 %}
    -  <details>
       <summary>Te doen</summary>
       {% for plant in currplantstodo  %}
         - <details>
           <summary> 
           <img src="{{ plant.get('photo').get('src') }} " width="30"></img> <b><a href="{{ plant.get('plant_link') }}" target="_blank" title="{{ plant.get('latin_name') }}">{{ plant.get('name') }}</a></b>: {{ plant.get('description') }}</summary>
            {% if plant.get('details','')|length  > 0 %}
            - {{ plant.get('details') }}
            {% endif %}
            
            - <a href="{{ plant.get('link') }}" target="_blank">link</a>
            {% if plant.get('buttons','')|length  > 0 %}- <a href="{{ plant.get('buttons')}}" target="_blank">Markeer als gedaan</a>{% endif %}
            
            </details> 
        {% endfor %}
        </details>
    {% endif %}
    {% if (currplantsdone | length) > 0 %}
    -  <details>
       <summary>Gedaan</summary>
       {% for plant in currplantsdone  %}
         - <details>
           <summary> 
           <img src="{{ plant.get('photo').get('src') }} " width="30"></img> <b><a href="{{ plant.get('plant_link') }}" target="_blank" title="{{ plant.get('latin_name') }}">{{ plant.get('name') }}</a></b>: {{ plant.get('description') }}</summary>
            {% if plant.get('details','')|length  > 0 %}
            - {{ plant.get('details') }}
            {% endif %}
            
            - <a href="{{ plant.get('link') }}" target="_blank">link</a>
            {% if plant.get('buttons','')|length  > 0 %}- <a href="{{ plant.get('buttons')}}" target="_blank">markeer als gedaan</a>{% endif %}
            
            </details> 
            {% endfor %}
        </details>
    {% endif %}


    </details></br>

  {% endif %}

  {% endfor %}


  ### Planten: 

  {% for plant in state_attr('sensor.mijn_tuin','Plants')
  %}[{{plant.get('name')}}]({{plant.get('link')}}
  "{{plant.get('latin_name')}}"), {% endfor %}

Example Update button

Card example code
type: button
show_name: true
show_icon: true
tap_action:
  action: call-service
  service: mijntuin.update
  target: {}
entity: ''
icon: mdi:update
icon_height: 30px

About

MijnTuin.org will STOP all activities in May 2024 and this integration will stop to function. MijnTuin.org Home Assistant custom component HACS to manage garden plants and see activities for your garden

Topics

Resources

License

Stars

Watchers

Forks

Languages