Having Hozelock cloud controller kit intergration

good evening.
yes, when I copied everything Michal´s sensors code in configuration.yaml I got errors at these points.

  1. —— —— —
    end of the stream or a document separator is expected at line 46, column 1:
    • platform: template
      ^
  • platform: template
    sensors:
    hozelock_back_garden_sprinkler_pause_starttime:
    friendly_name: “Pause start”

2.——— ——— ————

bad indentation of a mapping entry at line 101, column 12:
sensors:
^

  • platform: template
    sensors:

I put them this way and then it has given me ok
but the following error has come outbinary_sensors:

  • platform: template
    sensors:
    hozelock_back_garden_sprinkler_pause_starttime:

binary_sensors:

  • platform: template
    sensors:

Component error: binary_sensors - Integration binary_sensors not found. Component error: sensors - Integration sensors not found.
22:10 components/hassio/init.py (ERROR)Log Details (ERROR)
Wed Sep 18 2019 22:10:23 GMT+0200 (CEST)
Component error: binary_sensors - Integration binary_sensors not found.
Component error: sensors - Integration sensors not found.

I’m sorry for not being able to explain myself better.

There’s an indentation problem in Michal’s code. You’re missing 2 spaces before “- platform: template”. Change it so it looks like this:

sensor:
  - platform: rest
    resource: !secret hozelock_controller_0
    name: "Hozelock Back Garden Sprinkler"
    value_template: '{{ value_json["controller"]["name"] }}'
    json_attributes:
      - controller
  - platform: template
    sensors:
      hozelock_back_garden_sprinkler_pause_starttime:
        friendly_name: "Pause start"
etc...

For the binary sensors, add 2 spaces before “- platform: template” :

binary_sensor:
  - platform: template
    sensors:
      hozelock_back_garden_sprinkler_haswaternowevent:
        friendly_name: "Water now event"
etc...

Hello good afternoon.
It doesn’t work, this is the error:

2019-09-19 16:42:09 ERROR (MainThread) [homeassistant.components.hassio] Component error: sensors - Integration sensors not found.
Component error: binary_sensors - Integration binary_sensors not found.
2019-09-19 16:44:25 ERROR (MainThread) [homeassistant.components.hassio] Component error: sensors - Integration sensors not found.
Component error: binary_sensors - Integration binary_sensors not foun

There must be something wrong with the indentation in your code. Good indentation is very important

This I think has to do with the new update. I updated to 99.02 and tried to clean up my config file putting things in separate files to make the code cleaner the same code with the same format that was been working for past 6 month now spits out this very same error. The only difference is that I cut it from my main config file and put it in a separate file.

Thanks for your help, but I haven’t managed to make it work.

I think I have everything right. But this error still appears.

Log Details (ERROR)

Sun Sep 29 2019 16:01:32 GMT+0200 (CEST)

Component error: sensors - Integration sensors not found. Component error: binary_sensors - Integration binary_sensors not found.

the version I use is hassio 99.3

I just realize I didn’t completely check the original code from Michal, and I made the same mistake by copying it in my answer in the thread. The sensors section is ‘sensor’ not ‘sensors’. Your code should look like this:

sensor:
  - platform: rest
    resource: !secret hozelock_controller_0
...

It’s the same for the binary sensors section. ‘binary_sensor’ instead of ‘binary_sensors’

Sorry for that :blush:

Yes now . thank you.
The fault was sensors.

Now I have another question. I have 1 hozelock with two terminals, how should the scrip do, to handle terminal 1 and terminal 2?

Thank you very much for the help

Now, looking at the log. I see several errors come out:

-Wed Oct 02 2019 14:54:09 GMT+0200 (CEST)

Could not render template Next watering start, the state is unknown.

-Wed Oct 02 2019 14:54:09 GMT+0200 (CEST)

Could not render template Pause duration, the state is unknown.

etc…

OK. Here’s how I’ll do it (sorry I’m French so I’ll let you change the friendly names to your liking):

in configuration.yaml:

