My Garden Irrigation

Well ok, the script is for installing home assistant and not Garden irrigation.

Now, what you see in the first screenshot is the auto generated dashboard by home assistant. you can throw that away and start creating your own when you will integrate your other devices

I suggest you to install studio code server from home assistant addons menu, it’s an advanced file editor for programmers (to simplify the explanation).
Now follow these steps

  1. In your configuration.yaml you should have at least these voices, copy them inside your configuration.yaml
homeassistant:
  packages: !include_dir_named packages

lovelace_gen:

#######################
#    LOVELACE YAML    #
#######################
lovelace:
  mode: storage
  dashboards:
    lovelace-irrigazione:
      mode: yaml
      title: Irrigazione
      icon: mdi:sprinkler
      show_in_sidebar: true
      filename: lovelace/irrigazione.yaml

Lovelace_gen and lovelace are at the same level of indentation of homeassistant. In yaml the indentation matters (in italiano devono avere la stessa indentazione perchè yaml è un linguaggio la cui sintassi differenzia anche l’indentazione).

  1. Now you have to create a folder named lovelace in the same folder of configuration.yaml

  2. inside lovelace folder create a file named irrigazione.yaml

  3. inside irrigazione.yaml copy

title: Irrigazione
views:
  - !include view_garden_irrigation.yaml
  1. From garden irrigation package you downloaded, copy the file view_garden_irrigation.yaml in the same folder of irrigazione.yaml

  2. copy the folder garden_irrigation from the package you downloaded inside your lovelace folder.
    image

  3. You shold find a folder named packages. If there isn’t, create it in the same folder where you find configuration.yaml

  4. inside packages folder copy the folder “Garden Irrigation” from the packages.

Now if you reboot home assistant you should find on the left
image
a voice named Irrigazione (or whatever you called it).

clicking on that you will find everything.

HI,
Being a bit busy at work I’m replying late, thanking you again for the various suggestions I have finally achieved the goal you see in the picture below, I still have to fix the graphics_card but the graphics are now those of the project. If I don’t bother you, I would like to ask you for further information. I have seen that in various .yaml files of the project there are many errors related to the !include function. Below are some images that perhaps clarify better. Can you tell me a solution to this problem? I don’t want to see that now I have the graphics but the functionality is missing… Thank you again and to answer the question you asked me and I missed it, I intend to use a Sophos in MQTT.




Hi, glad to see you achieved the result.
For the graph you have to install mini-graph-card from hacs.

For the folders the have to be so:

You have to move your first garden_irrigation folder, which has inside irrigation_cancel.yaml inside packages folder

Then use studio code server to edit files, this package has a lot of recursive inlude function, so the indentation could be wrong at first sight, but correct for the include.

If you don’t see errors in your screen then it’s all fine.

You should see something like this

HI ,
Unfortunately, if I move the folder as you tell me, I go back to seeing nothing on the screen. I attach the situation to today, I have reinstalled mini-graph-card and the graph is now ok. I have installed and configured the Broken MQTT Mosquitto and related Tasmota for Sonof and testing with Mqtt explorer it works but from the project I cannot control the valves I think it’s still the problem linked to all those files that show the red circle and give me errors in particular on the !include function which I can’t understand. I will have to waste some more time to find the solution unless anyone has further suggestions.
Thanks again to you and anyone with suggestions



Can you post what you added in your configuration.yaml?

When you define your mqtt entities in home assistant, you have to copy the name of the switch that control one of the valve, and paste it inside the valve configuration.

When you define how many valves you have, you will find them here

then if you click on the first, then the configuration editor pops up and where you see switch.bassa_pressione that’s the name of one of my relay
image

here you see my device in devices section
image
image

HI
This is my configuration.yaml:

Loads default set of integrations. Do not remove.

default_config:

Load frontend themes from the themes folder

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch: !include switch.yaml

homeassistant:
packages: !include_dir_named garden_irrigation

browser_mod:
lovelace_gen:

lovelace:
mode: storage
dashboards:
irrigazione-smart:
mode: yaml
title: Irrigazione Smart
icon: mdi:flower
show_in_sidebar: true
filename: smart_irrigation.yaml

sensor:

  • platform: time_date
    display_options:
    • ‘time’
    • ‘date’

template:

  • sensor:
    • name: “Night or Day”
      state: >
      {% if is_state(‘sun.sun’, ‘above_horizon’) %}
      Day
      {% else %}
      Night
      {% endif %}

notify:

  • platform: file
    name: log_irrigation
    filename: log_irrigation.txt

A question, but in your files you don’t have any errors referring to !include?


Quell che mi hai suggerito sopra lo avevo già fatto ma non si attiva la valvola , di seguito il codice per una valvola in MQTT:

irrigazione giardino fronte SX

mqtt:
switch:
- name: switch.zone1
state_topic: “stat/sonoff4chpro_9F8F37/POWER1”
command_topic: “cmnd/sonoff4chpro_9F8F37/POWER1”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: false
image
image


The difference I see is that in the device I have the voice Tasmota 2-3-4 and not zone1-2-3-4.
Tks

Ok, let’s see an example in my device.
image

Click on the first, in my case “Valvola 1 R1” then on “Settings” (the wheel, the second icon from right)
image

and you will land here
image

On the “Entity ID” field, you can rename the switch, that is the ID used in the code (configuration.yaml) and you can edit the “Name” field which is what you see in the interface.
So set the Name field to Zona 1, entity id to switch.zona1 and click update.

Go back to your configuration.yaml, where you have the mqtt section.
type in these:

mqtt:
  - switch:
      name: switch.zone1
	  state_topic: "stat/sonoff4chpro_9F8F37/POWER1"
	  command_topic: "cmnd/sonoff4chpro_9F8F37/POWER1"
	  qos: 1
	  payload_on: "ON"
	  payload_off: "OFF"
	  retain: false

This should be the correct syntax according to this mqtt switch but not having that, i cannot test it

If you modify your configuration.yaml you have to reload it or restart home assistant.

Then go back to irrigation and insert switch.zone1 in your first valve.
Try first if it works from device page, if it starts, ok, go to irrigation and test it.

Try to look at that with studio code server, i’ve checked the file indicated but i cannot see any indentation error.

HI,
Given your willingness to always answer me promptly, I’ll update you. Finally the irrigation works I had to argue about it a bit but at least now the valves are activated and the page is complete even if I can’t explain why I always see errors in the irrigation yaml files both from the file editor and from Studio Code. Now I have to put the historicization of the events of the 2 files in the snapshot folder has been finalised, even if it is not important.

Very Very good, i’m glad it works.
I had to struggle with it too, when i installed it, but i can say you it is a great software!
The errors you see is given by the syntax change in HA, for now that are only warnings because that syntax is deprecated, but pherhaps in the future it will be unsupported, and if the mantainer will not update the package, it will be a big problem!

I’m still here and I still use the package every year with no intention to stop. I will definitely keep it up to date with any breaking changes in HA in the foreseeable future but I will admit that my motivation for making any significant changes is diminishing because it currently works so perfectly for me.

When l get around to updating my config to the new syntax I will obviously include this but there seems to be little urgency for that because I am pretty sure I have read that the ‘old’ syntax will not ever become unsupported.

Big thanks to shakin89 and obviously to klogg who developed the code

1 Like

I believe you, and hope it will never be unsupported.
Thank you for your work, and i won’t stop using it too!