Irrigation Hunter X-Core remote control using REM pin

For those interested I’ve found another way to integrate Hunter watering controller that have REM port to HA. There’s a port of opensprinkler for ESP8266 devices with integrated the Hunter REM port functionality.

I’m using this fork that has the same wiring of ecodina esp fw. I’ve tested and it works correctly with my Hunter controller.

The plus are: program running independent from HA, weather integration already embedded in opensprinker, multiple schedule, opensprinkler-HA integration via HACS module (it uses OS REST API so no MQTT is necessary).

This is the repo:

Hi, i tried building the project with platformio, but i encountered some errors, did you do something in specific with platformio?:

Hi, I just compiled with:

pio run -t upload

from a linux shell, I get some warning, but the building process complete and the Wemos get flashed.
I tryied also deleting the .pio folder and the libraries get downloaded and the compiling ends succcesfully.

Hi, yes i tried it on windows and i had to change some files as per this commit: Make firmware PlatformIO compilable by maxgerhardt · Pull Request #158 · OpenSprinkler/OpenSprinkler-Firmware (github.com)

After some test I noticed that the Opensprinkler port I’m using loses the correct date after some time, it may be caused by the lack of RTC on my bare bone wemos D1.
I’ve noticed there’s anoter OS port to ESP8266 that should tackle this issue:

the problem is that this port uses different PIN (GPIO2) so soldering is needed, my developer (lack of)
skills don’t allow me to change the code to reflect ecodina FW wiring…

Hello @empi.sk , Dear all

Thanks for your project .
I am a newby in Home assistant.

Is it possible to make an update of the MQTT version have a card for each pump :

  1. watering schedule 2 times / day like > am and pm
  2. weeks days selection to water or not
    thanks
    Here a leave a link to the card I have seen in another project
    Link

Here added also the picture card

I flashed the ecodina firmware on a spare Wemos D1 Mini Pro I had lying around and I configured wifi (can ping it fine) and mqtt but on mqtt explorer I only see:

16/05/2024 20:15:43 Rebooted
16/05/2024 20:15:43(-0 seconds) Dead Somewhere

I get these messages when connected and disconnected to my Hunter controller. Any ideas?

Should I be seeing other messages?

Also, I noticed that the voltage across 24VAC (GND) and REM was around 5V - will this be an issue because I’m connecting it to the 3V pin on the Wemos?

Since I couldn’t get the ecodina firmware working, I uploaded this image to my ESP8266 and I got it up and running but I get an “Err” on screen when I try and run a sprinkler. Maybe I’m connecting it up wrong?

Is this how you’re supposed to connect the ESP8266 with the Hunter controller? Exchanging GPIO16 with GPIO2 for the OpenSprinkler firmware?

Hi, the connection if done ad depicted in the image seems to be good. In my case I got it working at first shoot so I don’t know what to say. Which board did you use? Which Hunter product do you have?
I’m using a Wemos d1mini on a Hunter X-Core 6 zones controller.

I’m a novice and I may make some mistake but you can:

  • try connecting VCC to the other connector of the 24VAC on the hunter (it shouldn’t matter but try anyway)
  • try changing in the source code the GPIO port used on the esp8266 and rewire accordingly (file hunter.h, line16) and see if it works.
#define HUNTER_PIN  16 // XXX D0

Thanks for your response mate.

I’ve tried a NodeMCU board and a Wemos D1 Mini Pro. I’ve got an X-Core standard 4 zone controller. Have you wired yours up the same way as the diagram I uploaded?

Connected as depicted in picture

1 Like

Thanks mate. Which OpenSprinkler Hunter source are you using?

1 Like

Thanks for your help mate! I finally got it working but as @Nikitarex mentioned further up, I had to modify quite a bit of code to compile it successfully.

Unfortunately it looks as though my local rain sensor wired to the SEN ports is ignored. I think it’s because the rain sensor only stops scheduled jobs from the hunter and because the ESP8266 is wired to the REM (Remote) port, it’s assumed that the job is being run manually and thus bypasses the rain sensor’s condition. I’ve ordered the Open Sprinkler Pi board and I’ll swap to that.

For anyone who’s having issues compiling the Hunter port of OpenSprinkler, I’ve made a number of changes to fix the compiling issues here: GitHub - gyrex/OpenSprinkler-Firmware-Hunter: OpenSprinkler Unified Firmware for OpenSprinkler, OpenSprinkler Pi, and OpenSprinkler Beagle.

I’ve also changed the board type to NodeMCU, if you want to use a Wemos D1, comment out the NodeMCU and uncomment the Wemos D1 from platformio.ini

Hi everyone,

I’m having trouble with an integration involving the Hunter WiFi sprinkler system and Home Assistant. I’m using the repository (hunter-wifi/esp8266-hunter-sprinkler at f7e0a6496be1fb4698777e1087b18f6468300ea0 · anubisg1/hunter-wifi · GitHub), but I’m not utilizing the MQTT functionality. Instead, I’m trying to use the REST command approach as shown in the example above from earlier this post…:

rest_command:

  start_irrigation:
    url:'http://{{ target }}/api/start/zone/{{ zone_number}}?time={{ time_minutes }}&result={{ webhook }}
    method: 'GET'
    content_type: 'text/plain'
  stop_irrigation:
    url:'http://{{ target }}/api/stop/zone/{{ zone_number}}&result={{ webhook }}
    method: 'GET'
    content_type: 'text/plain'

