Hot Tub Gecko inTouch2

Hi,

based on the solution provided by gazoodle (GitHub - gazoodle/geckolib: Library to interface with Gecko Alliance spa pack systems via in.touch2 module) I have created a simple service that pushes the most important values to a broker. It works fine for my in.YT.
As the library was in python, I did not look into a way to create a binding. The second reason was to be in depended from OpenHab life-cycle, there for broker solution.

So far values for water header, with the possibility to set the target temperature, status of light including to switch them on and off, status of pumps, water care and filters and the reminders (only tested with rinse and clean filter, change water and check SPA) are included

Maybe you find this helpful (GitHub - kalinrow/geckoclient: A gecko client to publich Gecko in.touch data on a broker)

If needed, I can also provide you the things, items and rules (for reminders)

Best regards

1 Like

Hi @kalinrow,

Your approach looks very promising :grinning:

My new SPA just arrived, is up and running, works well with the in.Touch2 app

The SPA is also based on in.YT.

This is the first time I’m going to go about a broker solution in openhab - I’ve never done anything with MQTT in the past.

What is required to be installed, configured, etc. in openhab beyond the elements you describe on GitHub?

MQTT binding? What is the minimum config needed there?

# BROKER values
BROKER_ADDRESS = "192.168.1.100"
BROKER_PORT = 1883
BROKER_USERNAME = "username"
BROKER_PASSWORD = "password"
BROKER_ID = "geckoclient"
  • host: The IP/Hostname of the MQTT broker. Be aware that this binding allows only one bridge / one connection per unique host:port.
  • port: The optional port of the MQTT broker. If none is provided, the typical ports 1883 and 8883 (SSL) are used. Be aware that this binding allows only one bridge / one connection per unique host:port.
  • username: The MQTT username (since MQTT 3.1). Defaults to empty.
  • password: The MQTT password (since MQTT 3.1). Defaults to empty.
  • clientID: Use a fixed client ID. Defaults to empty which means a user ID is generated for this connection.

Would that be the correct mapping? Anything missing?

May I kindlky ask you to share you configs for the in.YT? (things/channels/items)

This would be very helpful indeed.
Thank you.

Has anyone else tried this approach?

I had success implementing GeckoLib and running GeckoShell.run().
This is working fine.

I followed the instructions however gecko.service fails to start.