sensor:
  - platform: rest
    resource: !secret hozelock_controller_0
    name: "Hozelock Controller 0"
    value_template: '{{ value_json["controller"]["name"] }}'
    json_attributes:
      - controller
  - platform: template
    sensors:
      hozelock_controller_0_pause_starttime:
        friendly_name: "Début pause"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['pause'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["pause"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_pause_endtime:
        friendly_name: "Fin pause"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['pause'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["pause"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_pause_duration:
        friendly_name: "Durée pause"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['pause'] %}
            {{ state_attr("sensor.hozelock_controller_0", "controller")["pause"]["duration"] | int / 86400000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'j'

      hozelock_controller_0_adjustment_starttime:
        friendly_name: "Début ajustement"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['adjustment'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["adjustment"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_adjustment_endtime:
        friendly_name: "Fin ajustement"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['adjustment'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["adjustment"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_adjustment_wateringadjustment:
        friendly_name: "Quantité ajustement"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['adjustment'] %}
            {{ state_attr("sensor.hozelock_controller_0", "controller")["adjustment"]["wateringAdjustment"] }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: '%'
        
      hozelock_controller_0_waternowevent_starttime:
        friendly_name: "Arrosage manuel (début)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['waterNowEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["waterNowEvent"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_waternowevent_endtime:
        friendly_name: "Arrosage manuel (fin)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['waterNowEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["waterNowEvent"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_waternowevent_duration:
        friendly_name: "Arrosage manuel (durée)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['waterNowEvent'] %}
            {{ state_attr("sensor.hozelock_controller_0", "controller")["waterNowEvent"]["duration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'
        
      hozelock_controller_0_currentwateringevent_starttime:
        friendly_name: "Arrosage en cours (début)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['currentWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["currentWateringEvent"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_currentwateringevent_endtime:
        friendly_name: "Arrosage en cours (fin)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['currentWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["currentWateringEvent"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_currentwateringevent_duration:
        friendly_name: "Arrosage en cours (durée)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['currentWateringEvent'] %}
            {{ state_attr("sensor.hozelock_controller_0", "controller")["currentWateringEvent"]["duration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'
        
      hozelock_controller_0_nextwateringevent_starttime:
        friendly_name: "Prochain arrosage (début)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['nextWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["nextWateringEvent"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_nextwateringevent_endtime:
        friendly_name: "Prochain arrosage (fin)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['nextWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_0", "controller")["nextWateringEvent"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_0_nextwateringevent_duration:
        friendly_name: "Prochain arrosage (durée)"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['nextWateringEvent'] %}
            {{ state_attr("sensor.hozelock_controller_0", "controller")["nextWateringEvent"]["duration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'

      hozelock_controller_0_lastcommunicationwithserver:
        friendly_name: "Dernière communication"
        value_template: '{{ ( state_attr("sensor.hozelock_controller_0", "controller")["lastCommunicationWithServer"] | int / 1000 ) | int | timestamp_local }}'
      hozelock_controller_0_nextcommunicationwithserver:
        friendly_name: "Prochaine communication"
        value_template: '{{ ( state_attr("sensor.hozelock_controller_0", "controller")["nextCommunicationWithServer"] | int / 1000 ) | int | timestamp_local }}'
      hozelock_controller_0_batterystatus:
        friendly_name: "Etat batterie"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["batteryStatus"] }}'
      hozelock_controller_0_signalstrength:
        friendly_name: "Puissance signal"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["signalStrength"] }}'
      hozelock_controller_0_overridescheduleduration:
        friendly_name: "Remplacement durée prog"
        value_template: >-
          {% if states.sensor.hozelock_controller_0.attributes.controller['overrideScheduleDuration'] %}
            {{ state_attr("sensor.hozelock_controller_0", "controller")["overrideScheduleDuration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'

  - platform: rest
    resource: !secret hozelock_controller_1
    name: "Hozelock Controller 1"
    value_template: '{{ value_json["controller"]["name"] }}'
    json_attributes:
      - controller
  - platform: template
    sensors:
      hozelock_controller_1_pause_starttime:
        friendly_name: "Début pause"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['pause'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["pause"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_pause_endtime:
        friendly_name: "Fin pause"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['pause'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["pause"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_pause_duration:
        friendly_name: "Durée pause"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['pause'] %}
            {{ state_attr("sensor.hozelock_controller_1", "controller")["pause"]["duration"] | int / 86400000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'j'

      hozelock_controller_1_adjustment_starttime:
        friendly_name: "Début ajustement"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['adjustment'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["adjustment"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_adjustment_endtime:
        friendly_name: "Fin ajustement"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['adjustment'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["adjustment"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_adjustment_wateringadjustment:
        friendly_name: "Quantité ajustement"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['adjustment'] %}
            {{ state_attr("sensor.hozelock_controller_1", "controller")["adjustment"]["wateringAdjustment"] }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: '%'
        
      hozelock_controller_1_waternowevent_starttime:
        friendly_name: "Arrosage manuel (début)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['waterNowEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["waterNowEvent"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_waternowevent_endtime:
        friendly_name: "Arrosage manuel (fin)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['waterNowEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["waterNowEvent"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_waternowevent_duration:
        friendly_name: "Arrosage manuel (durée)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['waterNowEvent'] %}
            {{ state_attr("sensor.hozelock_controller_1", "controller")["waterNowEvent"]["duration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'
        
      hozelock_controller_1_currentwateringevent_starttime:
        friendly_name: "Arrosage en cours (début)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['currentWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["currentWateringEvent"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_currentwateringevent_endtime:
        friendly_name: "Arrosage en cours (fin)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['currentWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["currentWateringEvent"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_currentwateringevent_duration:
        friendly_name: "Arrosage en cours (durée)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['currentWateringEvent'] %}
            {{ state_attr("sensor.hozelock_controller_1", "controller")["currentWateringEvent"]["duration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'
        
      hozelock_controller_1_nextwateringevent_starttime:
        friendly_name: "Prochain arrosage (début)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['nextWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["nextWateringEvent"]["startTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_nextwateringevent_endtime:
        friendly_name: "Prochain arrosage (fin)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['nextWateringEvent'] %}
            {{ ( state_attr("sensor.hozelock_controller_1", "controller")["nextWateringEvent"]["endTime"] | int / 1000 ) | int | timestamp_local }}
          {% else %}
            unknown
          {% endif %}
      hozelock_controller_1_nextwateringevent_duration:
        friendly_name: "Prochain arrosage (durée)"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['nextWateringEvent'] %}
            {{ state_attr("sensor.hozelock_controller_1", "controller")["nextWateringEvent"]["duration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'

      hozelock_controller_1_lastcommunicationwithserver:
        friendly_name: "Dernière communication"
        value_template: '{{ ( state_attr("sensor.hozelock_controller_1", "controller")["lastCommunicationWithServer"] | int / 1000 ) | int | timestamp_local }}'
      hozelock_controller_1_nextcommunicationwithserver:
        friendly_name: "Prochaine communication"
        value_template: '{{ ( state_attr("sensor.hozelock_controller_1", "controller")["nextCommunicationWithServer"] | int / 1000 ) | int | timestamp_local }}'
      hozelock_controller_1_batterystatus:
        friendly_name: "Etat batterie"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["batteryStatus"] }}'
      hozelock_controller_1_signalstrength:
        friendly_name: "Puissance signal"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["signalStrength"] }}'
      hozelock_controller_1_overridescheduleduration:
        friendly_name: "Remplacement durée prog"
        value_template: >-
          {% if states.sensor.hozelock_controller_1.attributes.controller['overrideScheduleDuration'] %}
            {{ state_attr("sensor.hozelock_controller_1", "controller")["overrideScheduleDuration"] | int / 60000 | int }}
          {% else %}
            unknown
          {% endif %}
        unit_of_measurement: 'min'


binary_sensor:
  - platform: template
    sensors:
      hozelock_controller_0_haswaternowevent:
        friendly_name: "Arrosage manuel"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["hasWaterNowEvent"] }}'
      hozelock_controller_0_ischildlockenabled:
        friendly_name: "Verrou enfant"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["isChildlockEnabled"] }}'
      hozelock_controller_0_iswatering:
        friendly_name: "Arrosage en cours"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["isWatering"] }}'
      hozelock_controller_0_ispanelremoved:
        friendly_name: "Panneau retiré"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["isPanelRemoved"] }}'
      hozelock_controller_0_isadjusted:
        friendly_name: "Ajustement"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["isAdjusted"] }}'
      hozelock_controller_0_isscheduleuptodate:
        friendly_name: "Calendrier à jour"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["isScheduleUpToDate"] }}'
      hozelock_controller_0_ispaused:
        friendly_name: "En pause"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["isPaused"] }}'
      hozelock_controller_0_nextwateringevent_enabled:
        friendly_name: "Prochain arrosage activé"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["nextWateringEvent"]["enabled"] }}'
        
      hozelock_controller_0_currentwateringevent_enabled:
        friendly_name: "Arrosage en cours (activé)"
        value_template: '{{ state_attr("sensor.hozelock_controller_0", "controller")["currentWateringEvent"]["enabled"] }}'

  - platform: template
    sensors:
      hozelock_controller_1_haswaternowevent:
        friendly_name: "Arrosage manuel"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["hasWaterNowEvent"] }}'
      hozelock_controller_1_ischildlockenabled:
        friendly_name: "Verrou enfant"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["isChildlockEnabled"] }}'
      hozelock_controller_1_iswatering:
        friendly_name: "Arrosage en cours"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["isWatering"] }}'
      hozelock_controller_1_ispanelremoved:
        friendly_name: "Panneau retiré"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["isPanelRemoved"] }}'
      hozelock_controller_1_isadjusted:
        friendly_name: "Ajustement"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["isAdjusted"] }}'
      hozelock_controller_1_isscheduleuptodate:
        friendly_name: "Calendrier à jour"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["isScheduleUpToDate"] }}'
      hozelock_controller_1_ispaused:
        friendly_name: "En pause"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["isPaused"] }}'
      hozelock_controller_1_nextwateringevent_enabled:
        friendly_name: "Prochain arrosage activé"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["nextWateringEvent"]["enabled"] }}'
        
      hozelock_controller_1_currentwateringevent_enabled:
        friendly_name: "Arrosage en cours (activé)"
        value_template: '{{ state_attr("sensor.hozelock_controller_1", "controller")["currentWateringEvent"]["enabled"] }}'


