mirror of https://github.com/sfeakes/AqualinkD.git
Few updates for HomeKit
parent
f36ed184e9
commit
d3f9ff1e9b
|
@ -11,7 +11,7 @@ linux daemon to control Aqualink RS pool controllers. Provides web UI, MQTT clie
|
|||
|
||||
# TL;DR Install
|
||||
## Quick instal if you are using Raspberry PI
|
||||
* There is a chance the pre-compiled binary will run, copy the git repo and run the install.sh script from the release directory.
|
||||
* There is a chance the pre-compiled binary will run, copy the git repo and run the install.sh script from the release directory. ie from the install directory `sudo ./release/install.sh`
|
||||
* try to run it with :-
|
||||
* `sudo aqualinkd -d -c /etc/aqualinkd.conf`
|
||||
* If it runs, then start configuring it to your setup.
|
||||
|
|
|
@ -729,7 +729,7 @@ bool waitForEitherMessage(struct aqualinkdata *aq_data, char* message1, char* me
|
|||
|
||||
bool waitForMessage(struct aqualinkdata *aq_data, char* message, int numMessageReceived)
|
||||
{
|
||||
//logMessage(LOG_DEBUG, "waitForMessage %s %d %d\n",message,numMessageReceived,cmd);
|
||||
logMessage(LOG_DEBUG, "waitForMessage %s %d\n",message,numMessageReceived);
|
||||
int i=0;
|
||||
pthread_mutex_init(&aq_data->active_thread.thread_mutex, NULL);
|
||||
pthread_mutex_lock(&aq_data->active_thread.thread_mutex);
|
||||
|
@ -747,7 +747,7 @@ bool waitForMessage(struct aqualinkdata *aq_data, char* message, int numMessageR
|
|||
while( ++i <= numMessageReceived)
|
||||
{
|
||||
logMessage(LOG_DEBUG, "Programming mode: loop %d of %d looking for '%s' received message '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
|
||||
|
||||
if (message != NULL) {
|
||||
ptr = stristr(aq_data->last_message, msgS);
|
||||
if (ptr != NULL) { // match
|
||||
|
@ -777,7 +777,29 @@ bool waitForMessage(struct aqualinkdata *aq_data, char* message, int numMessageR
|
|||
return true;
|
||||
}
|
||||
|
||||
bool select_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
||||
{
|
||||
char* expectedMsg = "PRESS ENTER* TO SELECT";
|
||||
int wait_messages = 3;
|
||||
bool found = false;
|
||||
int tries = 0;
|
||||
// Select the MENU and wait to get the RS8 respond.
|
||||
|
||||
while (found == false && tries <= 3) {
|
||||
send_cmd(KEY_MENU, aq_data);
|
||||
found = waitForMessage(aq_data, expectedMsg, wait_messages);
|
||||
tries++;
|
||||
}
|
||||
|
||||
if (found == false)
|
||||
return false;
|
||||
|
||||
send_cmd(KEY_ENTER, aq_data);
|
||||
waitForMessage(aq_data, NULL, 1);
|
||||
|
||||
return select_sub_menu_item(aq_data, item_string);
|
||||
}
|
||||
/*
|
||||
bool select_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
||||
{
|
||||
char* expectedMsg = "PRESS ENTER* TO SELECT";
|
||||
|
@ -800,6 +822,7 @@ bool select_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
|||
|
||||
return select_sub_menu_item(aq_data, item_string);
|
||||
}
|
||||
*/
|
||||
|
||||
//bool select_sub_menu_item(char* item_string, struct aqualinkdata *aq_data)
|
||||
bool select_sub_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
||||
|
|
24
aqualinkd.c
24
aqualinkd.c
|
@ -448,14 +448,26 @@ void action_delayed_request()
|
|||
snprintf(sval, 9, "%d", _aqualink_data.unactioned.value);
|
||||
|
||||
if (_aqualink_data.unactioned.type == POOL_HTR_SETOINT) {
|
||||
aq_programmer(AQ_SET_POOL_HEATER_TEMP, sval, &_aqualink_data);
|
||||
logMessage(LOG_NOTICE, "Setting pool heater setpoint to %d\n",_aqualink_data.unactioned.value);
|
||||
if ( _aqualink_data.pool_htr_set_point != _aqualink_data.unactioned.value ) {
|
||||
aq_programmer(AQ_SET_POOL_HEATER_TEMP, sval, &_aqualink_data);
|
||||
logMessage(LOG_NOTICE, "Setting pool heater setpoint to %d\n",_aqualink_data.unactioned.value);
|
||||
} else {
|
||||
logMessage(LOG_NOTICE, "Pool heater setpoint is already %d, not changing\n",_aqualink_data.unactioned.value);
|
||||
}
|
||||
} else if (_aqualink_data.unactioned.type == SPA_HTR_SETOINT) {
|
||||
aq_programmer(AQ_SET_SPA_HEATER_TEMP, sval, &_aqualink_data);
|
||||
logMessage(LOG_NOTICE, "Setting spa heater setpoint to %d\n",_aqualink_data.unactioned.value);
|
||||
if ( _aqualink_data.spa_htr_set_point != _aqualink_data.unactioned.value ) {
|
||||
aq_programmer(AQ_SET_SPA_HEATER_TEMP, sval, &_aqualink_data);
|
||||
logMessage(LOG_NOTICE, "Setting spa heater setpoint to %d\n",_aqualink_data.unactioned.value);
|
||||
} else {
|
||||
logMessage(LOG_NOTICE, "Spa heater setpoint is already %d, not changing\n",_aqualink_data.unactioned.value);
|
||||
}
|
||||
} else if (_aqualink_data.unactioned.type == FREEZE_SETPOINT) {
|
||||
aq_programmer(AQ_SET_FRZ_PROTECTION_TEMP, sval, &_aqualink_data);
|
||||
logMessage(LOG_NOTICE, "Setting freeze protect to %d\n",_aqualink_data.unactioned.value);
|
||||
if ( _aqualink_data.frz_protect_set_point != _aqualink_data.unactioned.value ) {
|
||||
aq_programmer(AQ_SET_FRZ_PROTECTION_TEMP, sval, &_aqualink_data);
|
||||
logMessage(LOG_NOTICE, "Setting freeze protect to %d\n",_aqualink_data.unactioned.value);
|
||||
} else {
|
||||
logMessage(LOG_NOTICE, "Freeze setpoint is already %d, not changing\n",_aqualink_data.unactioned.value);
|
||||
}
|
||||
}
|
||||
|
||||
_aqualink_data.unactioned.type = NO_ACTION;
|
||||
|
|
Binary file not shown.
|
@ -40,7 +40,7 @@ override_freeze_protect = no
|
|||
#mqtt_aq_topic = aqualinkd
|
||||
|
||||
# The id of the Aqualink terminal device. Devices probed by RS8 master are:
|
||||
# 08-0b, 10-13, 18-1b, 20-23,
|
||||
# 08-0b, 10-13, 18-1b, 20-23, 28-2b, 30-33, 38-3b, 40-43
|
||||
#
|
||||
device_id=0x0a
|
||||
|
||||
|
|
Loading…
Reference in New Issue