Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeakes committed Dec 7, 2024
1 parent 765339a commit 6ef3892
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ NEED TO FIX FOR THIS RELEASE.

# Updates in 2.5.1 (dev)
* Added scheduling of pump after events (Power On, Freeze Protect, Boost)
* Fixed HA bug for thermostats not converting to °C when HA is set to display °C.

# Updates in 2.5.0
* PDA panel Rev 6.0 or newer that do not have a Jandy iAqualink device attached can use the AqualinkTouch protocol rather than PDA protocol.
Expand Down
Binary file modified release/aqualinkd-arm64
Binary file not shown.
Binary file modified release/aqualinkd-armhf
Binary file not shown.
26 changes: 18 additions & 8 deletions source/hassio.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ const char *HASSIO_CLIMATE_DISCOVER = "{"
"\"payload_on\": \"1\","
"\"payload_off\": \"0\","
"\"current_temperature_topic\": \"%s/%s\","
"\"min_temp\": 36,"
"\"max_temp\": 104,"
"\"mode_command_topic\": \"%s/%s/set\","
"\"mode_state_topic\": \"%s/%s/enabled\","
"\"mode_state_template\": \"{%% set values = { '0':'off', '1':'heat'} %%}{{ values[value] if value in values.keys() else 'off' }}\","
Expand All @@ -54,7 +52,10 @@ const char *HASSIO_CLIMATE_DISCOVER = "{"
"\"action_template\": \"{%% set values = { '0':'off', '1':'heating'} %%}{{ values[value] if value in values.keys() else 'off' }}\","
"\"action_topic\": \"%s/%s\","
/*"\"temperature_state_template\": \"{{ value_json }}\","*/
"%s"
"\"min_temp\": %.2f,"
"\"max_temp\": %.2f,"
"\"temperature_unit\": \"%s\""
//"%s"
"}";

const char *HASSIO_FREEZE_PROTECT_DISCOVER = "{"
Expand All @@ -69,23 +70,26 @@ const char *HASSIO_FREEZE_PROTECT_DISCOVER = "{"
"\"payload_on\": \"1\","
"\"payload_off\": \"0\","
"\"current_temperature_topic\": \"%s/%s\","
"\"min_temp\": 34,"
"\"max_temp\": 42,"
"\"mode_state_topic\": \"%s/%s\","
"\"mode_state_template\": \"{%% set values = { '0':'off', '1':'auto'} %%}{{ values[value] if value in values.keys() else 'off' }}\","
"\"temperature_command_topic\": \"%s/%s/setpoint/set\","
"\"temperature_state_topic\": \"%s/%s/setpoint\","
"\"action_template\": \"{%% set values = { '0':'off', '1':'cooling'} %%}{{ values[value] if value in values.keys() else 'off' }}\","
"\"action_topic\": \"%s/%s\","
/*"\"temperature_state_template\": \"{{ value_json }}\""*/
"%s"
"\"min_temp\": %0.2f,"
"\"max_temp\": %0.2f,"
"\"temperature_unit\": \"%s\""
//"%s"
"}";

/*
const char *HASSIO_CONVERT_CLIMATE_TOF = "\"temperature_state_template\": \"{{ (value | float(0) * 1.8 + 32 + 0.5) | int }}\","
"\"current_temperature_template\": \"{{ (value | float(0) * 1.8 + 32 + 0.5 ) | int }}\","
"\"temperature_command_template\": \"{{ ((value | float(0) -32 ) / 1.8 + 0.5) | int }}\"";
const char *HASSIO_NO_CONVERT_CLIMATE = "\"temperature_state_template\": \"{{ value_json }}\"";
*/

const char *HASSIO_SWG_DISCOVER = "{"
"\"device\": {" HASS_DEVICE "},"
Expand Down Expand Up @@ -385,7 +389,10 @@ void publish_mqtt_hassio_discover(struct aqualinkdata *aqdata, struct mg_connect
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
(_aqconfig_.convert_mqtt_temp?HASSIO_CONVERT_CLIMATE_TOF:HASSIO_NO_CONVERT_CLIMATE));
//(_aqconfig_.convert_mqtt_temp?HASSIO_CONVERT_CLIMATE_TOF:HASSIO_NO_CONVERT_CLIMATE));
(_aqconfig_.convert_mqtt_temp?degFtoC(36):36.00),
(_aqconfig_.convert_mqtt_temp?degFtoC(104):104.00),
(_aqconfig_.convert_mqtt_temp?"C":"F"));
sprintf(topic, "%s/climate/aqualinkd/aqualinkd_%s/config", _aqconfig_.mqtt_hass_discover_topic, aqdata->aqbuttons[i].name);
send_mqtt(nc, topic, msg);
} else if ( isPLIGHT(aqdata->aqbuttons[i].special_mask) && ((clight_detail *)aqdata->aqbuttons[i].special_mask_ptr)->lightType == LC_DIMMER2 ) {
Expand Down Expand Up @@ -464,7 +471,10 @@ void publish_mqtt_hassio_discover(struct aqualinkdata *aqdata, struct mg_connect
_aqconfig_.mqtt_aq_topic,FREEZE_PROTECT,
_aqconfig_.mqtt_aq_topic,FREEZE_PROTECT,
_aqconfig_.mqtt_aq_topic,FREEZE_PROTECT,
(_aqconfig_.convert_mqtt_temp?HASSIO_CONVERT_CLIMATE_TOF:HASSIO_NO_CONVERT_CLIMATE));
//(_aqconfig_.convert_mqtt_temp?HASSIO_CONVERT_CLIMATE_TOF:HASSIO_NO_CONVERT_CLIMATE));
(_aqconfig_.convert_mqtt_temp?degFtoC(34):34.00),
(_aqconfig_.convert_mqtt_temp?degFtoC(42):42.00),
(_aqconfig_.convert_mqtt_temp?"C":"F"));
sprintf(topic, "%s/climate/aqualinkd/aqualinkd_%s/config", _aqconfig_.mqtt_hass_discover_topic, FREEZE_PROTECT);
send_mqtt(nc, topic, msg);
}
Expand Down

0 comments on commit 6ef3892

Please sign in to comment.