rest_command: 
  hozelock_waternow:
    url: https://hoz3.com/restful/support/hubs/{{ hub_id }}/controllers/actions/waterNow
    method: POST
    payload: '{"controllerIDs":[ {{ controller_id }} ],"duration": {{ duration }} }'
    content_type:  'application/json'
  hozelock_stopwatering:
    url: https://hoz3.com/restful/support/hubs/{{ hub_id }}/controllers/actions/stopWatering
    method: POST
    payload: '{"controllerIDs":[ {{ controller_id }} ]}'
    content_type:  'application/json'
  hozelock_pause:
    url: https://hoz3.com/restful/support/hubs/{{ hub_id }}/controllers/actions/pause
    method: POST
    payload: '{"controllerIDs":[ {{ controller_id }} ],"duration": {{ duration }} }'
    content_type:  'application/json'
  hozelock_unpause:
    url: https://hoz3.com/restful/support/hubs/{{ hub_id }}/controllers/actions/unpause
    method: POST
    payload: '{"controllerIDs":[ {{ controller_id }} ]}'
    content_type:  'application/json'

In secrets.yaml:

hozelock_hub_id: XXXXXX
hozelock_controller_0: https://hoz3.com/restful/support/hubs/XXXXXX/controllers/0
hozelock_controller_1: https://hoz3.com/restful/support/hubs/XXXXXX/controllers/1

