Giter VIP home page Giter VIP logo

sfeakes / aqualinkd Goto Github PK

View Code? Open in Web Editor NEW
164.0 29.0 46.0 24.57 MB

Daemon to control Jandy Aqualink RS pool equipment from any home automation hub (Alexa, Homekit & Siri, Home Assistant, smartthings, domoticz etc) or web browser.

License: Other

Makefile 0.59% C 75.36% Shell 0.92% HTML 13.69% JavaScript 0.21% C++ 9.24%
pool-equiptment automation-hub raspberry-pi mqtt daemon domoticz pool pool-automation zodiac aqualink

aqualinkd's People

Contributors

agprimatic avatar ballle98 avatar ktownsend-personal avatar rckforme avatar sfeakes avatar stunney avatar tcm0116 avatar vziukas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aqualinkd's Issues

Smartthings integration

Hi,

First of all thanks for a great piece of software, I am running it on a raspberry pi and it works flawlessly.
Probably a dumb question, but I was not able to integrate Aqualinkd with Samsung Smartthings. Could you please post steps.
Thanks!

homebridge and aqualinkd on two different machines

Great project and I think I got way close to the end but can't get mqtt messages from aqualinkd to homebridge machine.

when I check the daemon.logs on the homebridge machine I just get the following:
Oct 1 06:26:03 raspberrypi homekit2mqtt[637]: 2018-10-01 06:26:03.220 #33[30m#033[42m #33[49m#033[39m mqtt reconnect
Oct 1 06:26:04 raspberrypi homekit2mqtt[637]: 2018-10-01 06:26:04.225 #33[30m#033[42m #33[49m#033[39m mqtt reconnect
Oct 1 06:26:05 raspberrypi homekit2mqtt[637]: 2018-10-01 06:26:05.230 #33[30m#033[42m #33[49m#033[39m mqtt reconnect
Oct 1 06:26:06 raspberrypi homekit2mqtt[637]: 2018-10-01 06:26:06.239 #33[30m#033[42m #33[49m#033[39m mqtt reconnect

homebridgeconfig.json.txt
homekit2mqtt.defaults.txt
homekit2mqtt.service.txt

Homekit2mttq sSerial error

Hello,

Could you have look ate the below and see where I've made an error?

I first Set up Homekit2mqtt & tested, it fine works with several accessories.
then: Set up AqualinkD as per instructions, tested and confirmed it worked on physical Aqualink.
Created FiterPump Service aqualinkd/Filter_Pump/set in example-homekit2mqtt.json
Ran : sudo aqualinkd -d -c /etc/aqualinkd.conf

MQTT messages reach the console:
Debug: MQTT: topic aqualinkd/Filter_Pump/set 0 Info: MQTT: MATCH Filter_Pump to topic aqualinkd/Filter_Pump/set Info: MQTT: received 'OFF' for 'Filter_Pump', turning 'OFF' Info: Queue send '0x02' to controller
then
Error :Aqualink daemon looks like serial error, resetting

Also sudo systemctl start aqualinkd does not launch AqualinkD

Appreciate any feedback...

Failed with result 'signal' , Restart=on-failure ?

I've been getting crashes of aqualinkd for the few weeks I've had it installed. Running on a pi zero w on rasbian stretch lite. Not too big of a deal but I have to restart the service or reboot the pi which I can't do from the spa ;)

system error logs upon crashes are these:

...
Mar 28 18:33:54 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
Mar 28 18:33:54 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
Mar 28 19:54:10 raspberrypi systemd[1]: aqualinkd.service: Main process exited, code=killed, status=11/SEGV
Mar 28 19:54:10 raspberrypi systemd[1]: aqualinkd.service: Unit entered failed state.
Mar 28 19:54:10 raspberrypi systemd[1]: aqualinkd.service: Failed with result 'signal'.

I've searched all my logs and can't find any bad checksums or bad packets like here in issue #30

do i need to enable DEBUG_SERIAL to find checksum errors?

I noticed that Restart=on-failure is commented out in aqualinkd.service . Is this for a reason? Will I run into problems if I enable Restart=on-failure

Aqualinkd not responding to MQTT commands

I've got aqualinkd and mosquitto running on a RaspberryPi and I'm working on a SmartThings integration. However, it looks like aqualinkd is not subscribing to the "set" MQTT topics.

When I start aqualinkd, i see a message in the log indicating "Starting MQTT client to localhost:1883". However, based on net_services.c, I would expect to then see a "MQTT: Connection acknowledged" message, which appears to occur right before it subscribes to the topics. However, I never see the connection acknowledged message. aqualinkd does publish status to mosquitto, so it looks like the connection is good.

Any thoughts on why this may be occurring?

commands not accepted if I have all button wired in parallel

Frist let me say thank you. This is a great app. I have installed AqualinkD on a Raspberry Pi successfully. If I use the wires into my house for the AqualinkD controller only, everything works fine. If I connect the RS6 controller in parallel the AqualinkD controller can read the status of the system but cannot make changes. I am hoping this is previous problem but I could not find any info. The jumpers on the RS6 controller are set to controller 1

I ran the serial logger without the RS6 Controller connected and it shows several available ids but if I run it with just RS6 controller hooked up is shows that all available IDs are taken and when I look at the logs for AqualinkD when the RS6 controller is connected I see a duplicate ignored error on the Probe ACK Status sequence repeated regularly after all sends.

AqualinkD log clip with RS6 connected and not able to get response to commands
Oct-06-18 11:15:46 AM Debug: RS received packet of type Probe length 7
Oct-06-18 11:15:46 AM Debug: Send 11 bytes to serial
Oct-06-18 11:15:46 AM Debug: Sent | HEX: 0x00|0x10|0x02|0x00|0x01|0x00|0x00|0x13|0x10|0x03|0x00|
Oct-06-18 11:15:46 AM Debug: RS Received duplicate, ignoring.
Oct-06-18 11:15:46 AM Debug: Received Packet for ID 0x0a of type Probe <-- Aqualinkd ID

