@@ -175,7 +175,7 @@ bool WandererCoverLegacyProtocol::parseDeviceData(const char* data, WandererCove
175175 device->statusData .voltage = device->voltageread ;
176176
177177 // Update the UI with the parsed data
178- device->updateData (device->closesetread , device->opensetread , device->positionread , device->voltageread );
178+ device->updateData (device->closesetread , device->opensetread , device->positionread , device->voltageread ,device-> flatpanelbrightnessread , device-> dewheaterpowerread ,device-> asiaircontrolenabledread );
179179
180180 // Update the Close and Open position settings with the values from the device
181181 device->CloseSetNP [device->CloseSet ].setValue (device->closesetread );
@@ -305,9 +305,12 @@ bool WandererCoverModernProtocol::parseDeviceData(const char* data, WandererCove
305305 // Parse extended data for modern protocol
306306 if (tokens.size () >= 8 )
307307 {
308- device->statusData .flatPanelBrightness = std::atoi (tokens[6 ].c_str ());
309- device->statusData .dewHeaterPower = std::atoi (tokens[7 ].c_str ());
310- device->statusData .asiairControlEnabled = (tokens.size () > 8 ) ? (std::atoi (tokens[8 ].c_str ()) == 1 ) : false ;
308+ device->flatpanelbrightnessread = std::atoi (tokens[6 ].c_str ());
309+ device->statusData .flatPanelBrightness = device->flatpanelbrightnessread ;
310+ device->dewheaterpowerread = std::atoi (tokens[7 ].c_str ());
311+ device->statusData .dewHeaterPower = device->dewheaterpowerread ;
312+ device->asiaircontrolenabledread = (tokens.size () > 8 ) ? (std::atoi (tokens[8 ].c_str ()) == 1 ) : false ;
313+ device->statusData .asiairControlEnabled = device->asiaircontrolenabledread ;
311314 }
312315
313316 // Update status data
@@ -318,7 +321,7 @@ bool WandererCoverModernProtocol::parseDeviceData(const char* data, WandererCove
318321 device->statusData .voltage = device->voltageread ;
319322
320323 // Update the UI with the parsed data
321- device->updateData (device->closesetread , device->opensetread , device->positionread , device->voltageread );
324+ device->updateData (device->closesetread , device->opensetread , device->positionread , device->voltageread ,device-> flatpanelbrightnessread , device-> dewheaterpowerread ,device-> asiaircontrolenabledread );
322325
323326 // Update the Close and Open position settings with the values from the device
324327 device->CloseSetNP [device->CloseSet ].setValue (device->closesetread );
@@ -381,10 +384,9 @@ bool WandererCoverV4EC::initProperties()
381384 DataNP[openset_read].fill ( " Open_Position" , " Open Position Set(°)" , " %4.2f" , 0 , 999 , 100 , 0 );
382385 DataNP[position_read].fill ( " Current_Position" , " Current Position(°)" , " %4.2f" , 0 , 999 , 100 , 0 );
383386 DataNP[voltage_read].fill ( " Voltage" , " Voltage (V)" , " %4.2f" , 0 , 999 , 100 , 0 );
384- DataNP[flat_panel_brightness_read].fill ( " Flat_Panel_Brightness" , " Flat Panel Brightness" , " %d" , 0 , 255 , 1 , 0 );
385- DataNP[dew_heater_power_read].fill ( " Dew_Heater_Power" , " Dew Heater Power" , " %d" , 0 , 150 , 1 , 0 );
386- DataNP[asiair_control_enabled_read].fill ( " ASIAIR_Control_Enabled" , " ASIAIR Control Enabled" , " %d" , 0 , 1 , 1 , 0 );
387- DataNP[firmware_version_read].fill ( " Firmware_Version" , " Firmware Version" , " %d" , 0 , 99999999 , 1 , 0 );
387+ DataNP[flat_panel_brightness_read].fill ( " Flat_Panel_Brightness" , " Flat Panel Brightness" , " %4.2f" , 0 , 255 , 1 , 0 );
388+ DataNP[dew_heater_power_read].fill ( " Dew_Heater_Power" , " Dew Heater Power" , " %4.2f" , 0 , 150 , 1 , 0 );
389+ DataNP[asiair_control_enabled_read].fill ( " ASIAIR_Control_Enabled" , " ASIAIR Control Enabled" , " %4.2f" , 0 , 1 , 1 , 0 );
388390 DataNP.fill (getDeviceName (), " STATUS" , " Real Time Status" , MAIN_CONTROL_TAB , IP_RO , 60 , IPS_IDLE );
389391
390392 // Firmware information
@@ -411,9 +413,9 @@ bool WandererCoverV4EC::initProperties()
411413 ASIAIRControlSP[ASIAIR_DISABLE ].fill (" ASIAIR_DISABLE" , " Disable ASIAIR Control" , ISS_ON );
412414 ASIAIRControlSP.fill (getDeviceName (), " ASIAIR_CONTROL" , " ASIAIR Control" , MAIN_CONTROL_TAB , IP_RW , ISR_1OFMANY , 60 , IPS_IDLE );
413415
414- CustomBrightnessNP[CUSTOM_BRIGHTNESS_1 ].fill (" CUSTOM_BRIGHTNESS_1" , " Custom Brightness 1" , " %d " , 0 , 255 , 1 , 100 );
415- CustomBrightnessNP[CUSTOM_BRIGHTNESS_2 ].fill (" CUSTOM_BRIGHTNESS_2" , " Custom Brightness 2" , " %d " , 0 , 255 , 1 , 100 );
416- CustomBrightnessNP[CUSTOM_BRIGHTNESS_3 ].fill (" CUSTOM_BRIGHTNESS_3" , " Custom Brightness 3" , " %d " , 0 , 255 , 1 , 100 );
416+ CustomBrightnessNP[CUSTOM_BRIGHTNESS_1 ].fill (" CUSTOM_BRIGHTNESS_1" , " Custom Brightness 1" , " %1.0f " , 0 , 255 , 1 , 1 );
417+ CustomBrightnessNP[CUSTOM_BRIGHTNESS_2 ].fill (" CUSTOM_BRIGHTNESS_2" , " Custom Brightness 2" , " %1.0f " , 0 , 255 , 1 , 50 );
418+ CustomBrightnessNP[CUSTOM_BRIGHTNESS_3 ].fill (" CUSTOM_BRIGHTNESS_3" , " Custom Brightness 3" , " %1.0f " , 0 , 255 , 1 , 255 );
417419 CustomBrightnessNP.fill (getDeviceName (), " CUSTOM_BRIGHTNESS" , " Custom Brightness" , MAIN_CONTROL_TAB , IP_RW , 60 , IPS_IDLE );
418420
419421 AutoDetectSP[AUTO_DETECT_OPEN ].fill (" AUTO_DETECT_OPEN" , " Auto Detect Open Position" , ISS_OFF );
@@ -447,15 +449,6 @@ bool WandererCoverV4EC::updateProperties()
447449 snprintf (firmwareStr, sizeof (firmwareStr), " %d" , firmware);
448450 FirmwareTP[FIRMWARE_VERSION ].setText (firmwareStr);
449451
450- if (firmware >= 20240101 )
451- {
452- LOGF_INFO (" Firmware version: %d" , firmware);
453- }
454- else
455- {
456- LOGF_INFO (" Firmware version: %d" , firmware);
457- LOG_INFO (" New firmware available!" );
458- }
459452
460453 // Update the Close and Open position settings with the values from the device
461454 CloseSetNP[CloseSet].setValue (closesetread);
@@ -612,17 +605,11 @@ bool WandererCoverV4EC::detectProtocol()
612605 LOG_INFO (" WandererCover V4-EC device detected" );
613606 }
614607 // Check for similar devices that might be compatible
615- else if (deviceName == " ZXWBProV3" || deviceName == " ZXWBPlusV3" ||
616- deviceName == " UltimateV2" || deviceName == " PlusV2" )
608+ else if (deviceName == " ZXWBProV3" || deviceName == " ZXWBPlusV3" ||
609+ deviceName == " UltimateV2" || deviceName == " PlusV2" || deviceName == " WandererEclipse " || deviceName == " WandererDewTerminator " || deviceName == " WandererCoverV4Pro " )
617610 {
618- LOGF_WARN (" Detected similar device: '%s'. This driver is designed for WandererCover V4-EC." , deviceName.c_str ());
619- LOG_WARN (" Compatibility not guaranteed. Proceeding with caution..." );
620- }
621- // Check for partial matches (in case of data corruption or incomplete transmission)
622- else if (deviceName.find (" WandererCover" ) != std::string::npos)
623- {
624- LOGF_WARN (" Partial device match detected: '%s'. Expected 'WandererCoverV4'" , deviceName.c_str ());
625- LOG_WARN (" Proceeding with partial match..." );
611+ LOGF_ERROR (" WandererAstro products detected, but the model does not match: '%s'. This driver is designed for WandererCover V4-EC only, please choose the right driver or try another serial port!" , deviceName.c_str ());
612+ return false ;
626613 }
627614 else
628615 {
@@ -647,14 +634,14 @@ bool WandererCoverV4EC::detectProtocol()
647634 {
648635 std::unique_ptr<WandererCoverModernProtocol> modernProtocol = std::make_unique<WandererCoverModernProtocol>();
649636 setProtocol (std::move (modernProtocol));
650- LOG_INFO (" Using modern protocol (firmware >= 20250404)" );
637+ LOG_INFO (" Using modern protocol (firmware >= 20250404) Please note that in the newer firmware, to protect dark conditions, the flat light will remain off whenever the Cover is open. " );
651638 return true ;
652639 }
653640 else if (firmwareVersion > 0 )
654641 {
655642 std::unique_ptr<WandererCoverLegacyProtocol> legacyProtocol = std::make_unique<WandererCoverLegacyProtocol>();
656643 setProtocol (std::move (legacyProtocol));
657- LOG_INFO (" Using legacy protocol (firmware < 20250404)" );
644+ LOG_INFO (" Using legacy protocol (firmware < 20250404) Firmware update recommended. " );
658645 return true ;
659646 }
660647 else
@@ -673,7 +660,7 @@ bool WandererCoverV4EC::detectProtocol()
673660void WandererCoverV4EC::setProtocol (std::unique_ptr<IWandererCoverProtocol> protocol)
674661{
675662 currentProtocol = std::move (protocol);
676- LOGF_INFO ( " Protocol set to: %s " , currentProtocol-> getProtocolName (). c_str ());
663+
677664}
678665
679666// //////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -748,7 +735,7 @@ bool WandererCoverV4EC::parseDeviceData(const char *data)
748735// //////////////////////////////////////////////////////////////////////////////////////////////////////
749736// /
750737// //////////////////////////////////////////////////////////////////////////////////////////////////////
751- void WandererCoverV4EC::updateData (double closesetread, double opensetread, double positionread, double voltageread)
738+ void WandererCoverV4EC::updateData (double closesetread, double opensetread, double positionread, double voltageread, double flatpanelbrightnessread, double dewheaterpowerread, double asiaircontrolenabledread )
752739{
753740 // Update basic data
754741 DataNP[closeset_read].setValue (closesetread);
@@ -759,18 +746,16 @@ void WandererCoverV4EC::updateData(double closesetread, double opensetread, doub
759746 // Update extended data only if supported by current protocol
760747 if (currentProtocol && currentProtocol->supportsFeature (" extended_status" ))
761748 {
762- DataNP[flat_panel_brightness_read].setValue (statusData.flatPanelBrightness );
763- DataNP[dew_heater_power_read].setValue (statusData.dewHeaterPower );
764- DataNP[asiair_control_enabled_read].setValue (statusData.asiairControlEnabled ? 1 : 0 );
765- DataNP[firmware_version_read].setValue (statusData.firmware );
749+ DataNP[flat_panel_brightness_read].setValue (flatpanelbrightnessread);
750+ DataNP[dew_heater_power_read].setValue (dewheaterpowerread);
751+ DataNP[asiair_control_enabled_read].setValue (asiaircontrolenabledread);
766752 }
767753 else
768754 {
769755 // For legacy protocol, set default values for unsupported features
770756 DataNP[flat_panel_brightness_read].setValue (-1 );
771757 DataNP[dew_heater_power_read].setValue (-1 );
772758 DataNP[asiair_control_enabled_read].setValue (-1 );
773- DataNP[firmware_version_read].setValue (-1 );
774759 }
775760
776761 DataNP.setState (IPS_OK );
0 commit comments