In script.yaml:

hozelock_waternow_0:
  alias: Démarrer arrosage manuel
  sequence:
    - service: rest_command.hozelock_waternow
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 0
        duration: "{{ states('input_number.hozelock_duration') | int * 60000 }}"
hozelock_stopwatering_0:
  alias: Arrêter arrosage manuel
  sequence:
    - service: rest_command.hozelock_waternow
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 0
hozelock_pause_0:
  alias: Suspendre arrosage
  sequence:
    - service: rest_command.hozelock_pause
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 0
        duration: "{{ states('input_number.hozelock_duration_pause') }}"
hozelock_unpause_0:
  alias: Reprise arrosage
  sequence:
    - service: rest_command.hozelock_unpause
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 0

hozelock_waternow_1:
  alias: Démarrer arrosage manuel
  sequence:
    - service: rest_command.hozelock_waternow
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 1
        duration: "{{ states('input_number.hozelock_duration') | int * 60000 }}"
hozelock_stopwatering_1:
  alias: Arrêter arrosage manuel
  sequence:
    - service: rest_command.hozelock_waternow
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 1
hozelock_pause_1:
  alias: Suspendre arrosage
  sequence:
    - service: rest_command.hozelock_pause
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 1
        duration: "{{ states('input_number.hozelock_duration_pause')  }}"
