Hot Tub Gecko inTouch2

Hi Marcus,

you found a real bug :slight_smile: .
In my code I read 3 pumps and the script of course crashed as you have only 1 pump. Its is in an early state…
I have uploaded a new version of the script. Can you please replace the client.py with the new version fro the git repository? I now loops over all pumps instead of statically read3 pumps. Then I hope the rest should work and you will see some topic posted on mqtt. BTW, if not already installed, MQTT Explorer is a great tool to check what is ongoing on your broker.

Sorry I over read in your first post your question about the items and and things file. Here they are:

mqtt.things

Bridge mqtt:broker:mySecureBroker "OpenHAB Bridge" [ host="192.168.x.x", secure=false, username="xxx", password="yyy" ]

{

...

	// Whirlpool
	Thing topic whirlpool "Whirlpool" @ "Garten" {
	Channels:
		Type string : current_operation "Aktelle Modus" [stateTopic="garten/whirlpool/water_heater/state", transformationPattern="JSONPATH:$.current_operation" ]
		Type string : temperature_unit "Temperatureinheit" [stateTopic="garten/whirlpool/water_heater/state", transformationPattern="JSONPATH:$.temperature_unit" ]
		Type number : current_temperature "Aktelle Temperatur" [stateTopic="garten/whirlpool/water_heater/state", transformationPattern="JSONPATH:$.current_temperature" ]
		Type number : target_temperature "Eingestellte Temperatur" [stateTopic="garten/whirlpool/water_heater/state", transformationPattern="JSONPATH:$.target_temperature", 
																    commandTopic="garten/whirlpool/water_heater/cmnd", min=30, max=41, step=0.5, formatBeforePublish="set_temp=%s"]
		Type number : real_target_temperature "Berechnete Temperatur" [stateTopic="garten/whirlpool/water_heater/state", transformationPattern="JSONPATH:$.real_target_temperature" ]        Type string : reachable "Online"        [ stateTopic="haus/sonoff-basic-0102/tele/LWT"]

		Type string : watercare_time "Wasserpflege Modus" [stateTopic="garten/whirlpool/water_care/state", transformationPattern="JSONPATH:$.Time"]
		Type number : watercare_mode_i "Wasserpflege Modus" [stateTopic="garten/whirlpool/water_care/state", transformationPattern="JSONPATH:$.['mode']"]
		Type string : watercare_mode "Wasserpflege Modus" [stateTopic="garten/whirlpool/water_care/state", transformationPattern="JSONPATH:$.['mode(txt)']"]
		Type string : test "Test " [stateTopic="garten/whirlpool/water_care/state", transformationPattern="JSONPATH:$"]

		Type switch : pump1 "Pumpe 1" [stateTopic="garten/whirlpool/pumps/state", transformationPattern="JSONPATH:$.['Pump 1']", on="HIGH", off="OFF"]
		Type switch : pump2 "Pumpe 2" [stateTopic="garten/whirlpool/pumps/state", transformationPattern="JSONPATH:$.['Pump 2']", on="HIGH", off="OFF"]
		Type switch : pump3 "Pumpe 3" [stateTopic="garten/whirlpool/pumps/state", transformationPattern="JSONPATH:$.['Pump 3']", on="HIGH", off="OFF"]
		Type switch : circulation_pump "Umwälzpumpe" [stateTopic="garten/whirlpool/pumps/state", transformationPattern="JSONPATH:$.['Circulating Pump']", on="ON", off="OFF"]

		Type switch : lights "Beleuchtung" [stateTopic="garten/whirlpool/lights/state", transformationPattern="JSONPATH:$.Lights", on="HI", off="OFF",
											commandTopic="garten/whirlpool/lights/cmnd", formatBeforePublish="set_lights=%s"]

		Type number : rinse_filter "Filter spühlen" [stateTopic="garten/whirlpool/reminders/state", transformationPattern="JSONPATH:$.RinseFilter" ]      
		Type number : clean_filter "Filter reinigen" [stateTopic="garten/whirlpool/reminders/state", transformationPattern="JSONPATH:$.CleanFilter" ]      
		Type number : change_water "Wasserwechsel" [stateTopic="garten/whirlpool/reminders/state", transformationPattern="JSONPATH:$.ChangeWater" ]      
		Type number : check_spa "Spa kontrollieren" [stateTopic="garten/whirlpool/reminders/state", transformationPattern="JSONPATH:$.CheckSpa" ]  

		Type switch : filter_status_clean "Filter Status:Clean" [stateTopic="garten/whirlpool/filter_status/state", transformationPattern="JSONPATH:$.['Filter Status:Clean']", on="true", off="false"]
		Type switch : filter_status_purge "Filter Status:Purge" [stateTopic="garten/whirlpool/filter_status/state", transformationPattern="JSONPATH:$.['Filter Status:Purge']", on="true", off="false"]


	}

....
}

whirpool.items

/*
 * Gecko controler from Whirlpool
 */

Group Whirlpool "Whirlpool" 
Group Whirlpool_Temperaturen "Whirlpool_Temperaturen"
Group Whirlpool_Pumpen "Whirlpool_Pumpen"
Group Whirlpool_FilterStatus "Filter Status"

