Probably this operation publishes on AWS IoT service where device is connected. I’ve extracted certificates and identifier from flash and managed to connect this service by MQTT client and successfully receiving updates which device is publishing. This is better because don’t need polling but setup is more difficult - need connecting USB-serial adapter to PCB and download flash by esptool.
Thank for your pull request - I’ll try merge it today and write switch to HA integration.
This is sample of published data on AWS IoT broker:
{
"previous": {
"state": {
"desired": {
"Request": {
"regen_enable_enum": 1,
"user_lockout_enum": 0,
"time_format_enum": 1,
"volume_unit_enum": 1,
"hardness_unit_enum": 1,
"weight_unit_enum": 1,
"model_id": "108103",
"system_type": "demand softener",
"internet_connection_thr": 5,
"restore_connection_thr": 5,
"get_all_data": 1,
"flow_monitor_trip_sec": 1200,
"tz_id": "Europe/Warsaw",
"tz_dev": "CET-1CEST,M3.5.0,M10.5.0/3",
"regen_status_enum": 0,
"hardness_grains": 17,
"regen_time_secs": 7200,
"salt_type_enum": 0,
"feature_97pct_enum": 0,
"backwash_secs": 660,
"fast_rinse_secs": 300,
"second_backwash_secs": 660,
"max_days_between_regens": 0,
"rinse_type_enum": 1,
"aux_control_type_enum": 0,
"chem_feed_gals": 1,
"salt_level_tenths": 10,
"flow_monitor_min_rate_gpm": 4,
"chem_feed_tenths_secs": 1,
"iron_level_tenths_ppm": 0,
"efficiency_mode_enum": 1,
"date_format_enum": 1,
"salt_monitor_enum": 1,
"get_frequent_data": 267836777,
"language_enum": 0,
"app_active": 267605749
}
},
"reported": {
"UnitState": {
"gateway_connected": true,
"device_connected": true
},
"Request": {
"regen_enable_enum": 1,
"user_lockout_enum": 0,
"time_format_enum": 1,
"volume_unit_enum": 1,
"hardness_unit_enum": 1,
"weight_unit_enum": 1,
"model_id": "108103",
"system_type": "demand softener",
"internet_connection_thr": 5,
"restore_connection_thr": 5,
"get_all_data": 1,
"flow_monitor_trip_sec": 1200,
"regen_status_enum": 0,
"hardness_grains": 17,
"regen_time_secs": 7200,
"salt_type_enum": 0,
"feature_97pct_enum": 0,
"backwash_secs": 660,
"fast_rinse_secs": 300,
"second_backwash_secs": 660,
"max_days_between_regens": 0,
"rinse_type_enum": 1,
"aux_control_type_enum": 0,
"chem_feed_gals": 1,
"salt_level_tenths": 10,
"flow_monitor_min_rate_gpm": 4,
"chem_feed_tenths_secs": 1,
"iron_level_tenths_ppm": 0,
"efficiency_mode_enum": 1,
"date_format_enum": 1,
"salt_monitor_enum": 1,
"tz_id": "Europe/Warsaw",
"tz_dev": "CET-1CEST,M3.5.0,M10.5.0/3",
"get_frequent_data": 267836777,
"language_enum": 0,
"app_active": 267605749
},
"Status": {
"valve_motor_state_enum": 0,
"current_valve_position_enum": 2,
"wsov_installed": 0,
"water_shutoff_valve": 2,
"wsov_device_action": 0,
"model_id": 108103,
"model_description": "Aquahome Duo Smart",
"base_software_version": "r4.4 MPC01081",
"system_type": "demand softener",
"regen_status_enum": 0,
"avg_daily_use_gals": 65,
"gallons_used_today": 2,
"pwa_number": ...,
"build_date_code": 22151,
"valve_pos_switch_enum": 1,
"treated_water_avail_gals": 239,
"days_since_last_regen": 5,
"valve_pos_time_left_secs": 2276,
"regen_time_rem_secs": 0,
"current_time_secs": 63590,
"error_code": 0,
"rock_removed_since_rech_lbs": 240,
"current_water_flow_gpm": 0,
"out_of_salt_estimate_days": 57,
"water_counter_gals": 9,
"requested_valve_pos_enum": 2,
"aux_control_state_enum": 0,
"rf_signal_strength_dbm": -72,
"rf_signal_bars": 2,
"serial_number": "...",
"wsov_error_code": 0,
"esp_software_part_number": "...",
"product_serial_number": "...",
"ota_status_flag": 0,
"flow_monitor_alert": 0,
"excessive_water_use_alert": 0,
"wsov_manual_override": 0,
"error_code_alert": 0,
"low_salt_alert": 0,
"water_shutoff_valve_alert": 0,
"wsov_error_code_alert": 0,
"resin_alert": 0,
"total_outlet_water_gals": 11820,
"app_active": 0
},
"Errors": {
"10006": 0,
"10009": 0,
"10017": 0,
"10005": 0,
"10007": 0,
"10016": 0,
"11005": 0,
"11007": 0
}
}
},
"metadata": {
"desired": {
"Request": {
"regen_enable_enum": {
"timestamp": 1660224220
},
... <removed timestamps for all fields> ...
}
}
},
"version": ...
},
"current": {
"state": {
"desired": {
"Request": {
"regen_enable_enum": 1,
"user_lockout_enum": 0,
"time_format_enum": 1,
"volume_unit_enum": 1,
"hardness_unit_enum": 1,
"weight_unit_enum": 1,
"model_id": "108103",
"system_type": "demand softener",
"internet_connection_thr": 5,
"restore_connection_thr": 5,
"get_all_data": 1,
"flow_monitor_trip_sec": 1200,
"tz_id": "Europe/Warsaw",
"tz_dev": "CET-1CEST,M3.5.0,M10.5.0/3",
"regen_status_enum": 0,
"hardness_grains": 17,
"regen_time_secs": 7200,
"salt_type_enum": 0,
"feature_97pct_enum": 0,
"backwash_secs": 660,
"fast_rinse_secs": 300,
"second_backwash_secs": 660,
"max_days_between_regens": 0,
"rinse_type_enum": 1,
"aux_control_type_enum": 0,
"chem_feed_gals": 1,
"salt_level_tenths": 10,
"flow_monitor_min_rate_gpm": 4,
"chem_feed_tenths_secs": 1,
"iron_level_tenths_ppm": 0,
"efficiency_mode_enum": 1,
"date_format_enum": 1,
"salt_monitor_enum": 1,
"get_frequent_data": 267837977,
"language_enum": 0,
"app_active": 267605749
}
},
"reported": {
"UnitState": {
"gateway_connected": true,
"device_connected": true
},
"Request": {
"regen_enable_enum": 1,
"user_lockout_enum": 0,
"time_format_enum": 1,
"volume_unit_enum": 1,
"hardness_unit_enum": 1,
"weight_unit_enum": 1,
"model_id": "108103",
"system_type": "demand softener",
"internet_connection_thr": 5,
"restore_connection_thr": 5,
"get_all_data": 1,
"flow_monitor_trip_sec": 1200,
"regen_status_enum": 0,
"hardness_grains": 17,
"regen_time_secs": 7200,
"salt_type_enum": 0,
"feature_97pct_enum": 0,
"backwash_secs": 660,
"fast_rinse_secs": 300,
"second_backwash_secs": 660,
"max_days_between_regens": 0,
"rinse_type_enum": 1,
"aux_control_type_enum": 0,
"chem_feed_gals": 1,
"salt_level_tenths": 10,
"flow_monitor_min_rate_gpm": 4,
"chem_feed_tenths_secs": 1,
"iron_level_tenths_ppm": 0,
"efficiency_mode_enum": 1,
"date_format_enum": 1,
"salt_monitor_enum": 1,
"tz_id": "Europe/Warsaw",
"tz_dev": "CET-1CEST,M3.5.0,M10.5.0/3",
"get_frequent_data": 267836777,
"language_enum": 0,
"app_active": 267605749
},
"Status": {
"valve_motor_state_enum": 0,
"current_valve_position_enum": 2,
"wsov_installed": 0,
"water_shutoff_valve": 2,
"wsov_device_action": 0,
"model_id": 108103,
"model_description": "Aquahome Duo Smart",
"base_software_version": "r4.4 MPC01081",
"system_type": "demand softener",
"regen_status_enum": 0,
"avg_daily_use_gals": 65,
"gallons_used_today": 2,
"pwa_number": ...,
"build_date_code": 22151,
"valve_pos_switch_enum": 1,
"treated_water_avail_gals": 239,
"days_since_last_regen": 5,
"valve_pos_time_left_secs": 2276,
"regen_time_rem_secs": 0,
"current_time_secs": 63590,
"error_code": 0,
"rock_removed_since_rech_lbs": 240,
"current_water_flow_gpm": 0,
"out_of_salt_estimate_days": 57,
"water_counter_gals": 9,
"requested_valve_pos_enum": 2,
"aux_control_state_enum": 0,
"rf_signal_strength_dbm": -72,
"rf_signal_bars": 2,
"serial_number": "...",
"wsov_error_code": 0,
"esp_software_part_number": "...",
"product_serial_number": "...",
"ota_status_flag": 0,
"flow_monitor_alert": 0,
"excessive_water_use_alert": 0,
"wsov_manual_override": 0,
"error_code_alert": 0,
"low_salt_alert": 0,
"water_shutoff_valve_alert": 0,
"wsov_error_code_alert": 0,
"resin_alert": 0,
"total_outlet_water_gals": 11820,
"app_active": 0
},
"Errors": {
"10006": 0,
"10009": 0,
"10017": 0,
"10005": 0,
"10007": 0,
"10016": 0,
"11005": 0,
"11007": 0
}
}
},
.... <removed metadata section like this above> ...
}
When you look at status there are few entries related to valve, eg.:
"valve_motor_state_enum": 0,
"current_valve_position_enum": 2,
"wsov_installed": 0,
"water_shutoff_valve": 2,
"wsov_device_action": 0,
"valve_pos_switch_enum": 1,
"requested_valve_pos_enum": 2,