hozelock_unpause_1:
  alias: Reprise arrosage
  sequence:
    - service: rest_command.hozelock_unpause
      data_template:
        hub_id: !secret hozelock_hub_id
        controller_id: 1

The language is no problem, I will modify them when everything is correct. thank you for your effort.
but I don’t finish seeing it work.
I see the following errors:

-Wed Oct 02 2019 21:00:57 GMT+0200 (CEST)

Could not render template Remplacement durée prog: UndefinedError: ‘mappingproxy object’ has no attribute ‘controller’

  • Log Details (ERROR)

Wed Oct 02 2019 21:00:57 GMT+0200 (CEST)

Could not render template Prochain arrosage (durée): UndefinedError: ‘mappingproxy object’ has no attribute ‘controller’

  • Log Details (ERROR)

Wed Oct 02 2019 21:00:57 GMT+0200 (CEST)

Could not render template Prochain arrosage (fin): UndefinedError: ‘mappingproxy object’ has no attribute ‘controller’

  • Log Details (ERROR)

Wed Oct 02 2019 21:00:57 GMT+0200 (CEST)

Could not render template Quantité ajustement: UndefinedError: ‘mappingproxy object’ has no attribute ‘controller’

etc…

OK, I forgot to modify the name for the second controller:

name: "Hozelock Controller 1"

I don’t have 2 controllers so I can only guess the json value return by the url…

I already changed name to controller 1, but I don’t think it works. (there are still errors) Is there any way to know the real name of the second controller?

Thanks for this thread!

I’ve been looking for a better way to pause the sprinkler schedule than manually when the weather is wet (a typical UK Summer).

From the info in this thread I’ve left the controller to retain a standard schedule, but pause it for 1 day when rain is forecast / temperature is too low. (Using Node Red & Dark Sky data).

I found that using the API to turn on / off the sprinklers (WaterNOw) daily was a little slow as it had to wait for the hub and controller to sync. So I opted to simple use the pause option.

I also found that the pause option needed the value in days, not milliseconds.

Watching the thread to see where this goes…

Glad this thread could help you.

Thanks for reminding me this for hozelock_duration_pause. I pasted an old version of the script and I forgot to change the value :blush: (the script from Sep 17 is OK). I edited my post from Oct 2 with the right values

Great work fixing my mistakes and enhancing the code @l_o_k_i !
Tomorrow i will try to add your enhancements to my config, but i already see that you’ve fixed things ive been struggling with (script).
Would you mind sharing your lovelace config, as mine is chunky and ugly?

I’ve just taken delivery of my cloud controller and I’m surprised to find that Hozelock haven’t addressed the security issues raised. This sounds like a story for TheRegister. I’m wondering how to mitigate the risk, is it feasible to stand up an internal web server and redirect requests to that instead of Hozelocks public site?

Shocking that it is still not fixed, given the data that can get returned they could possibly be found to be in violation of GDPR rules and face a massive fine etc.

awesome. thanks for your job @l_o_k_i and @dinth.

tiny error on stowatering :

Arrêter arrosage manuel
sequence:
- service: rest_command.hozelock_waternow

must be : rest_command.hozelock_stopwatering

Now i will play with this code + darksky info into a nice nodered flow :slight_smile:

Im not sure if Dark Sky will be suitable, as their rainfall totals prediction is temperamental if working at all.
But please share your work once its finished.
Unfortunately im using this “read-only” now, as there’s always something more urgent to fix in my HA config.