String Whirlpool_Current_Operation "heizungmodus"          (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:current_operation" }
String Whirlpool_Temp_Unit         "Temperatur Einheit"    (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:temperature_unit" }
Number:Temperature Whirlpool_Current_Temp      "Aktuelle Temperatur"   <temperature> (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:current_temperature" }
Number Whirlpool_Target_Temp       "Gesetzte Temperatur"   (Whirlpool, Whirlpool_Temperaturen) { channel="mqtt:topic:mySecureBroker:whirlpool:target_temperature" }
Number:Temperature Whirlpool_Real_Target_Temp  "Berechnete Temperatur" <temperature> (Whirlpool, Whirlpool_Temperaturen) { channel="mqtt:topic:mySecureBroker:whirlpool:real_target_temperature" }

String Whirlpool_Watercare_Mode    "Wasserpflege Modus"	   (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:watercare_mode" }
Number Whirlpool_Watercare_Mode_I  "Wasserpflege Modus"	   (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:watercare_mode_i" }

Switch Whirlpool_Filter_Status_Clean  "Filter Status:Reiningen"  (Whirlpool, Whirlpool_FilterStatus) { channel="mqtt:topic:mySecureBroker:whirlpool:filter_status_clean" }
Switch Whirlpool_Filter_Status_Purge  "Filter Status:Durchspühlen"  (Whirlpool, Whirlpool_FilterStatus) { channel="mqtt:topic:mySecureBroker:whirlpool:filter_status_purge" }


Switch Whirlpool_Pump1             "Pumpe 1"               (Whirlpool, Whirlpool_Pumpen) { channel="mqtt:topic:mySecureBroker:whirlpool:pump1" }
Switch Whirlpool_Pump2             "Pumpe 2"               (Whirlpool, Whirlpool_Pumpen) { channel="mqtt:topic:mySecureBroker:whirlpool:pump2" }
Switch Whirlpool_Pump3             "Pumpe 3"               (Whirlpool, Whirlpool_Pumpen) { channel="mqtt:topic:mySecureBroker:whirlpool:pump3" }
Switch Whirlpool_Circulation_Pump  "Umwälzpumpe"           (Whirlpool, Whirlpool_Pumpen) { channel="mqtt:topic:mySecureBroker:whirlpool:circulation_pump" }

Switch Whirlpool_Lights            "Beleuchtung"   <light>        (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:lights" }

Number Whirlpool_Reminder_RinseFilter   "Filter spühlen"     (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:rinse_filter" }
Number Whirlpool_Reminder_CleanFilter   "Filter reinigen"    (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:clean_filter" }
Number Whirlpool_Reminder_ChangeWater   "Wasser wechseln"    (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:change_water" }
Number Whirlpool_Reminder_CheckSpa      "Spa kontrollieren"  (Whirlpool) { channel="mqtt:topic:mySecureBroker:whirlpool:check_spa" }

// Generic items for sidemap
String Whirlpool_Filter_Status "Filter-Status"
String Whirlpool_Heater_Status "Heizung-Status"
String Whirlpool_WaterCare_Status "Wasserpflege-Status"


Number Whirlpool_Chart_Period "Chart Period"

whirlpool.rules

/**
 * Whirlpool reminders rules
 *
 */

val mailWhirlpoolReminderEmpf = "abc.def@yyy.com"

rule "Initials values"
when System started

then
    Whirlpool_Heater_Status.postUpdate("")
    Whirlpool_Filter_Status.postUpdate("")
    Whirlpool_WaterCare_Status.postUpdate("")
end


/**
 * Change status message
 */
rule "Heater changed"
when Item Whirlpool_Current_Operation changed or
     Item Whirlpool_Real_Target_Temp changed 

then 
    if (Whirlpool_Current_Operation.state == NULL) {
        return
    }
    // Heater
    if (Whirlpool_Current_Operation.state == "Idle") {
        Whirlpool_Heater_Status.postUpdate("Gewünschte Temeratur erreicht")
    } else if (Whirlpool_Current_Operation.state.toString == "Cooling") {
        Whirlpool_Heater_Status.postUpdate("Abkühlen auf " + (Whirlpool_Real_Target_Temp.state as QuantityType<Temperature>).format("%.1f%unit%"))
    } else if (Whirlpool_Current_Operation.state == "Heating") {
        Whirlpool_Heater_Status.postUpdate("Aufheizen auf " + (Whirlpool_Real_Target_Temp.state as QuantityType<Temperature>).format("%.1f%unit%"))
    }
end

rule "Watercare changed"
when Item Whirlpool_Watercare_Mode changed 

then 
    if (Whirlpool_Watercare_Mode.state == NULL) {
        return
    }
    if (Whirlpool_Watercare_Mode.state == "Away From Home" ) {
        Whirlpool_WaterCare_Status.postUpdate("Sparmodus aktiviert")
    } else if (Whirlpool_Watercare_Mode.state == "Standard" ) {
        Whirlpool_WaterCare_Status.postUpdate("Spa läuft normal")
    } else if (Whirlpool_Watercare_Mode.state == "Energy Saving" ) {
        Whirlpool_WaterCare_Status.postUpdate("Sparmodus aktiviert")
    } else if (Whirlpool_Watercare_Mode.state == "Super Energy Saving" ) {
        Whirlpool_WaterCare_Status.postUpdate("Super Sparmodus aktiviert")
    } else if (Whirlpool_Watercare_Mode.state == "Weekender" ) {
        Whirlpool_WaterCare_Status.postUpdate("Wochenenmodus aktiviert")
    }

end

rule "Filter changed"
when Item Whirlpool_Filter_Status_Clean changed or
     Item Whirlpool_Filter_Status_Purge changed 
    
then
    if (Whirlpool_Filter_Status_Clean.state == ON) {
        Whirlpool_Filter_Status.postUpdate("Filter aktiviert")
    } else if (Whirlpool_Filter_Status_Purge.state == ON) {
        Whirlpool_Filter_Status.postUpdate("Durchspühlen aktiviert")
    } else {
        Whirlpool_Filter_Status.postUpdate("")
    }
end

/**
 * Check reminders and send notification mails when needed
 */
rule "Whirpool remindes"
when
	Time is noon
then

    var rinseFilter = false
    var cleanFilter = false
    var changeWater = false
    var checkSpa = false

    var mailText = ""
    var mailSubject = "Whirpool: "


    var mailActions = getActions("mail","mail:smtp:50ed7d74")

	if (Whirlpool_Reminder_RinseFilter.state != NULL) {
    	if (Whirlpool_Reminder_RinseFilter.state < 1) {
            rinseFilter = true
        }
    }

    if (Whirlpool_Reminder_CleanFilter.state != NULL) {
    	if (Whirlpool_Reminder_CleanFilter.state < 1) {
            cleanFilter = true
        }
    }

    if (Whirlpool_Reminder_ChangeWater.state != NULL) {
    	if (Whirlpool_Reminder_ChangeWater.state < 1) {
            changeWater = true
        }
    }

    if (Whirlpool_Reminder_CheckSpa.state != NULL) {
    	if (Whirlpool_Reminder_CheckSpa.state < 1) {
            checkSpa = true
        }
    }

    if (rinseFilter && !cleanFilter) {
        mailSubject += "Filter durchspühlen"
        if (Whirlpool_Reminder_RinseFilter.state > -2)
            mailText += "  * Filter durchspühlen"
        else 
            mailText += "  * Filter durchspühlen überfällig seit " + (-1 * Whirlpool_Reminder_RinseFilter.state as Number) + " Tagen"
    } else if (cleanFilter) {
        mailSubject += "Filter reinigen"
        if (Whirlpool_Reminder_CleanFilter.state > -2)
            mailText += "  * Filter in Lösung gereinigen"
        else 
            mailText += "  * Filter in Lösung gereinigen überfällig seit " + (-1 * Whirlpool_Reminder_CleanFilter.state as Number) + " Tagen"
    }

    if (changeWater) {
        if (mailSubject.length > 11) {
            mailSubject += " - "
            mailText += "\n"
        }
        mailSubject += "Wasser wechslen"
        if (Whirlpool_Reminder_ChangeWater.state >-2)
            mailText += "  * Wasser wechselen"
        else
            mailText += "  * Wasser wechseln überfällig seit " + (-1 * Whirlpool_Reminder_ChangeWater.state as Number) + " Tagen"
    }

    if (checkSpa) {
        if (mailSubject.length > 11) {
            mailSubject += " - "
            mailText += "\n"
        }
        mailSubject += "Spa überprüfen lassen"
        if (Whirlpool_Reminder_CheckSpa.state >-2)
            mailText += "  * Spa überprüffen lassen"
        else
            mailText += "  * Spa überprüffen lassen überfällig seit " + (-1 * Whirlpool_Reminder_CheckSpa.state as Number) + " Tagen"
    }

    if (mailSubject.length > 11) {
        mailText ="Hallo liebe Bubblerfreunde,\n\nich bräuchte mal wieder folgende Wartung(en):\n\n" + mailText + "\n\n Dein Whirlpool"
    	mailActions.sendMail(mailWhirlpoolReminderEmpf, mailSubject, mailText)
    }

end


Hi Frank,

done with the following result - worth noting that I stopped the program using CTRL-C after about 2 min. Not sure how long the program would run in a normal cycle without errors.
BTW I also used CTRL-C yesterday, then the pump error came up in the terminal.

2021-12-30 14:18:16,950 - mqtt - INFO - Subscribing to whirlpool/water_heater/cmnd
2021-12-30 14:18:16,951 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:18:16,951 - mqtt - INFO - Subscribing to whirlpool/lights/cmnd
2021-12-30 14:18:26,953 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:18:27,956 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:18:37,958 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:18:38,960 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:18:48,963 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:18:49,967 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:18:59,970 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:19:00,972 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:19:10,975 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:19:11,977 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:19:21,979 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:19:22,981 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:19:32,985 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:19:33,987 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:19:43,990 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:19:44,992 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:19:54,996 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:19:55,999 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:20:06,002 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:20:07,004 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:20:17,007 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 14:20:18,012 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 14:20:24,649 - geckolib.driver.udp_socket - WARNING - Couldn't find new handler for b'WCGET\x01'

Thx for info - will take a look at it.

Thx for sharing - will set them up probably later today.

Maybe some progress there as well but maybe I’m wrong.
I inserted User=user to run the service as “user” instead of “root”.

[Unit]
Description=Gecko client service
After=multi-user.target

[Service]
Type=simple
User=user
Restart=always
ExecStart=/usr/bin/python3 /opt/geckoclient/client.py

[Install]
WantedBy=multi-user.target

The error message changed as follows:

Dec 30 14:12:19 NUC8i3BEK systemd[1]: Started Gecko client service.
Dec 30 14:12:19 NUC8i3BEK python3[273388]: Traceback (most recent call last):
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/opt/geckoclient/client.py", line 57, in prepare_logger
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     rfh = logging.handlers.RotatingFileHandler(
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/handlers.py", line 148, in __init__
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/handlers.py", line 55, in __init__
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     logging.FileHandler.__init__(self, filename, mode, encoding, delay)
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/__init__.py", line 1147, in __init__
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     StreamHandler.__init__(self, self._open())
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/__init__.py", line 1176, in _open
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     return open(self.baseFilename, self.mode, encoding=self.encoding)
Dec 30 14:12:19 NUC8i3BEK python3[273388]: PermissionError: [Errno 13] Permission denied: '/var/log/geckoclient.log'
Dec 30 14:12:19 NUC8i3BEK python3[273388]: During handling of the above exception, another exception occurred:
Dec 30 14:12:19 NUC8i3BEK python3[273388]: Traceback (most recent call last):
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/opt/geckoclient/client.py", line 263, in <module>
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     prepare_logger()
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/opt/geckoclient/client.py", line 60, in prepare_logger
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     rfh = logging.handlers.RotatingFileHandler(
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/handlers.py", line 148, in __init__
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/handlers.py", line 55, in __init__
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     logging.FileHandler.__init__(self, filename, mode, encoding, delay)
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/__init__.py", line 1147, in __init__
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     StreamHandler.__init__(self, self._open())
Dec 30 14:12:19 NUC8i3BEK python3[273388]:   File "/usr/lib/python3.8/logging/__init__.py", line 1176, in _open
Dec 30 14:12:19 NUC8i3BEK python3[273388]:     return open(self.baseFilename, self.mode, encoding=self.encoding)
Dec 30 14:12:19 NUC8i3BEK python3[273388]: PermissionError: [Errno 13] Permission denied: '/gecko_client.log'
Dec 30 14:12:19 NUC8i3BEK systemd[1]: gecko.service: Main process exited, code=exited, status=1/FAILURE
Dec 30 14:12:19 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dec 30 14:12:20 NUC8i3BEK systemd[1]: gecko.service: Scheduled restart job, restart counter is at 5.
Dec 30 14:12:20 NUC8i3BEK systemd[1]: Stopped Gecko client service.
Dec 30 14:12:20 NUC8i3BEK systemd[1]: gecko.service: Start request repeated too quickly.
Dec 30 14:12:20 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dec 30 14:12:20 NUC8i3BEK systemd[1]: Failed to start Gecko client service.

It seems as if “import paho.mqtt.client as paho” is working now - need to take a look what’s wrong with the permissions of /gecko_client.log.

BR, Marcus

Update regarding gecko.service…

Just noticed that there are 2 logfiles:

/home/user/gecko_client.log
/var/log/geckoclient.log

Why are there 2 different log files? The content is different as well.

I changes permissions of /var/log/geckoclient.log as follows:

old:

-rw-r--r--  1 root              root               6620 Dez 30 14:53 geckoclient.log

new:

-rw-r--rw-  1 root              root               6620 Dez 30 14:53 geckoclient.log

gecko.service failing as follows:

Dec 30 14:53:41 NUC8i3BEK systemd[1]: Started Gecko client service.
Dec 30 14:53:42 NUC8i3BEK python3[278846]: Traceback (most recent call last):
Dec 30 14:53:42 NUC8i3BEK python3[278846]:   File "/opt/geckoclient/client.py", line 289, in <module>
Dec 30 14:53:42 NUC8i3BEK python3[278846]:     s = GeckoSpa(locator.get_spa_from_name(config.SPA_NAME))
Dec 30 14:53:42 NUC8i3BEK python3[278846]:   File "/home/user/.local/lib/python3.8/site-packages/geckolib/spa.py", line 73, in __init__
Dec 30 14:53:42 NUC8i3BEK python3[278846]:     GeckoSpaPack.__init__(self)
Dec 30 14:53:42 NUC8i3BEK python3[278846]:   File "/home/user/.local/lib/python3.8/site-packages/geckolib/driver/spapack.py", line 15, in __init__
Dec 30 14:53:42 NUC8i3BEK python3[278846]:     GeckoSpaPack.download_if_needed()
Dec 30 14:53:42 NUC8i3BEK python3[278846]:   File "/home/user/.local/lib/python3.8/site-packages/geckolib/driver/spapack.py", line 32, in download_if_needed
Dec 30 14:53:42 NUC8i3BEK python3[278846]:     GeckoSpaPack.download()
Dec 30 14:53:42 NUC8i3BEK python3[278846]:   File "/home/user/.local/lib/python3.8/site-packages/geckolib/driver/spapack.py", line 43, in download
Dec 30 14:53:42 NUC8i3BEK python3[278846]:     with open(GeckoConstants.SPA_PACK_STRUCT_FILE, "wb") as out:
Dec 30 14:53:42 NUC8i3BEK python3[278846]: PermissionError: [Errno 13] Permission denied: 'SpaPackStruct.xml'
Dec 30 14:53:42 NUC8i3BEK systemd[1]: gecko.service: Main process exited, code=exited, status=1/FAILURE
Dec 30 14:53:42 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dec 30 14:53:42 NUC8i3BEK systemd[1]: gecko.service: Scheduled restart job, restart counter is at 5.
Dec 30 14:53:42 NUC8i3BEK systemd[1]: Stopped Gecko client service.
Dec 30 14:53:42 NUC8i3BEK systemd[1]: gecko.service: Start request repeated too quickly.
Dec 30 14:53:42 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dec 30 14:53:42 NUC8i3BEK systemd[1]: Failed to start Gecko client service.

Well, improvement is that client.py runs till line 289 compared to line 57 earlier today and line 19 yesterday :grinning:

However, again failing with a permission error… it seems there is an attempt to download SpaPackStruct.xml “if needed”… why that? SpaPackStruct.xml is located in /home/user.

Permissions should allow everyone to read the file and nobody should write anything to that file (I think).

-rw-rw-r-- 1 root root 1624487 Dez 26 21:26 SpaPackStruct.xml

Now lost… maybe geckolib and paho-mqtt should be installed as root and gecko.service started as root as it was before?

Any suggestion?

Hi Frank,

managed to get gecko.service running !!!

Solution was to install geckolib and paho-mqtt as root.
SpaPackStruct.xml is located in /.

Remains the issue that only water_heater and lights get subscribed to the broker.

user@NUC8i3BEK:~$ sudo pip install paho-mqtt 
[sudo] password for user: 
Processing /root/.cache/pip/wheels/6a/48/01/c895c027e9b9367ec5470fbf371ee56e795a49ac6a19aa4c9f/paho_mqtt-1.6.1-py3-none-any.whl
Installing collected packages: paho-mqtt
Successfully installed paho-mqtt-1.6.1

user@NUC8i3BEK:~$ sudo pip install geckolib 
Collecting geckolib
  Using cached geckolib-0.3.20-py3-none-any.whl (66 kB)
Requirement already satisfied: python-version>="3.6" in /usr/local/lib/python3.8/dist-packages (from geckolib) (0.0.2)
Requirement already satisfied: urllib3 in /usr/lib/python3/dist-packages (from geckolib) (1.25.8)
Installing collected packages: geckolib
Successfully installed geckolib-0.3.20

user@NUC8i3BEK:~$ sudo cp /etc/openhab/misc/tmp_gecko/geckoclient-main/fix_geckolib/automation/*.py /usr/local/lib/python3.8/dist-packages/geckolib/automation

user@NUC8i3BEK:~$ sudo cp /etc/openhab/misc/tmp_gecko/geckoclient-main/fix_geckolib/driver/protocol/*.py /usr/local/lib/python3.8/dist-packages/geckolib/driver/protocol

user@NUC8i3BEK:/$ sudo systemctl daemon-reload
user@NUC8i3BEK:/$ sudo systemctl start gecko.service

user@NUC8i3BEK:/$ sudo systemctl status gecko.service
● gecko.service - Gecko client service
     Loaded: loaded (/etc/systemd/system/gecko.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2021-12-30 16:43:11 CET; 7s ago
   Main PID: 291143 (python3)
      Tasks: 5 (limit: 9312)
     Memory: 26.5M
     CGroup: /system.slice/gecko.service
             └─291143 /usr/bin/python3 /opt/geckoclient/client.py

Dez 30 16:43:11 NUC8i3BEK systemd[1]: Started Gecko client service.

gecko.service:

[Unit]
Description=Gecko client service
After=multi-user.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/python3 /opt/geckoclient/client.py

[Install]
WantedBy=multi-user.target

geckoclient.log

2021-12-30 17:05:05,869 - mqtt - INFO - Subscribing to whirlpool/water_heater/cmnd
2021-12-30 17:05:05,869 - mqtt - INFO - Subscribing to whirlpool/lights/cmnd
2021-12-30 17:05:05,869 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:05:15,871 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:05:16,873 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:05:26,875 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:05:27,877 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:05:37,880 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:05:38,883 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:05:48,886 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:05:49,888 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:05:59,890 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:06:00,892 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:06:10,894 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:06:11,896 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:06:21,898 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:06:22,899 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:06:32,901 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:06:33,904 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:06:43,906 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:06:44,908 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:06:54,912 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:06:55,914 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:07:05,917 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:07:06,919 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:07:13,595 - geckolib.driver.udp_socket - WARNING - Couldn't find new handler for b'WCGET\x01'
2021-12-30 17:07:16,922 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:07:17,924 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:07:27,926 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:07:28,928 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:07:38,930 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:07:39,933 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:07:49,935 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:07:50,937 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:08:00,939 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:08:01,942 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:08:11,945 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:08:12,947 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:08:13,439 - geckolib.driver.udp_socket - WARNING - Couldn't find new handler for b'WCGET\x01'
2021-12-30 17:08:22,950 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:08:23,951 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:08:33,954 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:08:34,956 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:08:44,959 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:08:45,961 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:08:55,963 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:08:56,965 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:09:06,967 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:09:07,969 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:09:17,971 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:09:18,973 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:09:28,977 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:09:29,980 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:09:39,982 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:09:40,984 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:09:50,986 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:09:51,989 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:10:01,992 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:10:02,995 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:10:12,998 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:10:14,001 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:10:24,006 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:10:25,009 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:10:35,014 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:10:36,017 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:10:46,020 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:10:47,023 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:10:57,027 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:10:58,030 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:11:08,033 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:11:09,036 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:11:19,039 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:11:20,041 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:11:30,043 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:11:31,045 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:11:41,048 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:11:42,051 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:11:52,054 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:11:53,055 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-30 17:12:03,059 - mqtt - ERROR - Connection error number 7 occured
2021-12-30 17:12:04,062 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1

That’s it for today.
Will try to continue some time tomorrow.

BR, Marcus

Hello Marcus,

glad to see that you made some progress. Indeed I forgot that I have done the installation on a stupid Proxmox container with root. So maybe a bit more configuration work is needed in case the service should not run under root rights.
Regarding the two locations of the error log, that is on purpose. In case /var/log cannot be used it falls back into the folder the script had been called from. That explains why you have two log files.
Finally the error message is wrong (copy/paste error) The message occurs because of an unexpected disconnection. Unluckily the error number are not documented. I expect something is wrong with your broker setup.
Can you please change in the config.py file the log level to DEBUG. Maybe that will bring some more light.
Can you please also check, if you have allowed anonymous access to the broker. I assume you have mosquitto installed and with the last major version update anonymous access is disabled by default.

Frank

Hi Frank,

done

Mosquitto MQTT v3.1/v3.1.1 Broker

I added a new conf file for mosquitto - hope this is the correct way to allow anonymous access…

/etc/mosquitto/conf.d/mosquitto_local.conf

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

allow_anonymous true

Then I restarted mosquitto.service and started client.py again After some time I interrupted client.py using CTRL-C.

user@NUC8i3BEK:/$ sudo systemctl stop mosquitto.service
user@NUC8i3BEK:/$ sudo systemctl start mosquitto.service
user@NUC8i3BEK:/$ sudo systemctl status mosquitto.service
● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
     Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-12-31 14:06:20 CET; 16s ago
       Docs: man:mosquitto.conf(5)
             man:mosquitto(8)
   Main PID: 435408 (mosquitto)
      Tasks: 3 (limit: 9312)
     Memory: 1.4M
     CGroup: /system.slice/mosquitto.service
             └─435408 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Dez 31 14:06:20 NUC8i3BEK systemd[1]: Starting Mosquitto MQTT v3.1/v3.1.1 Broker...
Dez 31 14:06:20 NUC8i3BEK mosquitto[435408]: 1640955980: Loading config file /etc/mosquitto/conf.d/mosquitto_local.conf
Dez 31 14:06:20 NUC8i3BEK mosquitto[435408]: [230382.807135]~DLT~435408~INFO     ~FIFO /tmp/dlt cannot be opened. Retrying later...
Dez 31 14:06:20 NUC8i3BEK systemd[1]: Started Mosquitto MQTT v3.1/v3.1.1 Broker.
user@NUC8i3BEK:/$ python3 /opt/geckoclient/client.py
^Cuser@NUC8i3BEK:/$ 

geckoclient.log:

2021-12-31 14:06:46,830 - mqtt - INFO - Subscribing to whirlpool/water_heater/cmnd
2021-12-31 14:06:46,830 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:06:46,830 - mqtt - INFO - Subscribing to whirlpool/lights/cmnd
2021-12-31 14:06:46,830 - mqtt - DEBUG - 1 - QOS=(0,) 
2021-12-31 14:06:46,831 - geckoclient - DEBUG - Locating spas on your network
2021-12-31 14:06:46,831 - mqtt - DEBUG - 2 - QOS=(0,) 
2021-12-31 14:06:47,946 - geckoclient - DEBUG - Connecting to Spa Whirlpool(SPA68:27:19:8e:70:6b)
2021-12-31 14:06:52,253 - geckoclient - DEBUG - No reminders received
2021-12-31 14:06:52,583 - geckoclient - DEBUG - WaterCare: Standard changed from None to 1
2021-12-31 14:07:03,767 - geckolib.driver.spastruct - WARNING - Out-of-sequence status block segment 10 - ignored
2021-12-31 14:07:03,903 - geckolib.driver.spastruct - WARNING - Out-of-sequence status block segment 11 - ignored
2021-12-31 14:07:04,344 - geckolib.driver.spastruct - WARNING - Out-of-sequence status block segment 12 - ignored
2021-12-31 14:07:04,344 - geckolib.driver.spastruct - WARNING - Retry status block request
2021-12-31 14:07:14,294 - geckolib.driver.udp_socket - WARNING - Couldn't find new handler for b'WCGET\x01'
2021-12-31 14:07:17,301 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:07:18,303 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:07:28,308 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:07:29,310 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:07:39,314 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:07:40,317 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:07:50,321 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:07:51,324 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:07:58,147 - geckolib.driver.udp_socket - WARNING - Couldn't find new handler for b'WCGET\x01'
2021-12-31 14:08:01,327 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:08:02,329 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:08:12,334 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:08:13,336 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:08:23,343 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:08:24,347 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:08:34,354 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:08:35,356 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:08:45,360 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:08:46,362 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:08:56,365 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:08:57,367 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:08:58,192 - geckolib.driver.udp_socket - WARNING - Couldn't find new handler for b'WCGET\x01'
2021-12-31 14:09:07,369 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:09:08,371 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:09:18,374 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:09:19,376 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-31 14:09:29,378 - mqtt - ERROR - Connection error number 7 occured
2021-12-31 14:09:29,528 - geckoclient - DEBUG - Thread interrupted: 2
2021-12-31 14:09:30,381 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1

BR, Marcus

HI Frank,

I installed MQTT Explorer - it seems as if all data is pushed to the broker and updated every minute :grinning:

Just need to double check whether all data matches the output from GeckoShell.run().

The errors reported in the logfile keep going on…

Next step will be to set up things/items, etc in openhab.
This will take a bit more time, since I will be away from home next week - will try to connect remotely from time to time.

BR, Marcus

Hi Marcus,
at least the data are there. I checked in my log file. I have the same

WARNING - Couldn't find new handler for b'WCGET\x01'

entries, but not the connection errors. I guess there is still something wrong with your mosquitto setup. I’m using a authentication, so maybe there is something in that direction. You can also have a look at the mosquitto log file under (default under /var/log/mosquitto/mosquitto.log), but can be configured in /etc/mosquitto/mosquitto.conf

I have also written a small mqtt test script. Only to check if publishing and subscribing is working, but I guess that is not needed any more. Anyhow you can give it a try :wink:

Best regards,
Frank

Hi Frank,

WIll certainly give it a try but how to configure authentication (username and password) in /etc/mosquitto/mosquitto.conf ?

Meanwhile I managed to set up all channels and items matching above screenshot.
Switching Lights on/off is working fine.

Setting target temperature fails (as you pointed out in one of your earlier messages).
This is probably the most important issue.

Nice to have:

  • Blower state (ON/OFF) missing
  • Ability to switch Pump 1, Blower and Circulating pump from openhab
  • Ability to set watercare mode from openhab

Thanks a lot for all effort and support so far.
This is really appreciated!

BR, Marcus

Hi Frank,

created password_file and activated authentication.

The error messages below seem to be gone - with and without authentication…
In the meantime I restarted gecko, mosquitto and openhab - this might be the reason.

Anyway, now struggling to get switching the lights from openhab working again…
Edit 16:57:
Switching lights is working again after a reboot of the server.

Is this something you would consider implementing in the nearer future?

BR, Marcus

Hello Marcus,

glad to see that most seems to work now.
My main intention was to have the temperature, light and remainders working. Personally I do not see a big advantage to switch the pumps or blowers as I don’t carry my mobile inside the pool and at least until do not have my Rhasspy near to the pool to use speak control :slight_smile:
I can have a look and do a blind development of the blower state as I do not have a blower. That might be not so difficult.
Originally I also wanted to add the ability to switch the watercare mode. But so far I have only changed that mode once in 6 month we have our pool now. Thus implementing will cost much more time than walking to the pool and change the value by hand :wink:
Today setting the temperature is working again for me. Honestly I do not know why it sometimes work and sometimes not… maybe there is a bug in the underlying geckolib…
Best regards
Frank

Hi Frank,

Fully agree.
Setting target temperature and measuring current temperature is certainly the most important to implement.

this would be very kind of you. Knowing its state would be very useful.

Agree, this is not essential at all. Just don’t spend time on it.

I’ve not got it working at all so far… let me do some more testing…

let’s see how stable it will be in my environment… this can still be addressed to gazoodle.

BR, Marcus

Hi Frank,

Screenshot from 2022-01-04 20-59-59

Whichever temperature I set in openhab - it always pushes the current temperature (38°) to the broker.
Any idea why this is the case.
Settings are as per your channel/item data.

BR, Marcus

Hi Frank,

Running setpoint command in Geckoshell seems to work without any problems. I was checking the app to make sure the setpoint temperature has really changed.

Whirlpool$ help setpoint
Set the spa setpoint temperature : setpoint <temp>
Whirlpool$ setpoint 37
Whirlpool$ setpoint 36

I’m quite optimistic that there is no bug in geckolib.
Not sure how you push changes of the setpoint temperature to geckolib.

Edit 7.1. 18:00:

success :grinning:

This turned out not to be the case any longer. I changed the item type to “Number:Temperature” some time ago and forgot to change it back to “Number”.

Is is working now.
Will observe the stability of this functionality.

BR, Marcus

Hello Marcus,

thanks for reporting back and happy to read that so far all seems to work now.
So far I can only guess, but maybe Gecko has a problem accepting command when the client in long term connected. But as mentioned only guessing. Since the last restart of the geckoclient service setting temperature works fine form me.
Indeed the target Item must be a Number only. I was too lazy to work on the transition of a Temperature Number to Number value only :slight_smile:. And as its works like this, it will not be changed any more as usual.
I will post here, when I have added the blowers states.But first I need to solve an Selenium issue for another application. Always problems everywhere…
Best regards
Frank

Quicker than expected.
If I did not any mistakes, blowers should now also be reported in the same way as pumps and lights.
For the channel thinks and items you can use the pumps as a blueprint and adapt accordingly. It would be nice if you could post the MQTT JSON of a blower. I expect something liek:

{
  "Time":"08.01.2022, 18:11:01",
  "Blower 1":"OFF",
  "Blower 2":"OFF"
}

BR Frank

1 Like

Hi Frank,

the blower section is working as expected. Thanks a lot.
My SPA has just one blower.

MQTT JSON:

{
  "Time":"09.01.2022, 22:40:04",
  "Blower":"OFF"
}

Furthermore, I added some code to client,py to switch “Pump 1” and “Blower”. It was quite straight forward in the end - your examples for switching lights and setting target temperature were a very good baseline…

def set_pump1(client, userdata, message):
    '''
    Switch pump1 state
    '''
    topic = str(message.topic)
    msg = str(message.payload.decode("UTF-8"))
    logger.debug(f'msg erhalten: topic: {topic}, payload: {msg}')
    if (msg.startswith("set_pump1")):
        parts = msg.split("=")
        if len(parts) == 2:
            if "HI" == parts[1]:
                logger.info("Switching Pump 1 on")
                facade.pumps[1].set_mode("HI")
            elif "OFF" == parts[1]:
                logger.info("Switching Pump 1 off")
                facade.pumps[1].set_mode("OFF")


def set_blower(client, userdata, message):
    '''
    Switch blower state
    '''
    topic = str(message.topic)
    msg = str(message.payload.decode("UTF-8"))
    logger.debug(f'msg erhalten: topic: {topic}, payload: {msg}')
    if (msg.startswith("set_blower")):
        parts = msg.split("=")
        if len(parts) == 2:
            if "ON" == parts[1]:
                logger.info("Switching blower on")
                facade.blowers[0].turn_on()
            elif "OFF" == parts[1]:
                logger.info("Switching blower off")
                facade.blowers[0].turn_off()

mqtt.subscribe_and_message_callback(const.TOPIC_PUMPS + "/cmnd", set_pump1)
mqtt.subscribe_and_message_callback(const.TOPIC_BLOWERS + "/cmnd", set_blower)

channels for pump and blower in openhab…

channels:
  - id: pump1
    channelTypeUID: mqtt:switch
    label: Pumpe 1
    description: ""
    configuration:
      commandTopic: whirlpool/pumps/cmnd
      formatBeforePublish: set_pump1=%s
      stateTopic: whirlpool/pumps/state
      transformationPattern: JSONPATH:$.['Pump 1']
      off: OFF
      on: HI

  - id: blower
    channelTypeUID: mqtt:switch
    label: Blower
    description: ""
    configuration:
      commandTopic: whirlpool/blowers/cmnd
      formatBeforePublish: set_blower=%s
      stateTopic: whirlpool/blowers/state
      transformationPattern: JSONPATH:$.['Blower']
      off: OFF
      on: ON

I’m planning to add some code to control further devices / functions in the next few days - well, everything that can be added with basically zero python skills - challenge accepted :grinning:

BR, Marcus

Hey,
i had a working system. But now after a broken SD I tried to reinstall:

If I install the Geckofix files i got this error

sudo python3 /opt/geckoclient/client.py
Traceback (most recent call last):
  File "/opt/geckoclient/client.py", line 25, in <module>
    from geckolib import GeckoLocator
  File "/usr/local/lib/python3.9/dist-packages/geckolib/__init__.py", line 8, in <module>
    from .automation import (
  File "/usr/local/lib/python3.9/dist-packages/geckolib/automation/__init__.py", line 3, in <module>
    from .base import GeckoAutomationBase
  File "/usr/local/lib/python3.9/dist-packages/geckolib/automation/base.py", line 4, in <module>
    from ..driver import Observable
  File "/usr/local/lib/python3.9/dist-packages/geckolib/driver/__init__.py", line 3, in <module>
    from .protocol import (
  File "/usr/local/lib/python3.9/dist-packages/geckolib/driver/protocol/__init__.py", line 10, in <module>
    from .reminders import GeckoRemindersProtocolHandler, GeckoReminderType
ImportError: cannot import name 'GeckoReminderType' from 'geckolib.driver.protocol.reminders' (/usr/local/lib/python3.9/dist-packages/geckolib/driver/protocol/reminders.py)

No entries in the log no real start of the service

If I use the orginal scr from Gecko Main, i got some entries in the log but also its not working

This is the log detail

2022-11-20 21:52:29,080 - mqtt - INFO - MQTT successfull connected to broker 192.168.178.50
2022-11-20 21:52:29,081 - mqtt - INFO - Subscribing to whirlpool/water_heater/cmnd
2022-11-20 21:52:29,082 - mqtt - INFO - Subscribing to whirlpool/lights/cmnd
2022-11-20 21:53:15,266 - geckolib.automation.facade - ERROR - Spa took too long to connect ...
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/geckolib/automation/facade.py", line 76, in is_connected
    if not self._spa.is_connected:
  File "/usr/local/lib/python3.9/dist-packages/geckolib/spa.py", line 301, in is_connected
    raise RuntimeError("Spa took too long to connect ...")
RuntimeError: Spa took too long to connect ...

Shell

sudo python3 /opt/geckoclient/client.py
Traceback (most recent call last):
  File "/opt/geckoclient/client.py", line 304, in <module>
    facade.wait(0.1)
  File "/usr/local/lib/python3.9/dist-packages/geckolib/automation/facade.py", line 90, in wait
    raise Exception("Facade in error from previous exception")
Exception: Facade in error from previous exception

So hints?

Not sure I can help.
I followed instructions as described in this thread. Last blocking issue was related to permissions (as mentioned above).

Did that, they were installed as root