Why a new firmware?
ericvb opened this issue · 8 comments
Hi @gashtaan,
Via your posts on the github repos of @ecodina and @anubisg1, I saw your github project on a alternative firmware.
Unfortunately, there is not much information in the readme about the why, how, what, ... :-)
Can you explain more about the why of your project?
My reason for the information quest is an integration with Home Assistant.
In Home Assistant you have access to rain forecasts that you can use in automations.
The Hunter-X controller has a rain sensor, but that doesn't stop it from spraying the dry day before while it's raining the next day.
Hi,
simply put, some features of that controller didn't satisfy my needs or were even completely missing (wi-fi support).
I was planning to build my own irrigation controller, but then some sh*tty plastic part of Hunter knob broke and I found out that there is no way to order such part from Hunter which made the unit practically unusable. When I opened it and seen that it's using PIC that is pretty well documented (many thanks to Microchip) as main MCU, I realized that I can exploit existing hardware to do what I want.
At first I had to somehow download the protected firmware from it to reverse engineer it entirely (I had to bought more units to do it, but at least I got spare part of that broken knob) . Initially I was hoping that I can use existing remote protocol to control the unit without need to reprogram entire MCU, but the protocol turned out to be very simple - apart starting the station/program it can do nothing else. So I created alternative firmware. I had many plans how to improve it, possibilities are endless after all, but unfortunately my spare time is not...
Sorry for the lack of the documentation about this project, but to be honest, I'm lazy to write tutorial for such quite complicated matter. If someone already know how to build that firmware from source and reprogram MCU via ICSP, I'm ready to help.
Thanks @gashtaan for all of the work on this - that is one awesome knob fix!
Regarding integration with Home Assistant, I simply create a switch that calls the url which could then be integrated with the more sophisticated weather data using something like: https://github.com/jeroenterheerdt/HAsmartirrigation
Regarding setting up the switches to simply turn on irrigation, I use the following:
switch:
- platform: command_line
sprinkler:
command_on: /bin/bash -c "time=3 ; for zone in {1..15} ; do curl -X GET http://192.168.2.184/api/start/zone/\$zone?time=\$time ; sleep \$((\$time*60 + 1)) ; done" & echo $! > /config/scripts/sprinkler.pid
command_off: /bin/bash -c "pkill -P $(cat /config/scripts/sprinkler.pid); kill -HUP $(cat /config/scripts/sprinkler.pid)"
sprinkler_beds:
command_on: /bin/bash -c "time=3 ; for zone in 1 2 6 7 10 ; do curl -X GET http://192.168.2.184/api/start/zone/\$zone?time=\$time ; sleep \$((\$time*60 + 1)) ; done" & echo $! > /config/scripts/sprinkler.pid
command_off: /bin/bash -c "pkill -P $(cat /config/scripts/sprinkler.pid); kill -HUP $(cat /config/scripts/sprinkler.pid)"
sprinkler_program:
command_on: /bin/bash -c "curl -X GET http://192.168.2.184/api/start/program/1" & echo $! > /config/scripts/sprinkler.pid
command_off: /bin/bash -c "pkill -P $(cat /config/scripts/sprinkler.pid); kill -HUP $(cat /config/scripts/sprinkler.pid)"
It seems @gashtaan's frimware is much more advanced (but more complicated).
As for the integration with HA, I recently released an update that enables MQTT. You can still use @loopy321's code, but now have an alternative: https://ecodina.github.io/hunter-wifi/#!pages/mqtt.md
@loopy321 my knob fix was neither practical nor cheap :) I needed two units to retrieve a one half of the firmware from each of them (to overcome MCU's software protection). Unfortunately second unit I bought was version 1.x with completely different MCU - Samsung, as they don't provide any documentation of their chips, it was useless for me. So I bought another one of version 3.x. The unit I already had was version 2.x so I got first half of the firmware of v3 and second half v2. Not great, but at least something :)
@ecodina actually, my firmware is much simpler. Stock firmware have a lot of features that I never needed, so I didn't bother to implement them. What I miss in the stock firmware is, for example, possibility to program/start multiple stations at the same time or start the irrigation even if the unit is switched to Off.