I have a Hunter X-Core irrigation controller (8 zones) and I wanted to integrate it into homeassistant for better control.
I had planned to add a relay to open the valves and bypass the controller (turned off) but I found out that there is a pin exposed for remote control.
I found this project and I want to build it using ESPHome. https://www.loullingen.lu/projekte/Hunter/index.php?language=EN
Can anybody point me to the right direction?
One idea is to import the ardruino files and write the YAML for custom switches.
I have almost none programming knowledge so there might be an easier way to accomplish what I want that I don’t know about.
I think I need to define a (or more) class.
The available functions are the following. I only need to operate through a switch HunterStop, HunterStart and HunterProgram. The rest is internal as I understand it.
And I use 2 helpers
input_select.zonenumber = Dropdown menu to select specific zone to water
input_number.zone_1 - 6_timer = Where I have 6 sliders to select time for each zone.
I think your approach is more clever but didn’t know how to send data through your service.
rest_command.start_irrigation
Anyway, it’s working and I learned some things about templates for next time
My only problem with the above is the icon change because it errors with
Template loop detected while processing event:
I think I could either set a variable or add the change of the icon in the Automation I have set to “turn off” the irrigation only in HomeAssistant like a timer (as the interaction with the hunter controller is one-way).
I tested and it works perfectly!
now all i want to add is the support to the webhook to get a result.
i’m thinking to use the trigger webhook to either send me a notification, or to move the switch back to off (if i start) or on (if i stop) the switch.
adds MQTT, mDNS and OTA support (i had to temporarily drop the captive portal though until i figure out how to get MQTT subscription work with that Async Wifi Manager.
i also fixed an issue in the API webhook response so that now HA can understand it
This automation for example would get the webhook from the API call and use it to send a phone notification:
alias: test
description: ''
trigger:
- platform: webhook
webhook_id: zone_start
id: zone_start
condition: []
action:
- service: notify.mobile_app_sm_g965f
data:
message: '{{ trigger.json.action }} Ended with {{ trigger.json.result }}'
mode: single
the results are sent to the result topic, and the zone/program topics expect the following data
{ "action" : "start" , "time" : 1 } --> send to zone topic to start the zone for 1 minute
{ "action" : "stop" } --> send to zone topic to stop the zone
{ "action" : "start" } --> sent to program topic to start a program
if you try it, let me know what you think about it
Thanks for the fork! I was just getting started with the ecodina branch and then saw your post. It appears that the wifi config is held over from my prior ecodina flash… (does that sound correct?) Also, how do you config the MQTT host/username/pass?
I fetched and merged his new changes. Really they were all about documentation.
That said, I’m trying to stay as close as possible to ecodina’s repository as everything I do I want to merge there.
The only difference between his and my repository today is that I have added OTA upgrades support. While working, I wanted to still refine it a little before sending it to him.
It took me sometime but I figured it out. Will share my configuration here for other benefit from.
My aim was to be able to select a zone and start the irrigation for a adjustable period of time. Next to that I wanted it to be flexible enough to be used in an automation in the future.
Last week a user asked me about how I approached integrating the Hunter X-Core via DM. To help out future users getting started I will also post my answer to him in this topic.
Setup the mqtt broker
If you don’t want to communicate to the WeMos D1 Mini Pro via mqtt skip this step
First you setup a mqtt broker to communicate with the WeMos D1 Mini Pro (mosquitto).
I prefer communication via mqtt since you don’t need to know the WeMos IP address. And therefor don’t have to configure a static IP.
Setup the WeMos D1 Mini Pro
Install the software on the WeMos D1 Mini Pro as described on the Github page.
Make sure to fill in all requested information when you configure the WeMos via the web interface otherwise the WeMos won’t start properly and end up in a boot loop.
If you don’t want to use mqtt you have to fill in something in the web interface configuration otherwise you will end up in the boot loop.
Connect the Wemos to the Hunter X-Core
Now follow the guide on Github to connect the WeMos to The Hunter X-Core. The documentation linked to from the start post is also worth reading.
The WeMos fitted inside the Hunter’s case so the risk of someone accidently damaging it is pretty small.
Debugging mqtt
Use MQTT-Explorer to connect to your mosquito broker. If I remember correctly the WeMos should send a message to the broker on start up. That message will include the mqtt address. In my case this was hunter/X-CORE.
Integrating in Home Assistant
At this point you can copy past my code to a Home Assistant Package and modify to your preferences. As far as I understand a package is just a yaml file where you can bundle multiple entities with a certain purpose.
Add packages to your configuration.yaml (I added it at the top).
I’ve set up the project as described (thank you dehaas). Wemos is connected to the 24VAC on the hunter using the 3.3V output from the board. I see the commands comming through in my mqtt broker and I’m getting a result back from the board.
So it all seems to work great except the fact that my hunter is doing nothing if I send a command.
Is there any way of checking if the Wemos is communicating correctly with my hunter?
I also made a similar UI card as yours. I added a conditonal card which will show corresponding zone time input. I tried template entity card, to conditionally show the corresponding zone time input, but it quite doesn’t do what I wanted :