user@NUC8i3BEK:~$ sudo systemctl status gecko.service
[sudo] password for user: 
● gecko.service - Gecko client service
     Loaded: loaded (/etc/systemd/system/gecko.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-12-27 17:30:55 CET; 35s ago
    Process: 1600 ExecStart=/usr/bin/python3 /opt/geckoclient/client.py (code=exited, status=1/FAILURE)
   Main PID: 1600 (code=exited, status=1/FAILURE)
 
Dez 27 17:30:55 NUC8i3BEK systemd[1]: gecko.service: Scheduled restart job, restart counter is at 5.
Dez 27 17:30:55 NUC8i3BEK systemd[1]: Stopped Gecko client service.
Dez 27 17:30:55 NUC8i3BEK systemd[1]: gecko.service: Start request repeated too quickly.
Dez 27 17:30:55 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dez 27 17:30:55 NUC8i3BEK systemd[1]: Failed to start Gecko client service.

# Log file
LOGFILE = "/var/log/geckoclient.log"


 not even a logfile is being created

Ubuntu reports the following error:

Any idea how to fix this?

Hello Marcus,
glad to read that you have installed the geckolib successfully.

From what I see in the posted error message it seems that you have forgotten to install the paho-mqtt library.

client.py crashed with ModuleNotFoundError in /opt/geckoclient/mqtt.py: No module named ‘paho’

Can you please check, if you have installed the needed libraries:

pip install paho-mqtt

You can also run the client manually first, to see any client output by executing:

python3 /opt/geckoclient/client.py

Please do not forget to patch the geckoclient as my mqtt bridge client is need of the additional features.

Unluckily I still fight with getting the target temperature in case it is set directly on the pool. And sometimes setting of the temperature is not working. I hope to be able to improve that in the coming month.

Best regards
Frank

Hi Frank,

glad to see you’re back :grinning:

Just re-installed everything - same result


Dec 28 21:07:14 NUC8i3BEK systemd[1]: Started Gecko client service.
Dec 28 21:07:14 NUC8i3BEK python3[26828]: Traceback (most recent call last):
Dec 28 21:07:14 NUC8i3BEK python3[26828]:   File "/opt/geckoclient/client.py", line 19, in <module>
Dec 28 21:07:14 NUC8i3BEK python3[26828]:     from mqtt import Mqtt
Dec 28 21:07:14 NUC8i3BEK python3[26828]:   File "/opt/geckoclient/mqtt.py", line 9, in <module>
Dec 28 21:07:14 NUC8i3BEK python3[26828]:     import paho.mqtt.client as paho
Dec 28 21:07:14 NUC8i3BEK python3[26828]: ModuleNotFoundError: No module named 'paho'
Dec 28 21:07:14 NUC8i3BEK systemd[1]: gecko.service: Main process exited, code=exited, status=1/FAILURE
Dec 28 21:07:14 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dec 28 21:07:14 NUC8i3BEK systemd[1]: gecko.service: Scheduled restart job, restart counter is at 5.
Dec 28 21:07:14 NUC8i3BEK systemd[1]: Stopped Gecko client service.
Dec 28 21:07:14 NUC8i3BEK systemd[1]: gecko.service: Start request repeated too quickly.
Dec 28 21:07:14 NUC8i3BEK systemd[1]: gecko.service: Failed with result 'exit-code'.
Dec 28 21:07:14 NUC8i3BEK systemd[1]: Failed to start Gecko client service.

it is installed as “user” not as “root”.

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

user@NUC8i3BEK:~$ pip install paho-mqtt
Processing ./.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

geckoclient files are located in:

user@NUC8i3BEK:/opt/geckoclient$ ls -l
total 28
-rw-rw-r-- 1 root root 9578 Nov 20 16:52 client.py
-rw-rw-r-- 1 root root  632 Dez 27 17:21 config.py
-rw-rw-r-- 1 root root  354 Nov 20 16:52 const.py
-rw-rw-r-- 1 root root 3556 Nov 20 16:52 mqtt.py
drwxr-xr-x 2 root root 4096 Dez 27 18:24 __pycache__
user@NUC8i3BEK:~$ python3 /opt/geckoclient/client.py
user@NUC8i3BEK:~$

edit 22:19
entry in gecko_client.log (btw no log entries when starting gecko.service)

2021-12-28 20:57:46,501 - mqtt - ERROR - Connection error: 111: Connection refused
2021-12-28 20:57:46,502 - geckoclient - ERROR - Stopping - Can't connect to broker

patched at 20:57

user@NUC8i3BEK:~/.local/lib/python3.8/site-packages/geckolib/automation$ ls -l
total 64
-rw-rw-r-- 1 user user   948 Dez 28 20:48 base.py
-rw-rw-r-- 1 user user   197 Dez 28 20:48 blower.py
-rw-rw-r-- 1 user user 10108 Dez 28 20:57 facade.py
-rw-rw-r-- 1 user user  6568 Dez 28 20:48 heater.py
-rw-rw-r-- 1 user user   694 Dez 28 20:57 __init__.py
-rw-rw-r-- 1 user user   300 Dez 28 20:48 keypad.py
-rw-rw-r-- 1 user user   182 Dez 28 20:48 light.py
-rw-rw-r-- 1 user user  1329 Dez 28 20:48 pump.py
drwxrwxr-x 2 user user  4096 Dez 28 20:57 __pycache__
-rw-rw-r-- 1 user user  1748 Dez 28 20:57 reminders.py
-rw-rw-r-- 1 user user  1731 Dez 28 20:48 sensors.py
-rw-rw-r-- 1 user user  1663 Dez 28 20:48 switches.py
-rw-rw-r-- 1 user user  2328 Dez 28 20:48 watercare.py

user@NUC8i3BEK:~/.local/lib/python3.8/site-packages/geckolib/driver/protocol$ ls -l
total 52
-rw-rw-r-- 1 user user 2585 Dez 28 20:48 configfile.py
-rw-rw-r-- 1 user user 1338 Dez 28 20:48 firmware.py
-rw-rw-r-- 1 user user 1844 Dez 28 20:48 getchannel.py
-rw-rw-r-- 1 user user 2374 Dez 28 20:48 hello.py
-rw-rw-r-- 1 user user 1356 Dez 28 20:48 __init__.py
-rw-rw-r-- 1 user user 3255 Dez 28 20:48 packcommand.py
-rw-rw-r-- 1 user user 2786 Dez 28 20:48 packet.py
-rw-rw-r-- 1 user user  830 Dez 28 20:48 ping.py
drwxrwxr-x 2 user user 4096 Dez 28 20:57 __pycache__
-rw-rw-r-- 1 user user 2082 Dez 28 20:57 reminders.py
-rw-rw-r-- 1 user user 4087 Dez 28 20:48 statusblock.py
-rw-rw-r-- 1 user user 1987 Dez 28 20:48 version.py
-rw-rw-r-- 1 user user 2878 Dez 28 20:48 watercare.py

This is a bit strange


edit 23:01:
Could be related to config.py

What are the correct broker settings?

###########
# configuration of SPA and BROKER
#

# SPA values
SPA_NAME = "Whirlpool"
SPA_IDENTIFIER = "SPA68:27:19:xx:xx:xx"


# Replace with your own UUID, see https://www.uuidgenerator.net/>
CLIENT_ID = "d265xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

# BROKER values
BROKER_ADDRESS = "192.168.0.13"
BROKER_PORT = 1883
BROKER_USERNAME = "xxx"
BROKER_PASSWORD = "xxx"
BROKER_ID = "geckoclient"

# Topic
TOPIC = "whirlpool"

# Log file
LOGFILE = "/var/log/geckoclient.log"

# Debug level
# can be one of the following strings
#   'CRITICAL','FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'NOTSET'
DEBUG_LEVEL = 'INFO'

Broker address would be the IP of the machine running GeckoClient, correct?
Do I need to set BROKER_USERNAME and BROKER_PASSWORD to something specific?

Best regards,
Marcus

Hello,

I took some days off during Christmas period :wink:
That is really a bit strange.

Regarding the Broker, you first need to either install a separate Broker (see [OH3] MQTT Setup and Configuration for details).

Then you need to put either 127.0.0.1 (if the broker and the geckoclient is on the same machine) or the IP of the machine the broker is running on else and depending if you have setup a user and password the values.

But that should not be a problem. At least the client should start, the log file should be created and something should be logged in there. Do you see anything inside when starting the client from the command line?

Best regards
Frank

Hello Frank,

a big step forward! Thanks a lot!

Some success - connection to broker successful and subscribed to water-heater and lights!
However, there is an error message when running client.py.
gecko.service still fails to start with the same message as in my previous post.

Maybe worth to mention:
I use SpaPackStruct.xml v33 (link) to connect to my in.YE-5-H3.6. I couldn’t get it running with v19 and v24.
The iOS app refers to in.YT, that’s why I Initially thought that my SPA has an in.YT.

MQTT broker set up as per instruction with the following result:

gecko_client.log:

2021-12-29 11:01:12,194 - mqtt - INFO - Subscribing to whirlpool/water_heater/cmnd
2021-12-29 11:01:12,194 - mqtt - INFO - MQTT successfull connected to broker 127.0.0.1
2021-12-29 11:01:12,194 - mqtt - INFO - Subscribing to whirlpool/lights/cmnd
user@NUC8i3BEK:~$ python3 /opt/geckoclient/client.py
Traceback (most recent call last):
  File "/opt/geckoclient/client.py", line 324, in <module>
    json = get_pumps_payload()
  File "/opt/geckoclient/client.py", line 89, in get_pumps_payload
    json += f'"{facade.pumps[2].name}":"{facade.pumps[2].mode}",'
IndexError: list index out of range

Output when running GeckoShell.run():

user@NUC8i3BEK:~$ python
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from geckolib import GeckoShell
>>> GeckoShell.run()


        <Disclaimer>
        ----------------------------- USE AT YOUR OWN RISK -----------------------------

        This code will allow you to make changes to your spa configuration that is
        outside of what the app, top panel and side panel settings allow. I've not
        tested every setting and it might be that you prevent your spa pack from
        operating as it used to do.

        Configuration is declared in the file SpaPackStruct.xml which is downloaded the
        first time you run this program. Settings marked as RW="ALL" seem to indicate
        that any process can write them, so you ought to be able to revert the settings
        to their original ones.

        I strongly suggest dumping the configuration values with the "config" command
        and recording them somewhere safe.

        </Disclaimer>

    
Starting discovery process...Found 1 spas
Connecting to spa `Whirlpool` at 192.168.0.8 ... connected!
Heater: Temperature 38.0°C, SetPoint 38.0°C, Real SetPoint 38.0°C, Operation Idle
Waterfall: ON
Pump 1: OFF
Blower: OFF
Lights: OFF
WaterCare: Waiting...
Smart Winter Mode:Risk = NO
Circulating Pump = ON
Ozone = OFF
Smart Winter Mode:Active = False
Filter Status:Clean = True
Filter Status:Purge = False
Welcome to the Gecko shell. Type help or ? to list commands.

Whirlpool$ state
Heater: Temperature 38.0°C, SetPoint 38.0°C, Real SetPoint 38.0°C, Operation Idle
Waterfall: ON
Pump 1: OFF
Blower: OFF
Lights: OFF
('Time', '29.12.2021, 11:16:52')
('RinseFilter', 23)
('CleanFilter', 53)
('ChangeWater', 83)
('CheckSpa', 723)
WaterCare: Standard
Smart Winter Mode:Risk = NO
Circulating Pump = ON
Ozone = OFF
Smart Winter Mode:Active = False
Filter Status:Clean = True
Filter Status:Purge = False

gecko.service:
As far as I know services in systemd are started as root whereas geckolib and paho-mqtt are installed in the user directory (site-packages). Maybe the path to paho.mqtt.client is unknown when running:

user@NUC8i3BEK:~$ sudo systemctl start gecko.service

Why not share your things/channels/items while troubleshooting errors and gecko.service
 it would probably help to have the end2end view for the stuff for which the subscription worked.

Best regards,
Marcus

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