I dont know 100% how to connect Home Assistant with HunterX. right now, this is my code, which I have placed it in cofiguration.yaml:

rest_command:
  startzone:
    url: "http://192.168.1.222/api/start/zone/{{ states('input_select.zonenumber') }}?time={{states('input_number.zone_' ~ states('input_select.zonenumber') ~ '_timer')}}"
  stopzone:
    url: "http://192.168.1.222/api/stop/zone/{{ states('input_select.zonenumber') }}"

switch:
  - platform: template
    switches:
      hunterirrigation:
        friendly_name: "Irrigation On/Off"
        turn_on:
          - service: rest_command.startzone
        turn_off:
          - service: rest_command.stopzone
        icon_template: >-
          {% if is_state('switch.hunterirrigation', 'on') %}
          mdi:water-pump
          {% else %}
          mdi:water-pump-off
          {% endif %}

id: '1626945764401'
alias: Irrigation timer
  description:''
trigger:
    platform: state
    entity_id: switch.hunterirrigation
    from: 'off'
    to: 'on'
condition: []
action:
    delay:
      hours: 0
      minutes: '{{ states(''input_number.zone_'' ~ states(''input_select.zonenumber'')
        ~ ''_timer'') | int }}'
      seconds: 0
      milliseconds: 0
    service: switch.turn_off
    target:
      entity_id: switch.hunterirrigation
mode: single

and this is the error message that I am getting:

I know the ESP board is working correctly because I was able to reach the WateringSystemAP and register my wifi. Which then, I am able to ping its IP address within the my home network. However, I feel like I’m missing something crucial in the REST command configuration to complete the integration successfully.

Could someone please assist me in resolving this issue and guiding me on how to properly connect Home Assistant with the HunterX sprinkler system using the REST command approach?

Thank you

ok, so I made some headway. I am able to connect with Home Assistant now using the code and HELPERS. the caveat was I NEED to use the same type and name for the helper which connect {{input_select.zonenumber}} and {{input_number.zone_#}} with the code in configuration.yaml…(# = zone you are selecting). so if you are doing the first zone, {{input_number.zone_1}}. if you are doing second zone, then {{input_number.zone_2}}, and so on.

So now the problem is that I can ONLY do the 1st zone. if I try different zones (2-6), the HunterX “sees” it, but it immediately returns back to idle. I know this because I can see it in my HunterX display where the it flickers from “idle” to “run” then “idle” within a second.

if anyone had this problem before and could assist me, I would appreciate it very much.

I realize that this topic is mostly from years past, but it seems to be the most appropriate for my project.

I am looking to control my XCore-400 through the remote access line. But this is secondary so I can do some sport watering or turn the irrigation on and off as I make repairs.

I need to let the landscaping folks continue to choose the schedule and program the controller in the normal way.

So, I’d like to monitor zones 1-3 and report back running status and running time. I expect to do this by monitoring the 24VAC zone outputs and publishing status updates. (Simple voltage divider or optocoupler and filter to a GPIO pin.)

At first, I thought about using regular ESPHome, but I saw all the work to get this project going with MQTT which gets me halfway there.

My first question is: “Which repository should I be accessing the project source/binary from?” anubisg1 or ecodina?

My second question is, “What approach would folks use to monitor 3 or 4 pins and report the status back to HA?” I’m OK using MQTT with anubisg1’s or ecodina’s firmware. I’m also OK using ESPHome as a base. I don’t really want to do anthing that involves callbacks to HA as I often run two instances.

With ESPHome, it looks like I’ll have to integrate the HunterRoam library, but the status sensing and MQTT are built-in. Building off either of these repositories means I have to detect GPIO changes and publish a new message to MQTT.

I’m just getting started with arduino and ESPHome, but I am a long-time C++ programmer.

Any advice, suggestions or links are greatly appreciated! (Of course, if there’s already an ESPHome project for Hunter ROAM access, that’d be even better!)

Sorry to disappoint you but the hunter devices AFAIK don’t report back the system status via REM port, so all you read in the previous posts is only related to send commands to the watering system, not to get status info.
I thin that barring opening up the device and tapping directly the pcb signals your only way out is monitoring the output lines voltages.

Appreciate the quick response…

I wasn’t talking about getting status from the REM port.

Rather, I’d monitor zone terminals 1, 2, etc where they are activating the valves. It’s 0V when not activated and 24VAC when the zone is supposed to be running (measured between the zone terminal and the Common terminal). So I’ll use up 3 GPIOs to monitor 3 zones. Access is as easy as accessing the REM port.

I’m more interested in this than turning on the sprinkler remotely. This way I can monitor the timing and amount of water I’m getting.

(Of course, the only thing I can’t know from this is if the water main is actually turned on. For that, I’m inclined to put a pressure sensor on the first zone or a water sensor where I can determine that water is actually coming out. I guess I could also put a vibration sensor on the line feeding the valves to know that water is flowing.)

Doing the monitoring part would be much easier with ESPHome than a dedicated app based on platform.io. I get easy communication with HA and things like debouncing without having to do any coding beyond YAML.