serial_logger ran with AqualinkD stopped and RS6 controller connected
Debug:
Notice: ID's found
Notice: ID 0x11 is in use
Notice: ID 0x08 is in use
Notice: ID 0x23 is in use
Notice: ID 0x10 is in use
Notice: ID 0x12 is in use
Notice: ID 0x1a is in use
Notice: ID 0x20 is in use
Notice: ID 0x21 is in use
Notice: ID 0x22 is in use
Notice: ID 0x09 is in use
Notice: ID 0x1b is in use
Notice: ID 0x19 is in use
Notice: ID 0x18 is in use
Notice: ID 0x13 is in use
Notice: ID 0x0a is in use
Notice: ID 0x0b is in use
Notice: ID 0x01 is in use
Notice: ID 0xf1 is in use
�]0;pi@raspberrypi: /software/AqualinkD��[01;32mpi@raspberrypi�[00m:�[01;34m/software/AqualinkD $�[00m exit

SWG switching on/off

Love this project. Thank you so much for this great code. I have a Rev T2 PDA PS4 combo board. Everything works pretty well. However the aquapure panel beeps about every minute switching from the set aquapure % with "cell on" to 0% and cell off. It seems like it is conflicting or something somehow. If I turn off or stop aqualinkd then the system works fine. Any ideas?

HTTP Api matching on default PDA button names rather than assigned name in aqualind.conf

I debugged the code section in net_services and it is matching on default button names for the HTTP Api. Is this intended behavior?

**** If I do the following:

curl http://localhost?command=Spa_Bubbles&value=off
[1] 4220
dietpi@PoolPi:~$ Unknown command

**** Now if I try:

dietpi@PoolPi:$ curl http://localhost?command=Aux_2&value=off
[1] 4230
dietpi@PoolPi:
$ Ok

**** Relevant conf section:

##button_04_label=Waterfall
button_04_label=Spa Bubbles
#button_04_dzidx=40
#button_04_PDA_label=AUX2

**** Relevant logging:

Apr-01-19 18:59:07 PM Info: URI request: '/?command=Spa_Bubbles'
Apr-01-19 18:59:07 PM Info: WEB: Message command='Spa_Bubbles'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Filter_Pump'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Spa_Mode'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_1'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_2'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_3'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_4'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_5'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_6'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Aux_7'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Pool_Heater'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Spa_Heater'
Apr-01-19 18:59:07 PM Info: WEB: Message request button name match input/btn??: 'Spa_Bubbles' / 'Solar_Heater'
Apr-01-19 18:59:07 PM Info: RS Message :- 'Air Sensor OK'

0 setting on Aquapure not reflecting on Web(API) or MQTT

I noticed that when I set my SWG to 0, the Web Page, Web API, and MQTT continue to reflect the last value vs. the 0% value. It reports correctly at any other setting I have set via the RS. Also cannot seem to publish a new SWG setting using MQTT or Web API. Seems like the set command is ignored.

When looking at logs, if a set a percent setting using the RS, the logging reflects the update, however when using RS to set to 0, the log does not seem to reflect the new setting although it is indeed set on the RS.

MQTT Ignoring Set Command.

` pi@aquad:/var/log $ tail -f /var/log/aqualinkd.log |grep MQTT
May-07-19 01:15:54 AM Debug: MQTT: Ignore aqualinkd/SWG/Percent/set 10
May-07-19 01:16:14 AM Debug: MQTT: Ignore aqualinkd/SWG/Percent/set 25
May-07-19 01:16:19 AM Debug: MQTT: Ignore aqualinkd/SWG_Pool/Percent/set 25
...
May-07-19 01:20:41 AM Debug: MQTT: Ignore aqualinkd/SWG_Pool/Percent/set 0

Hardware connection

I very excited to see your work on this. It is exactly what I've been looking for for a while now. Can you give some more detail on how to hook this to the controller? I don't have an inside controller so I'd be attaching to the control panel.

Thanks!

Enhancement request

Hi Shaun

Aqualinkd seems to be working well. One thing I noticed though is that it holds on to temperature data beyond it being valid. For example, I heated the spa yesterday and in HomeKit the temp is still reported as 100 even though it has cooled back down to air temp.

So, question is, when aqualinkd returns a null value for temp can we have it pass some value to HomeKit? Ideally a ‘-‘ would be return but I don’t know if HomeKit can display that in the temperature data type. So, maybe ‘0’ or current air temp instead?

Does this make sense?

Thanks.

John

Does aqualinkd/solar_heater/ exist for MQTT?

Does aqualinkd/solar_heater/ exist for MQTT? As my Aqualink RS6 uses the Solar Pump Extra AUX to run the Waterfall relay.

This is the best implementation of Aqualink web/API access ever... Period. I installed it on a Pi Zero attached to a USB-RS485 converter, all running through a +5V regulator that is hooked up to the main voltage of the existing Aqualink RS6 panel. It all fits behind the panel and is running on Wi-Fi.

The MQTT and HTTP API is working well with HASS.IO and I can control everything! I am even thinking of clearing the programs in the panel and running my own automations through HASS.IO.

Thanks for all your effort!

co-exist with physical PDA

I forked the project and started to work on this myself here ballle98#4 but I thought it would be good to get some advice.

As it stands I can't leave AqualinkD running because it never gives up control so that another PDA can take control. On a real PDA if you don't press any buttons for 30-60 seconds it will go to sleep and stop responding to status messages. The the controller starts sending probes again. Even if AqualinkD is using a seperate ID (like 62) and the PDA is using 60, the PDA will not work because no probes are sent for 60-63.

I'm thinking that if there have been no program actions for 60 seconds and there are no threads active it would be safe to stop acking until the force status update timeout.

AqualinkD crashes regularly if I cycle a device on and off a few times

For example, if I switch the pool light on and off with a 5 second delay between the switch. After a few cycles the AqualinkD service stops. Tailing the aqualinkd.log shows it freezes.

Here is a dump from the syslog

Nov 21 20:38:53 raspberrypi systemd[1]: Starting Aqualink RS daemon...
Nov 21 20:38:53 raspberrypi aqualinkd: Aqualink Daemon v1.2.3
Nov 21 20:38:53 raspberrypi aqualinkd: Config log_level = 7
Nov 21 20:38:53 raspberrypi aqualinkd: Config socket_port = 80
Nov 21 20:38:53 raspberrypi aqualinkd: Config serial_port = /dev/ttyUSB0
Nov 21 20:38:53 raspberrypi aqualinkd: Config web_directory = /var/www/aqualinkd/
Nov 21 20:38:53 raspberrypi aqualinkd: Config device_id = 0x0b
Nov 21 20:38:53 raspberrypi aqualinkd: Config override frz prot = NO
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_server = (null)
Nov 21 20:38:53 raspberrypi systemd[1]: Started Aqualink RS daemon.
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_dz_sub_topic = (null)
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_dz_pub_topic = (null)
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_aq_topic = (null)
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_user = (null)
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_passwd = (null)
Nov 21 20:38:53 raspberrypi aqualinkd: Config mqtt_ID = aqualinkd_b827ebd8f3
Nov 21 20:38:53 raspberrypi aqualinkd: Config idx water temp = 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config idx pool temp = 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config idx spa temp = 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config idx SWG Percent = 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config idx SWG PPM = 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config PDA Mode = NO
Nov 21 20:38:53 raspberrypi aqualinkd: Config deamonize = YES
Nov 21 20:38:53 raspberrypi aqualinkd: Config log_file = /var/log/aqualinkd.log
Nov 21 20:38:53 raspberrypi aqualinkd: Config light_pgm_mode = 0.00
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Filter_Pump = label Filter Pump | PDAlabel FILTER PUMP
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Spa_Mode = label Spa Mode | PDAlabel SPA
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_1 = label Spa Jets | PDAlabel AUX1
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_2 = label Waterfall | PDAlabel AUX2
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_3 = label Spa Light | PDAlabel AUX3
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_4 = label Pool Light | PDAlabel AUX4
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_5 = label NONE | PDAlabel AUX5
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_6 = label NONE | PDAlabel AUX6
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Aux_7 = label NONE | PDAlabel AUX7
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Pool_Heater = label Pool Heater | PDAlabel POOL HEAT
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Spa_Heater = label Spa Heater | PDAlabel SPA HEAT
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Config BTN Solar_Heater = label Solar Heater | PDAlabel EXTRA AUX
| dzidx 0
Nov 21 20:38:53 raspberrypi aqualinkd: Starting web server on port 80
Nov 21 20:38:53 raspberrypi aqualinkd: Starting MQTT client to (null)
Nov 21 20:38:53 raspberrypi aqualinkd: Listening to Aqualink RS8 on serial port: /dev/ttyUSB0
Nov 21 20:38:54 raspberrypi aqualinkd: Control Panel 8157 REV K
Nov 21 20:38:54 raspberrypi aqualinkd: Getting pool & spa heat setpoints from aqualink
Nov 21 20:39:00 raspberrypi aqualinkd: Getting freeze protection setpoints
Nov 21 20:39:40 raspberrypi aqualinkd: Serial read bad checksum, ignoring
Nov 21 20:39:40 raspberrypi aqualinkd: Bad receive packet | HEX: 0x10|0x02|0xf8|0x09|0x00|0x00|0x0a|0x10|0x03|
Nov 21 20:39:53 raspberrypi aqualinkd: Serial read bad checksum, ignoring
Nov 21 20:39:53 raspberrypi aqualinkd: Bad receive packet | HEX: 0x10|0x02|0xf8|0x09|0x00|0x00|0x0a|0x10|0x03|
Nov 21 20:39:55 raspberrypi aqualinkd: Serial read bad checksum, ignoring
Nov 21 20:39:55 raspberrypi aqualinkd: Bad receive packet | HEX: 0x10|0x02|0xf8|0x09|0x00|0x01|0x0b|0x10|0x03|
Nov 21 20:39:59 raspberrypi aqualinkd: Serial read bad checksum, ignoring
Nov 21 20:39:59 raspberrypi aqualinkd: Bad receive packet | HEX: 0x10|0x02|0xf8|0x09|0x00|0x00|0x0a|0x10|0x03|
Nov 21 20:40:49 raspberrypi systemd[1]: aqualinkd.service: Main process exited, code=killed, status=11/SEGV
Nov 21 20:40:49 raspberrypi systemd[1]: aqualinkd.service: Unit entered failed state.
Nov 21 20:40:49 raspberrypi systemd[1]: aqualinkd.service: Failed with result 'signal'.

Aqualink RS Pool Only

Pool Only Aqualink RS 8 Revision MMM

I have mapped most buttons to the one-touch buttons:
Button 01 Filter Pump
Button 02 Not sure what this does on a Pool Only Aqualink RS – it usually controls a Spa in an Aqualink Pool and Spa Version. I see no need for it in the Pool Only Aqualink.
Button 03 Aux 1
Button 04 Aux 2
Button 05 Aux 3
Button 06 Aux 4
Button 07 Aux 5
Button 08 Aux 6
Button 09 Aux 7
Button 10 Temp 1
Button 11 Temp 2
Button 12 Solar Heater

Issues Identified on Aqualink Pool Only
The only issues so far identified relate to Temp1 and Temp2.

The Temp1 and Temp2 functions do not work properly in a Pool Only version of Aqualink. These would normally be the Pool Heater and Spa Heater temperature settings respectively in the Pool and Spa Aqualink.

Temp1/Temp2 Issues Identified for F versus C
Programing of the Temp1 and Temp2 buttons when pressed on the AqualinkD webpage appear to be for Farenheit only, even though my system is in Celcius. I would assume this is a problem also for Pool and Spa Users trying to program the Pool Heater and Spa Heater.

Notwithstanding, setting Temp1 or Temp2 temperature even if I switch my system to Farenheit does not save the actual temperature programmed.

If Filter Pump is OFF

  • If I activate Temp2, it comes up with “communication error” after 2 seconds for about 5 seconds duration. It then illuminates and says “Heating to 0” - rather than the setpoint.
  • If I activate Temp1 while Temp2 is activated, Temp1 successfully illuminates but also states “Heating to 0” - rather than the setpoint. Also, when Temp1 is activated along with Temp2, Temp2 should show "enabled" rather than off while Temp1 is on.
  • Also while Temp1 is activated, if I try to enable Temp2 I get a “Connection Error” although this goes away after about 20-40 seconds

If Filter Pump is ON:

  • Temp2 occassionally flashes the Spa Water Temperature which appears to be derived from the Pool Water Temperature – otherwise it generally shows "--“
  • When Pressing Temp2, it briefly illuminates, activates the Aqualink Temp2 function but is not illuminated on the AqualinkD webpage, while being enabled on the OneTouch panel. This generally produces a communications error.
  • Temp2 is able to be turned off successfully.
  • Pressing Temp1 briefly illuminates the Button 10 and activates the Temp1 function, but does not remain illuminated.
  • Temp1 is able to be turned off successfully.

If the Filter Pump is in DELAY mode (i.e. during coll down cycle): it generally acts in the same way as if the pump is off.

Regards

Frank

FYI ONLY ABOUT TEMP1 & TEMP2
The OneTouch Panel allows a user to program Temp1 and Temp2 from 1 degrees celcius to 40 degrees celcius included so long as Temp2 must be lower than Temp1. Therefore, effectively in reality Temp1 can be 2 to 40, while Temp2 can be 1 to 39. In Farenheit its 34 to 104.

What is Temp1 and Temp2 supposed to do (from an old Aqualink owners manual):
“Temp1 is the priority (high) temperature. It must be set higher than Temp2, and it overrides Temp2 whenever it is enabled. Set temperature for Temp1 before setting temperature for Temp2.
Temp2 is the maintenance (low) temperature. It must be set lower than Temp1. If Temp2 is on and Temp1 is activated, Temp2 will turn off and its LED will flash when Temp1 is turned off again, Temp2 will re-activate.”

“On pool only and spa only units, you may set two separate temperatures for the pool or spa. Press the Temp1 button to heat to one temperature and the Temp2 button to heat to another.”

ALRS 4 P & S 8158 JJ

Perfect DYI Job Love the work. But seems I need help getting mine online.
I checked and verified my version of the chip as ALRS 4 P & S 8158 JJ.
My PCB, on the other hand, is a question:
Jandy Ind Power Center PCB8124A Assembly #8125

I have a Heater and Salt Gen Attached all of which are seen and controlled by the Square Remote.
LAARS LX400
Goldline 2003 / Cell shows as NatureSoft(a replacement cell)
I get no errors and the process runs without issue.

I can not get the serial logger to anything but:
Notice: Logging serial information!
Please wait.^CNotice: Stopping!
Notice: ID's found
Notice: ID 0x7c is in use
I waited overnight to allow all my equipment to run.

Pi zero
USBtoRS485 wiring verified.

I seem to match the firmware needed but can't seem to find the right combo
Any Ideas.

Variable speed pump

First I want to say THANK YOU! This is great; I have been looking for something like this for a while.

Have you given any thought on how to handle variable speed pumps? I have almost everything else working; I did have to move things around a little. My variable speed pump changes its speed based on what is chosen but there are some extra speed settings that have to be manually chosen.

I am still looking at the light; I updated the colors to reflect the light I have but selecting it turn my fountain off and on :-).

image
image
image
image

Error: Aqualink daemon looks like serial error, resetting.

Any idea whats wrong here?

sudo /usr/local/bin/aqualinkd -d -c /etc/aqualinkd.conf
Notice: Aqualink Daemon v1.2.5
Notice: Config log_level = 7
Notice: Config socket_port = 88
Notice: Config serial_port = /dev/ttyUSB0
Notice: Config web_directory = /var/www/aqualinkd/
Notice: Config device_id = 0x09
Notice: Config override frz prot = NO
Notice: Config mqtt_server = localhost:1883
Notice: Config mqtt_dz_sub_topic = (null)
Notice: Config mqtt_dz_pub_topic = (null)
Notice: Config mqtt_aq_topic = aqualinkd
Notice: Config mqtt_user = 406XXXXXX
Notice: Config mqtt_passwd = 406XXXXXXX
Notice: Config mqtt_ID = aqualinkd_b827eb29b2
Notice: Config idx water temp = 0
Notice: Config idx pool temp = 0
Notice: Config idx spa temp = 0
Notice: Config idx SWG Percent = 0
Notice: Config idx SWG PPM = 0
Notice: Config PDA Mode = NO
Notice: Config deamonize = NO
Notice: Config log_file = (null)
Notice: Config light_pgm_mode = 0.00
Notice: Config BTN Filter_Pump = label Filter Pump | PDAlabel FILTER PUMP | dzidx 0
Notice: Config BTN Spa_Mode = label Spa Mode | PDAlabel SPA | dzidx 0
Notice: Config BTN Aux_1 = label Cleaner | PDAlabel AUX1 | dzidx 0
Notice: Config BTN Aux_2 = label Aux_2 | PDAlabel AUX2 | dzidx 0
Notice: Config BTN Aux_3 = label Aux_3 | PDAlabel AUX3 | dzidx 0
Notice: Config BTN Aux_4 = label Pool Light | PDAlabel AUX4 | dzidx 0
Notice: Config BTN Aux_5 = label Aux_5 | PDAlabel AUX5 | dzidx 0
Notice: Config BTN Aux_6 = label Aux_6 | PDAlabel AUX6 | dzidx 0
Notice: Config BTN Aux_7 = label Aux_7 | PDAlabel AUX7 | dzidx 0
Notice: Config BTN Pool_Heater = label Pool Heater | PDAlabel POOL HEAT | dzidx 0
Notice: Config BTN Spa_Heater = label Spa Heater | PDAlabel SPA HEAT | dzidx 0
Notice: Config BTN Solar_Heater = label Solar_Heater | PDAlabel EXTRA AUX | dzidx 0
Notice: Starting web server on port 88
Notice: Starting MQTT client to localhost:1883
Notice: Listening to Aqualink RS8 on serial port: /dev/ttyUSB0
Info: MQTT: Subscribing mqtt with id of: aqualinkd_b827eb29b2
Info: MQTT: Connection acknowledged
Info: MQTT: Subscribing to 'aqualinkd/#'
Info: MQTT: Subscription(s) acknowledged
Info: MQTT: Published id=1: aqualinkd/Alive 1
Debug: MQTT: Ignore aqualinkd/Alive 1
Debug: MQTT: Ignore aqualinkd/SWG 0
Debug: MQTT: Ignore aqualinkd/SWG/enabled 0
Debug: MQTT: Ignore aqualinkd/Filter_Pump 0
Debug: MQTT: Ignore aqualinkd/Spa_Mode 0
Debug: MQTT: Ignore aqualinkd/Aux_1 0
Debug: MQTT: Ignore aqualinkd/Aux_2 0
Debug: MQTT: Ignore aqualinkd/Aux_3 0
Debug: MQTT: Ignore aqualinkd/Aux_4 0
Debug: MQTT: Ignore aqualinkd/Aux_5 0
Debug: MQTT: Ignore aqualinkd/Aux_6 0
Debug: MQTT: Ignore aqualinkd/Aux_7 0
Debug: MQTT: Ignore aqualinkd/Pool_Heater 0
Debug: MQTT: Ignore aqualinkd/Pool_Heater/enabled 0
Debug: MQTT: Ignore aqualinkd/Spa_Heater 0
Debug: MQTT: Ignore aqualinkd/Spa_Heater/enabled 0
Debug: MQTT: Ignore aqualinkd/Solar_Heater 0
Info: MQTT: Message publishing acknowledged (msg_id: 1)
Info: MQTT: received (msg_id: 1), looks like my own message, ignoring
Debug: MQTT: Ignore aqualinkd/Alive 1
Debug: ++ Websocket joined
Info: WS: Message - Key 'command' Value 'GET_DEVICES' | Key2 '(null)' Value2 '(null)'
Debug: WEB: homebridge used 1545 of 3000
Error: Aqualink daemon looks like serial error, resetting.
Error: Aqualink daemon looks like serial error, resetting.
Error: Aqualink daemon looks like serial error, resetting.
Error: Aqualink daemon looks like serial error, resetting.
Error: Aqualink daemon looks like serial error, resetting.

Request Spa Drain

The RS8 has buttons on the right side for Spa Drain / Spa Fill
We have the ability to Spa Fill but NOT Spa Drain.
Can we get the Spa Drain as a button same a Fill?
Other options, I hate having to go out to side to drain and its the only thing beside getting in the Spa I have to do 👍 outside due to this great project !!!!!!

Using AqualinkD without controller

Hi, I have a Zodiac Tri Chlor unit that has the ability to interface with a controller.

Is it possible to setup and run this software connected to the controller connection of the chlorinator to get updates and control the chlorinator? Such as pump on/off etc?

I realise this isn't an issue with the current code however I wasn't sure the best way to ask the question.

Can't find right ID and nothing happening

I have gone through the process but all I see on the interface are 'serial bad checksum' errors. When I am running the serial logger to get available ports I don't see anything like you have in the documentation, mine all seem to start at around 0x3 and higher. I did eventually see 0x00 is there so I tried that. Once the service is running I mainly see "RS received packet of Type Ack length 3" or "RS received packet of type Unknown '0x1f' length 12"

A couple of questions I have:

  • when I connect my adapter onto my Jandy board, do the wires just go in the same two slots my current Jandy PDA is going into as it is already in there. I have four slots so haven't touched the outside two.

  • Do I need to somehow map the id's for each device then?

Thanks for your help.

Stu

NEWBIE IAQUALINK B0088 More hardware needed?

Sorry if this is a dumb question but I am running a homebridge server and wish to connect to my Jandy Aqualink RS pool controller and use their app. I would like to add control to apple homekit. I currently use the IAQUALINK B0088 that connects my RS via wifi, do I need additional hardware?

Thanks
Icdoo

Issue getting anything to return to the UI on an AquaLink RS4

First let me say thank you for posting this solution! I am very excited to use it but I ran into a road block.

I installed the equipment and software (using the easy one line script from the wiki) and when I start the daemon it starts cleanly but then the UI does not register anything and none of the buttons work or status's for the temperatures etc.

My conf file is:
aqualinkd.conf.txt

I went ahead and ran the following code to pull the RS-485 traffic:
sudo ./release/serial_logger /dev/ttyUSB0 -d > ~/serial_logger.txt
serial_logger.txt

Based on the output I believe I am cabled up correctly. I have attached pictures of my setup.

The service according to systemctl appears to be good:
● aqualinkd.service - Aqualink RS daemon
Loaded: loaded (/etc/systemd/system/aqualinkd.service; enabled; vendor preset
Active: active (running) since Sun 2018-12-30 17:04:55 MST; 8s ago
Process: 2506 ExecStart=/usr/local/bin/aqualinkd $OPTS (code=exited, status=0/
Main PID: 2507 (aqualinkd)
CGroup: /system.slice/aqualinkd.service
└─2507 /usr/local/bin/aqualinkd -c /etc/aqualinkd.conf

Dec 30 17:04:55 raspberrypi systemd[1]: Starting Aqualink RS daemon...
Dec 30 17:04:55 raspberrypi aqualinkd[2506]: Aqualink Daemon v1.2.5
Dec 30 17:04:55 raspberrypi aqualinkd[2506]: Config log_level = 8
Dec 30 17:04:55 raspberrypi systemd[1]: Started Aqualink RS daemon.
Dec 30 17:04:55 raspberrypi aqualinkd[2507]: Starting web server on port 80
Dec 30 17:04:55 raspberrypi aqualinkd[2507]: Starting MQTT client to (null)
Dec 30 17:04:55 raspberrypi aqualinkd[2507]: Listening to Aqualink RS8 on serial
file1-1
file2
file-5

I just enabled logging as well and this is attached to here...
aqualinkd.log.txt

Any ideas?

Not turning on heater

Hello,
Finally got this up and running. Everything is working except turning the heater on. When I use the interface it shows it turns on, On the jandy rs it lights up the light but the heater doesnt turn on.

When I look the iAqualink OneTouch settings it shows a Heat Pump On as one of the values. Im not seeing a Heat Pump in the AqualinkD interface.

What am I missing here?

Changed device_id?

I have been unable to play with it for a while and get back to collecting data for a variable speed pump; I finally had time last night. I look at the pad inside the house and saw that it was frozen, none of the buttons would work. I unplugged the usb2rs485 board from the rpi since it had a solid red light. The pad immediately started responding. I plugged the board back in and it immediately froze again; disconnecting it cleared it again. It had been successfully working with 0x08 but I am wondering if became a conflict after we had a power outage the other day. The config has not changed but I am going to try another address and see if the symptoms change.

AqualinkD & Homekit

Hello,

What great works you have done!
Running HapNodeJS on a Raspi 3, could one run AqualinkD on the same unit or is a separate Raspi suggested?

AqualinkD injects rapsberry pi system time into Aqualink?

(first of all, seriously thank you for this project it is really awesome)

I just got everything set up yesterday (rPi zero W, raspian lite) all installed inside the (new to me) control panel (rs8 8156k)

Anyway, i was pulling my hair out trying to figure out why the aqualink clock kept changing. I thought it had to be an issue with the aqualink itself until I figured out it kept adding 7 hours which was changing it to UTC. Turns out I never updated the time zone in the pi (I now see that I'm not the first to make this mistake).

My question is, how often does AqualinkD inject the time to the aqualink? I'm worried if it does it on startup I may have a power issue with the pi causing it to restart every few hours.

Also, can we maybe add a line to the wiki about this? I really thought the problem was with the aqualink, so I would love to save some future person time if anyone else runs into this.

Thanks!

AqualinkD I think is randomly turning on my Jandy ePump

Ive had this for about 12months now, and somehow something recently for the past week has been happening which is somehow something is turning on my ePump (Jandy Variable Speed) to full speed, but here is the kicker, the RS8 keypad has nothing on, shows its all off. Login into iAqualink app and shows its off. But clearly pump is on since I hear it running and I have an energy monitor that shows its pulling almost 1800watts. Then out of a hunch I decided to check the WEB portion of the iAqualink app, it basically logs you into the Web view. Then I clicked Status, and there I see ePump is on, running full tilt, yet it says "No devices are currently on" below it. Now if I simply turn ON the pump from the app and turn it off, it actually turns off, but at random intervals of Id say 0-12hrs it turns itself back on. So out of a hunch I rebooted my RPi3, still did the same thing next day. Then this time I disconnected the RS485 wiring block off the USB module (I bought this one off Amazon I believe was the recommended one - https://www.amazon.com/gp/product/B01LCFRR3E/ref=oh_aui_search_asin_title?ie=UTF8&psc=1).

After disconnecting the wiring block off the USB serial adapter, its now been 3days and no issue of it randomly turning on.

So now trying to figure out what on the RPi3 side is causing this. Only other thing the RPi3 hosts is my Homebridge for Homekit. Dont use it for anything else.

Here are the pictures of the app side to help understand.
https://ibb.co/YdfM1hp
https://ibb.co/vX4X1mC
https://ibb.co/LPzJmVM

Issue reading temp setpoints

Thank you for the great work on this! It's a nice addition to my home automation setup.

I am having trouble with some of the components involving temperatures. See below the status I get from the API. For example, pool temp is not showing however I see the data on the RS bus.

{"type": "status","status":"AquaPure OFF","version":"6524 REV GG","aqualinkd_version":"1.1","date":"08/29/18 WED","time":"9:37 AM","pool_htr_set_pnt":"-999","spa_htr_set_pnt":"-999","frz_protect_set_pnt":"38","air_temp":"82","pool_temp":" ","spa_temp":" ","temp_units":"f","battery":"ok","leds":{"Filter_Pump": "on","Spa_Mode": "off","Aux_1": "off","Aux_2": "off","Aux_3": "off","Aux_4": "off","Aux_5": "off","Aux_6": "off","Aux_7": "off","Pool_Heater": "off","Spa_Heater": "off","Solar_Heater": "off", "Freeze_Protect": "enabled"}}

Daemon logs
https://pastebin.com/7JjBGwBD

It seems, given the status from API, that it is not being pulled off the bus correctly to begin with.

This will also show up with the pool heater set points. I can toggle on / off the pump, cleaner, heater, lights without issue. I can also read the Pool Air Temp value.

Happy to help debug and test any changes. My c is lacking however :)

Homebridge-AqualinkD doesnt respond to turning or off a device

After upgrading to the latest release I noticed that Homekit integration directions was listed and decided to install MQTT (mosquitto) and installed homebridge-aqualinkd since I already have Homebridge installed and running other things. I got the config.json updated and got my phone to show the devices and what seems to be the actual air temp. But if I turn on any device it shows its on in Homekit but the device isnt on. State changes dont show up on homekit either if I turn on the device from AqualinkD homepage or actual RS panel.

Not sure if I did anything wrong on MQTT side. I noticed it said the following after installing it "Make sure to configure and make sure it starts on boot." What specifically do we need to configure? I have it set for starting on boot by running the command "sudo systemctl enable mosquitto.service".

Post Install Instability

First, thank you for creating this program. I have been wanting to do this for some time and it is exactly what I was looking for. I installed last night using a Pi Zero and USB adaptor from Amazon that was linked to in the WiKi (data + to A and data - to B). At this point I am just running the web interface and am having some stability issues. It starts up and runs, but has crashed on me a couple of times. It also only sometimes adds the SWG info and the Freeze protection info. I have reviewed the log (attached) and the only thing that jumps out at me is the "Warning: Serial read too small", but it looks like it just skips over those. Interestingly, the serial logger app won't run. It just gives the first line and freezes there. If I switch the two lines on the USB device, I get errors in the serial logger as expected. If I leave the data + on A and attach the data - to the third post on the device (which appears to be ground) the serial logger will run as expected with the notice of all available ID's. However, the web interface does not work when wired this way so I switched it back to data + to A and data - to B. Can you take a look at my logs and see if you see anything that I can correct. Again, the web interface does work while running.

Thanks so much for putting this together. Your work is very much appreciated!

aqualinkd.log
screen shot 2018-08-13 at 9 08 33 am

Powering RaspberryPi in control panel

I currently have my RaspberryPi sitting on top of my Aqualink RS OneTouch panel in the house but I was thinking of installing it within the control panel. Has anyone cabled it in the panel?

MQTT - Can aqualinkd/Freeze_Protect/setpoint/set be sent data in Fahrenheit?

Is there a way to allow aqualinkd/Freeze_Protect/setpoint/set in MQTT to receive data in Fahrenheit?

I am using Home Assistant (HASS.IO) and the Climate (or thermostat) function only displays and sets the degrees in Fahrenheit. When I set 32°F in my Home Assistant, the program sends 32 which obviously exceeds the maximum setting in °C for Freeze protection and sets it to 42. I have sent it 1 - 6 manuall and it works fine.

If I could have the Freeze_Protect, Spa_heater and Pool_Heater "/setpoint/set" receive the values in °F it would simplify my interface immensely.

Any thoughts would be greatly appreciated.

MQTT 1.6

My MQTT was upgraded to v1.6 and aqualinkd refused to connect (socket errors). Rolling back to MQTT 1.5 resolved this issue. I have no reason to use v1.6 but wanted to flag if others are experiencing the issue.

Freeze Protect Indicator or Data in MQTT

I am using all MQTT options in my HASS.IO implementation and haven't had a chance until now to check the status of Freeze Protection. I am polling aqualinkd/Freeze_Protect as an indication that it is on or off but it never changes to 1. Please advise if AqualinkD does not relay the state of Freeze Protection to MQTT. If not, it would be a great feature request as Home Assistant is the only way I can see my Freeze Protect status when travelling (As I wouldn't post AqualinkD to the internet as recommended.)

Solar Heater is in the simulator and API but not the old or current web screen.

Huge thanks for this project. I have had an RS485 adaptor in my draw for about three years waiting for time to reverse engineer the protocol and now this to come along!

Plugged everything together today and got almost everything working pretty much immediately.

Brilliant!

I have a solar heater that can be turned on or off connected to the solar aux output.

It does not have a temperature set point, because it is plumbed separately, has its own sensors and does not require the main pump to be running.

aqualinkd knows it's there and I can turn the solar relay on and off via the API and the Simulator.

But I could not see it on the web interface or the old web interface.

I did some digging.

I found issue 9 which reported a bug that caused Solar Heater to not appear unless dzidx was set for that button. Also noted that the bug was reported as fixed.

I did some more digging and found Solar_Heater commented out in /var/www/aqualinkd/config.js

Uncommenting and restarting and flushing some caches and it's all good.

Is this just something that needs more elegant handling?

Or am I subverting elegant handling that isn't working properly?

jsl

One Touch

Is it possible to toggle a One Touch button using aqualinkd?

Aux key codes for multi-panel Aqualink systems (RS2-14)?

Do you happen to know what key codes should be used in aq_serial.h to control additional Aux devices on additional control panels in multi-panel/power center Aqualink systems, like the RS2-14?

I’ve just begun working with aqualinkd on a RS2-14 Dual system, a AquaLinkRS B0029235 REV T.1, and everything on the first physical control panel/power center is responding as expected from what I can see so far. In my case this system has additional aux devices connected to Aux B1, B2 & B3 on the second control panel that I would like to control through aqualinkd.

Oddly enough in this case I also have a 3rd control panel (I recently bought this house from a pool builder) with 3 more aux devices on C3, C4 & C6, which again, I’d like to control through aqualinkd.

Those ‘B’ and ‘C’ designations are as I see them labelled under “Circuit” within the aux label customization screen in the iAqualink web interface.

Just wondering if you know how to handle this before I dive in deeper. Thanks for your hard work in this project!

PDA Support.

Info on PDA support will be posted here. At present AqualinkD can only mimic an RS All button keypad, So if you have a PDA only control panel, ie one without RS, AqualinkD will not work.

Jandy Heater Control Only

Since I have an IQPump01 hooked up to my VS pump, I only need to control my Jandy JXi heater. Is there any reason I couldn't simply hook up to the RS-485 in the heater directly and use this software for remote control of just the heater?

Thanks for this great project!

Programming / System Setup

Happy New Year,
The "older" ipaddress/simulator.html makes it possible to access the System SetUp however the connection is lost when scrolling either to fast or selecting some of the settings. Are there limitations to this access? I'd be keen to be able to access the set up functions as not to have to rely on OneTouch or the iAqualink to set up and or change settings. Have you looked into this? Could I help if there is interest to maybe aOneTouch styled interface?

Cant get install.sh to run error free on RPi 3

First downloaded the code and just dropped it into my RPi3 under the /home/pi/Downloads/aqualinkd. Then just went to ./release folder and attempted to run the install.sh as shown below, but got three errors.

pi@raspberrypi:/Downloads/aqualinkd/release $ sudo sh install.sh
install.sh: 7: install.sh: Bad substitution
install.sh: 24: install.sh: [[: not found
install.sh: 29: install.sh: [[: not found
Created symlink from /etc/systemd/system/multi-user.target.wants/aqualinkd.service to /etc/systemd/system/aqualinkd.service.

Tried to do the make, then sudo make install, but that failed and had many more errors. as shown below:

pi@raspberrypi:/Downloads/aqualinkd $ make
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c aqualinkd.c -o aqualinkd.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c utils.c -o utils.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c config.c -o config.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c aq_serial.c -o aq_serial.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c init_buttons.c -o init_buttons.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c aq_programmer.c -o aq_programmer.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c net_services.c -o net_services.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c json_messages.c -o json_messages.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -c mongoose.c -o mongoose.o
gcc -Wall -lpthread -lm -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC -o ./release/aqualinkd aqualinkd.o utils.o config.o aq_serial.o init_buttons.o aq_programmer.o net_services.o json_messages.o mongoose.o -lpthread -lm
pi@raspberrypi:/Downloads/aqualinkd $ sudo make install
./release/install.sh
make: execvp: ./release/install.sh: Permission denied
Makefile:51: recipe for target 'install' failed
make: *** [install] Error 127

So going back to install.sh, trying to understand what these three errors are of 7, 24, 29, not sure if they line numbers, even if they are that part doesnt make sense looking at the install.sh.

pi@raspberrypi:/Downloads/aqualinkd/release $ sudo sh install.sh
install.sh: 7: install.sh: Bad substitution
install.sh: 24: install.sh: [[: not found
install.sh: 29: install.sh: [[: not found
Config exists, did not copy new config, you may need to edit existing! /etc/aqualinkd.conf
Defaults exists, did not copy new defaults to /etc/default/aqualinkd
Avahi/mDNS defaults exists, did not copy new defaults to /etc/avahi/services//aqualinkd.service
Starting daemon aqualinkd
Job for aqualinkd.service failed. See 'systemctl status aqualinkd.service' and 'journalctl -xn' for details.
pi@raspberrypi:~/Downloads/aqualinkd/release $ systemctl status aqualinkd.service
● aqualinkd.service - Aqualink RS daemon
Loaded: loaded (/etc/systemd/system/aqualinkd.service; enabled)
Active: failed (Result: exit-code) since Tue 2018-03-13 14:29:35 EDT; 1min 36s ago
Process: 1431 ExecStart=/usr/local/bin/aqualinkd $OPTS (code=exited, status=203/EXEC)

IQPump01

Will this work with IQPump01, with VSP ProFlo. I need it to control speed?

MQTT Temperature Conversion Issue

With convert_mqtt_temp_to_c set to yes, there is an issue that causes AqualinkD to mis-interpret the incoming temperature setpoints from MQTT on startup.

As can be seen from the log below, AqualinkD almost immediately starts processing MQTT commands after startup. The issue is that AqualinkD has not yet received a temperature message from the controller to determine the units. As such, _aqualink_data.temp_units is UNKNOWN when the message is received. Line 842 of net_services.c checks to see if _aqualink_data->temp_units == FAHRENHEIT, but it's UNKNOWN so no conversion is made. setpoint_check then checks to see if _aqualink_data.temp_units == CELSIUS, but it's still UNKNOWN so it compares the setpoint to the min and max values in Fahrenheit.

My recommendation would be to defer processing incoming MQTT messages until after communication has been established with the controller and the state of the system is known.

Jan 03 19:48:33 aqualink aqualinkd[22717]: Starting web server on port 80
Jan 03 19:48:33 aqualink aqualinkd[22717]: Starting MQTT client to localhost:1883
Jan 03 19:48:33 aqualink aqualinkd[22717]: Listening to Aqualink RS8 on serial port: /dev/ttyUSB0
Jan 03 19:48:34 aqualink aqualinkd[22717]: Setting setpoint of Spa to 38
Jan 03 19:48:34 aqualink aqualinkd[22717]: Setpoint of 31 for Pool is outside range, using 35
Jan 03 19:48:37 aqualink aqualinkd[22717]: Setting setpoint of Pool to 35
Jan 03 19:48:37 aqualink aqualinkd[22717]: Setting pool heater setpoint to 35
Jan 03 19:48:37 aqualink aqualinkd[22717]: Setting setpoint of Pool to 35
Jan 03 19:48:46 aqualink aqualinkd[22717]: Control Panel B0029223 REV T.2
Jan 03 19:49:04 aqualink aqualinkd[22717]: Getting freeze protection setpoints
Jan 03 19:49:11 aqualink aqualinkd[22717]: Getting pool & spa heat setpoints from aqualink
Jan 03 19:49:40 aqualink aqualinkd[22717]: Setting setpoint of Pool to 87
Jan 03 19:49:43 aqualink aqualinkd[22717]: Setting setpoint of Pool to 87
Jan 03 19:49:43 aqualink aqualinkd[22717]: Setting pool heater setpoint to 87
Jan 03 19:49:43 aqualink aqualinkd[22717]: Setting setpoint of Pool to 87

Bad receive packet

I keep getting the following error. Any hints on how to troubleshoot what may be wrong? Thanks

Nov 09 10:26:30 homebridge2 aqualinkd[17375]: Serial read bad checksum, ignoring
Nov 09 10:26:30 homebridge2 aqualinkd[17375]: Bad receive packet | HEX: 0x10|0x02|0xaf|0x10|0x02|0x0a|0x02|0x00|0x11|0x00|0x00|0x00|0
Nov 09 10:26:41 homebridge2 aqualinkd[17375]: Serial read bad checksum, ignoring
Nov 09 10:26:41 homebridge2 aqualinkd[17375]: Bad receive packet | HEX: 0x10|0x02|0xaf|0x10|0x02|0x0a|0x02|0x00|0x11|0x00|0x00|0x00|0
Nov 09 10:26:52 homebridge2 aqualinkd[17375]: Serial read bad checksum, ignoring
Nov 09 10:26:52 homebridge2 aqualinkd[17375]: Bad receive packet | HEX: 0x10|0x02|0xac|0x10|0x02|0x0a|0x02|0x00|0x11|0x00|0x00|0x00|0
Nov 09 10:27:03 homebridge2 aqualinkd[17375]: Serial read bad checksum, ignoring
Nov 09 10:27:03 homebridge2 aqualinkd[17375]: Bad receive packet | HEX: 0x10|0x02|0xac|0x10|0x02|0x0a|0x02|0x00|0x11|0x00|0x00|0x00|0
Nov 09 10:27:14 homebridge2 aqualinkd[17375]: Serial read bad checksum, ignoring
Nov 09 10:27:14 homebridge2 aqualinkd[17375]: Bad receive packet | HEX: 0x10|0x02|0xac|0x10|0x02|0x0a|0x02|0x00|0x11|0x00|0x00|0x00|0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.