OpenWeatherMap daily forecast using the free API

Hi, my page of rest API shows the Port “8002”.

openhabrest_port

Should i Change the port in the URL’s of the script ?

#scale_check_result = json.loads(executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -s --connect-timeout 10 -m 10 -X GET -H “Accept: application/json” “http://localhost:8080/rest/extensions/transformation-scale”", 15000)).get(‘installed’)
scale_check_result = executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -s --connect-timeout 10 -m 10 -X GET -H “Accept: application/json” “http://localhost:8080/rest/extensions/transformation-scale”", 15000)

Interesting… try both!

Here is the result wirth Port 8002


2020-06-13 11:44:35.953 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/personal/test.py’
2020-06-13 11:44:35.956 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/personal/test.py
2020-06-13 11:44:35.996 [WARN ] [jsr223.jython.TEST_2 ] -
2020-06-13 11:44:36.004 [WARN ] [jsr223.jython.TEST_2 ] - Jython version: 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)]
2020-06-13 11:44:36.019 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/openhab/conf/automation/jsr223/python/personal/test.py’: AttributeError: ‘module’ object has no attribute ‘uname’ in at line number 13

An here is the result with Port 8080

2020-06-13 12:20:46.991 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/personal/test.py’
2020-06-13 12:20:47.139 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/personal/test.py
2020-06-13 12:20:47.890 [WARN ] [jsr223.jython.TEST_2 ] -
2020-06-13 12:20:47.917 [WARN ] [jsr223.jython.TEST_2 ] - Jython version: 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)]
2020-06-13 12:20:47.919 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/openhab/conf/automation/jsr223/python/personal/test.py’: AttributeError: ‘module’ object has no attribute ‘uname’ in at line number 13

Hmmh, i think the results are the same.

Rats… comment out lines 13-15

Here is the new result:

…> 2020-06-13 16:44:08.834 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/personal/test.py’

2020-06-13 16:44:08.835 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/personal/test.py

2020-06-13 16:44:08.862 [WARN ] [jsr223.jython.TEST_2 ] -

2020-06-13 16:44:08.871 [WARN ] [jsr223.jython.TEST_2 ] - Jython version: 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)

[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)]

2020-06-13 16:44:08.876 [WARN ] [jsr223.jython.TEST_2 ] - Java version: java1.8.0_232

2020-06-13 16:44:08.878 [WARN ] [jsr223.jython.TEST_2 ] - File encoding: None

2020-06-13 16:44:08.884 [WARN ] [jsr223.jython.TEST_2 ] - sys.path: [’/openhab/conf/automation/lib/python’, ‘/openhab/conf/automation/jython/Lib’,
‘/openhab/conf/automation/jython/jython-standalone-2.7.0.jar/Lib’, ‘classpath’, ‘pyclasspath/’]

2020-06-13 16:44:08.889 [WARN ] [jsr223.jython.TEST_2 ] -

2020-06-13 16:44:08.946 [WARN ] [jsr223.jython.TEST_2 ] -

2020-06-13 16:44:08.948 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/openhab/conf/automation/jsr223/python/personal/test.py’: ValueError: No JSON object could be decoded in at line number 31

Was this with port 8002?

Your code fences look like quotes. Try ``` on the line before and after the log.

Here the result with Port 80002:

‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
2020-06-13 18:48:18.066 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/personal/test.py’
2020-06-13 18:48:18.069 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/personal/test.py
2020-06-13 18:48:18.121 [WARN ] [jsr223.jython.TEST_2 ] -
2020-06-13 18:48:18.127 [WARN ] [jsr223.jython.TEST_2 ] - Jython version: 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)]
2020-06-13 18:48:18.135 [WARN ] [jsr223.jython.TEST_2 ] - Java version: java1.8.0_232
2020-06-13 18:48:18.141 [WARN ] [jsr223.jython.TEST_2 ] - File encoding: None
2020-06-13 18:48:18.149 [WARN ] [jsr223.jython.TEST_2 ] - sys.path: [’/openhab/conf/automation/lib/python’, ‘/openhab/conf/automation/jython/Lib’, ‘/openhab/conf/automation/jython/jython-standalone-2.7.0.jar/Lib’, ‘classpath’, ‘pyclasspath/’]
2020-06-13 18:48:18.154 [WARN ] [jsr223.jython.TEST_2 ] -
2020-06-13 18:48:18.210 [WARN ] [jsr223.jython.TEST_2 ] - P
2020-06-13 18:48:18.213 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/openhab/conf/automation/jsr223/python/personal/test.py’: ValueError: No JSON object could be decoded in at line number 31
‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’

I have an update to test. The check Scale transformation service will not be installed on Windows, since the script is using curl to communicate with the REST API. The script is also now checking for the HTTP or HTTPS port that OH is configured with. If you’d like to test it out, replace lines 171-184 of the original script with this…

            # install Scale transformation service, if not already installed
            from java.lang import System

            if System.getProperty("os.name") == "Linux":
                import json
                from core.actions import Exec

                INSECURE_PORT = System.getProperty("org.osgi.service.http.port")
                SECURE_PORT = System.getProperty("org.osgi.service.http.port.secure")

                scale_check_result = None
                try:
                    scale_check_result = Exec.executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -s --connect-timeout 10 -m 10 -X GET -H \"Accept: application/json\" \"http://localhost:{}/rest/extensions/transformation-scale\"".format(INSECURE_PORT), 15000)
                except:
                    try:
                        scale_check_result = Exec.executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -s --connect-timeout 10 -m 10 -X GET -H \"Accept: application/json\" \"http://localhost:{}/rest/extensions/transformation-scale\"".format(SECURE_PORT), 15000)
                    except:
                        addOWMItems.log.warn("Scale transformation service installation failed: unable to communicate with REST API")
                        return
                if scale_check_result is not None:            
                    scale_check_result = json.loads(scale_check_result).get('installed')
                    if not scale_check_result:
                        install_scale_result = None
                        try:
                            install_scale_result = Exec.executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -o /dev/null -s -w \"%{{http_code}}\" --connect-timeout 10 -m 10 -X POST -H \"Content-Type: application/json\" -H \"Accept: application/json\" \"http://localhost:{}/rest/extensions/transformation-scale/install\"".format(INSECURE_PORT), 15000)
                        except:
                            try:
                                install_scale_result = Exec.executeCommandLine("/bin/sh@@-c@@/usr/bin/curl -o /dev/null -s -w \"%{{http_code}}\" --connect-timeout 10 -m 10 -X POST -H \"Content-Type: application/json\" -H \"Accept: application/json\" \"http://localhost:{}/rest/extensions/transformation-scale/install\"".format(SECURE_PORT), 15000)
                            except:
                                addOWMItems.log.warn("Scale transformation service installation failed")
                                return
                        if install_scale_result != "200":
                            addOWMItems.log.warn("Scale transformation service installation failed: result {}".format(install_scale_result))
                            return
                        else:
                            addOWMItems.log.debug("Scale transformation service has been installed")
                    else:
                        addOWMItems.log.debug("Scale transformation service is already installed")
                else:
                    addOWMItems.log.warn("Scale transformation service installation failed: REST API return None")
                    return

Should i replace the lines in the “owm_daily_forecast.py” script?

Here the new log :thinking:

‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
2020-06-14 14:30:13.108 [DEBUG] [.AutomationResourceBundlesEventQueue] - Process bundle event 2, for automation bundle ‘org.openhab.core.automation’
2020-06-14 14:30:13.124 [DEBUG] [.AutomationResourceBundlesEventQueue] - Process bundle event 32, for automation bundle ‘org.openhab.core.automation.module.script.rulesupport’
2020-06-14 14:30:13.142 [DEBUG] [vider.AbstractResourceBundleProvider] - Parse rules from bundle ‘org.openhab.core.automation’
2020-06-14 14:30:13.206 [DEBUG] [vider.AbstractResourceBundleProvider] - Parse rules from bundle ‘org.openhab.core.automation.module.script.rulesupport’
2020-06-14 14:30:13.636 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added CoreModuleHandlerFactory
2020-06-14 14:30:13.644 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added EphemerisModuleHandlerFactory
2020-06-14 14:30:13.649 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added TimerModuleHandlerFactory
2020-06-14 14:30:13.655 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added AnnotatedActionModuleTypeProvider
2020-06-14 14:30:13.920 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added AnnotatedThingActionModuleTypeProvider
2020-06-14 14:30:13.980 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added MediaModuleHandlerFactory
2020-06-14 14:30:14.045 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - GenericScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript, py, text/python, application/python, text/x-python, application/x-python]
2020-06-14 14:30:15.779 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a generic ScriptEngineFactory for Oracle Nashorn (1.8.0_232-b18): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.781 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - NashornScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.802 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a custom ScriptEngineFactory for Oracle Nashorn (1.8.0_232-b18): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.809 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - GenericScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript, py, text/python, application/python, text/x-python, application/x-python]
2020-06-14 14:30:15.811 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Removed GenericScriptEngineFactory
2020-06-14 14:30:15.813 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - NashornScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.815 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Removed NashornScriptEngineFactory
2020-06-14 14:30:15.839 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - GenericScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript, py, text/python, application/python, text/x-python, application/x-python]
2020-06-14 14:30:15.856 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a generic ScriptEngineFactory for Oracle Nashorn (1.8.0_232-b18): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.858 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - NashornScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.876 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a custom ScriptEngineFactory for Oracle Nashorn (1.8.0_232-b18): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]
2020-06-14 14:30:15.879 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added ScriptModuleHandlerFactory
2020-06-14 14:30:15.925 [TRACE] [al.provider.ScriptModuleTypeProvider] - ParameterOptions: {application/javascript=ECMAScript (ECMA - 262 Edition 5.1)}
2020-06-14 14:30:15.940 [TRACE] [al.provider.ScriptModuleTypeProvider] - ParameterOptions: {application/javascript=ECMAScript (ECMA - 262 Edition 5.1)}
2020-06-14 14:30:15.975 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added ScriptedCustomModuleHandlerFactory
2020-06-14 14:30:15.986 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added ScriptedPrivateModuleHandlerFactory
2020-06-14 14:30:16.571 [INFO ] [roker.internal.EmbeddedBrokerService] - Broker persistence file: mqttembedded.bin
2020-06-14 14:30:17.095 [WARN ] [roker.internal.EmbeddedBrokerService] - persistence corrupt: Could not deserialize [-84, -19, 0, 5, 115, 114, 0, 45, 105, 111, 46, 109, 111, 113, 117, 101, 116, 116, 101, 46, 98, 114, 111, 107, 101, 114, 46, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 83, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, -47, 11, -117, 54, 80, -6, 26, -58, 2, 0, 3, 76, 0, 8, 99, 108, 105, 101, 110, 116, 73, 100, 116, 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 76, 0, 12, 114, 101, 113, 117, 101, 115, 116, 101, 100, 81, 111, 115, 116, 0, 37, 76, 105, 111, 47, 110, 101, 116, 116, 121, 47, 104, 97, 110, 100, 108, 101, 114, 47, 99, 111, 100, 101, 99, 47, 109, 113, 116, 116, 47, 77, 113, 116, 116, 81, 111, 83, 59, 76, 0, 11, 116, 111, 112, 105, 99, 70, 105, 108, 116, 101, 114, 116, 0, 40, 76, 105, 111, 47, 109, 111, 113, 117, 101, 116, 116, 101, 47, 98, 114, 111, 107, 101, 114, 47, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 47, 84, 111, 112, 105, 99, 59, 120, 112, 116, 0, 22, 109, 113, 116, 116, 45,… [1.4.199/0], deleting /openhab/userdata/mqttembedded.bin
2020-06-14 14:30:18.553 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘localhost’ with clientid embedded-mqtt-broker
2020-06-14 14:30:18.886 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘192.168.10.24’ with clientid 70dfa5b1-20fa-403d-8c22-3654586385b7
2020-06-14 14:30:20.788 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2020-06-14 14:30:20.880 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2020-06-14 14:30:21.151 [INFO ] [openhab.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2020-06-14 14:30:41.043 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘javascript/core/000_startup_delay.js’
2020-06-14 14:30:41.890 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘js’ with identifier: file:/openhab/conf/automation/jsr223/javascript/core/000_startup_delay.js
2020-06-14 14:30:42.153 [INFO ] [jsr223.javascript.core.startup_delay] - Checking for initialized context
2020-06-14 14:30:42.257 [INFO ] [jsr223.javascript.core.startup_delay] - Context initialized… waiting 30s before allowing scripts to load
2020-06-14 14:31:12.318 [INFO ] [jsr223.javascript.core.startup_delay] - Complete
2020-06-14 14:31:12.321 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - scriptLoaded() is not defined in the script: file:/openhab/conf/automation/jsr223/javascript/core/000_startup_delay.js
2020-06-14 14:31:12.324 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/000_startup_delay.py’
2020-06-14 14:31:19.388 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/000_startup_delay.py
2020-06-14 14:31:19.453 [INFO ] [jsr223.jython.core.startup_delay ] - Checking for initialized context
2020-06-14 14:31:19.460 [INFO ] [jsr223.jython.core.startup_delay ] - Context initialized… waiting 30s before allowing scripts to load
2020-06-14 14:31:49.465 [INFO ] [jsr223.jython.core.startup_delay ] - Complete
2020-06-14 14:31:49.466 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - scriptLoaded() is not defined in the script: file:/openhab/conf/automation/jsr223/python/core/000_startup_delay.py
2020-06-14 14:31:49.469 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/100_DirectoryTrigger.py’
2020-06-14 14:31:49.472 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/100_DirectoryTrigger.py
2020-06-14 14:31:51.360 [INFO ] [23.jython.core.DirectoryEventTrigger] - TriggerHandler added [jsr223.DirectoryTrigger]
2020-06-14 14:31:51.377 [INFO ] [23.jython.core.DirectoryEventTrigger] - TriggerType added [jsr223.DirectoryTrigger]
2020-06-14 14:31:51.384 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/100_OsgiEventTrigger.py’
2020-06-14 14:31:51.390 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/100_OsgiEventTrigger.py
2020-06-14 14:31:52.492 [INFO ] [jsr223.jython.core.OsgiEventTrigger ] - TriggerHandler added [jsr223.OsgiEventTrigger]
2020-06-14 14:31:52.504 [INFO ] [jsr223.jython.core.OsgiEventTrigger ] - TriggerType added [jsr223.OsgiEventTrigger]
2020-06-14 14:31:52.507 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/100_StartupTrigger.py’
2020-06-14 14:31:52.509 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/100_StartupTrigger.py
2020-06-14 14:31:52.554 [INFO ] [jsr223.jython.core.StartupTrigger ] - TriggerHandler added [jsr223.StartupTrigger]
2020-06-14 14:31:52.559 [INFO ] [jsr223.jython.core.StartupTrigger ] - TriggerType added [jsr223.StartupTrigger]
2020-06-14 14:31:52.562 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonBindingInfoProvider.py’
2020-06-14 14:31:52.563 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonBindingInfoProvider.py
2020-06-14 14:31:52.700 [DEBUG] [thonBindingInfoProvider.scriptLoaded] - Registered service
2020-06-14 14:31:52.705 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonExtensionProvider.py’
2020-06-14 14:31:52.706 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonExtensionProvider.py
2020-06-14 14:31:53.513 [DEBUG] [.jython.core.JythonExtensionProvider] - Start init
2020-06-14 14:31:53.545 [DEBUG] [.jython.core.JythonExtensionProvider] - End init
2020-06-14 14:31:53.556 [DEBUG] [JythonExtensionProvider.scriptLoaded] - Registered service
2020-06-14 14:31:53.562 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonItemChannelLinkProvider.py’
2020-06-14 14:31:53.568 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonItemChannelLinkProvider.py
2020-06-14 14:31:53.671 [DEBUG] [ItemChannelLinkProvider.scriptLoaded] - Registered service
2020-06-14 14:31:53.675 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonItemProvider.py’
2020-06-14 14:31:53.676 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonItemProvider.py
2020-06-14 14:31:53.743 [DEBUG] [core.JythonItemProvider.scriptLoaded] - Registered service
2020-06-14 14:31:53.746 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonThingProvider.py’
2020-06-14 14:31:53.749 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonThingProvider.py
2020-06-14 14:31:53.809 [DEBUG] [ore.JythonThingProvider.scriptLoaded] - Registered service
2020-06-14 14:31:53.812 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonThingTypeProvider.py’
2020-06-14 14:31:53.813 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonThingTypeProvider.py
2020-06-14 14:31:53.875 [DEBUG] [JythonThingTypeProvider.scriptLoaded] - Registered service
2020-06-14 14:31:53.878 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonTransform.py’
2020-06-14 14:31:53.879 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonTransform.py
2020-06-14 14:31:53.929 [DEBUG] [onTransformationService.scriptLoaded] - Registered service
2020-06-14 14:31:53.931 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/community/openweathermap/owm_daily_forecast.py’
2020-06-14 14:31:53.933 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/community/openweathermap/owm_daily_forecast.py
2020-06-14 14:31:55.549 [DEBUG] [jsr223.jython.addOWMItems ] - owmThingUID set to [openweathermap:weather-and-forecast:55c3cb8e:local]
2020-06-14 14:31:56.188 [ERROR] [jsr223.jython.addOWMItems ] - Traceback (most recent call last):
File “”, line 208, in addOWMItems
NameError: global name ‘add_owm_items’ is not defined

2020-06-14 14:31:56.191 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/personal/test.py’
2020-06-14 14:31:56.193 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/personal/test.py
2020-06-14 14:31:56.222 [WARN ] [jsr223.jython.TEST_2 ] -
2020-06-14 14:31:56.226 [WARN ] [jsr223.jython.TEST_2 ] - Jython version: 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[OpenJDK 64-Bit Server VM (Azul Systems, Inc.)]
2020-06-14 14:31:56.243 [WARN ] [jsr223.jython.TEST_2 ] - Java version: java1.8.0_232
2020-06-14 14:31:56.246 [WARN ] [jsr223.jython.TEST_2 ] - File encoding: None
2020-06-14 14:31:56.251 [WARN ] [jsr223.jython.TEST_2 ] - sys.path: [’/openhab/conf/automation/lib/python’, ‘/openhab/conf/automation/jython/Lib’, ‘/openhab/conf/automation/jython/jython-standalone-2.7.0.jar/Lib’, ‘classpath’, ‘pyclasspath/’]
2020-06-14 14:31:56.253 [WARN ] [jsr223.jython.TEST_2 ] -
2020-06-14 14:31:56.308 [WARN ] [jsr223.jython.TEST_2 ] - P
2020-06-14 14:31:56.311 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/openhab/conf/automation/jsr223/python/personal/test.py’: ValueError: No JSON object could be decoded in at line number 31
‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
Hope it helps.

Sorry… I have other updates in the script that need to be pushed. The issue is that I had renamed the addOWMItems function to add_owm_items, so it choked on the logging. I have updated my other post.

Edit: I’ve pushed the update, so just grab the latest.

Hi, it works.

You are realy great. Thank very much. How can i donate your help.
:smiley:

You are very welcome!

Check the Sponsor link at the top of the helper library repository or my signature. THANK YOU :slightly_smiling_face:!

Sorry i was to hasty.
In Paper UI i can see the Values of the forecast, but in Basic UI not.
Also the log shows some errors from the script.
‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
2020-06-19 08:56:59.153 [DEBUG] [.AutomationResourceBundlesEventQueue] - Process bundle event 2, for automation bundle ‘org.openhab.core.automation’

2020-06-19 08:56:59.165 [DEBUG] [.AutomationResourceBundlesEventQueue] - Process bundle event 32, for automation bundle ‘org.openhab.core.automation.module.script.rulesupport’

2020-06-19 08:56:59.181 [DEBUG] [vider.AbstractResourceBundleProvider] - Parse rules from bundle ‘org.openhab.core.automation’

2020-06-19 08:56:59.184 [DEBUG] [vider.AbstractResourceBundleProvider] - Parse rules from bundle ‘org.openhab.core.automation.module.script.rulesupport’

2020-06-19 08:56:59.587 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added CoreModuleHandlerFactory

2020-06-19 08:56:59.624 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added EphemerisModuleHandlerFactory

2020-06-19 08:56:59.646 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added TimerModuleHandlerFactory

2020-06-19 08:56:59.656 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added AnnotatedActionModuleTypeProvider

2020-06-19 08:56:59.735 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added AnnotatedThingActionModuleTypeProvider

2020-06-19 08:56:59.786 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added MediaModuleHandlerFactory

2020-06-19 08:56:59.877 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - GenericScriptEngineFactory.getScriptTypes(): [py, text/python, application/python, text/x-python, application/x-python, js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:04.697 [INFO ] [ternal.dhcp.DHCPPacketListenerServer] - DHCP request packet listener online

2020-06-19 08:57:06.250 [INFO ] [rk.internal.handler.SpeedTestHandler] - Speedtests starts in 5 minutes, then refreshes every 20 minutes

2020-06-19 08:57:06.666 [INFO ] [marthome.model.script.D1MINI2 Switch] - Status is: NULL

2020-06-19 08:57:06.666 [INFO ] [marthome.model.script.D1MINI2 Switch] - Status is: NULL

2020-06-19 08:57:07.531 [INFO ] [o.internal.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds

2020-06-19 08:57:07.723 [INFO ] [o.internal.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds

2020-06-19 08:57:07.826 [INFO ] [o.internal.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds

2020-06-19 08:57:07.886 [INFO ] [o.internal.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds

2020-06-19 08:57:12.143 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id ‘rrd4j’

2020-06-19 08:57:12.144 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id ‘rrd4j’

2020-06-19 08:57:14.325 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a generic ScriptEngineFactory for jython (2.7.0): supports python (2.7) with file extensions [py], names [python, jython], and mimetypes [text/python, application/python, text/x-python, application/x-python]

2020-06-19 08:57:14.326 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - NashornScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.441 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a custom ScriptEngineFactory for Oracle Nashorn (1.8.0_232-b18): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.453 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - GenericScriptEngineFactory.getScriptTypes(): [py, text/python, application/python, text/x-python, application/x-python, js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.455 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Removed GenericScriptEngineFactory

2020-06-19 08:57:15.456 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - NashornScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.457 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Removed NashornScriptEngineFactory

2020-06-19 08:57:15.502 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - GenericScriptEngineFactory.getScriptTypes(): [py, text/python, application/python, text/x-python, application/x-python, js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.504 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a generic ScriptEngineFactory for jython (2.7.0): supports python (2.7) with file extensions [py], names [python, jython], and mimetypes [text/python, application/python, text/x-python, application/x-python]

2020-06-19 08:57:15.506 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - NashornScriptEngineFactory.getScriptTypes(): [js, application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.529 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Initialized a custom ScriptEngineFactory for Oracle Nashorn (1.8.0_232-b18): supports ECMAScript (ECMA - 262 Edition 5.1) with file extensions [js], names [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript], and mimetypes [application/javascript, application/ecmascript, text/javascript, text/ecmascript]

2020-06-19 08:57:15.534 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added ScriptModuleHandlerFactory

2020-06-19 08:57:15.546 [TRACE] [al.provider.ScriptModuleTypeProvider] - ParameterOptions: {application/python=Python (2.7)}

2020-06-19 08:57:15.565 [TRACE] [al.provider.ScriptModuleTypeProvider] - ParameterOptions: {application/javascript=ECMAScript (ECMA - 262 Edition 5.1), application/python=Python (2.7)}

2020-06-19 08:57:15.585 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added ScriptedCustomModuleHandlerFactory

2020-06-19 08:57:15.594 [DEBUG] [e.automation.internal.RuleEngineImpl] - ModuleHandlerFactory added ScriptedPrivateModuleHandlerFactory

2020-06-19 08:57:16.055 [INFO ] [roker.internal.EmbeddedBrokerService] - Broker persistence file: mqttembedded.bin

2020-06-19 08:57:16.450 [WARN ] [roker.internal.EmbeddedBrokerService] - persistence corrupt: Could not deserialize [-84, -19, 0, 5, 115, 114, 0, 45, 105, 111, 46, 109, 111, 113, 117, 101, 116, 116, 101, 46, 98, 114, 111, 107, 101, 114, 46, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 46, 83, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, -47, 11, -117, 54, 80, -6, 26, -58, 2, 0, 3, 76, 0, 8, 99, 108, 105, 101, 110, 116, 73, 100, 116, 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 76, 0, 12, 114, 101, 113, 117, 101, 115, 116, 101, 100, 81, 111, 115, 116, 0, 37, 76, 105, 111, 47, 110, 101, 116, 116, 121, 47, 104, 97, 110, 100, 108, 101, 114, 47, 99, 111, 100, 101, 99, 47, 109, 113, 116, 116, 47, 77, 113, 116, 116, 81, 111, 83, 59, 76, 0, 11, 116, 111, 112, 105, 99, 70, 105, 108, 116, 101, 114, 116, 0, 40, 76, 105, 111, 47, 109, 111, 113, 117, 101, 116, 116, 101, 47, 98, 114, 111, 107, 101, 114, 47, 115, 117, 98, 115, 99, 114, 105, 112, 116, 105, 111, 110, 115, 47, 84, 111, 112, 105, 99, 59, 120, 112, 116, 0, 22, 109, 113, 116, 116, 45,… [1.4.199/0], deleting /openhab/userdata/mqttembedded.bin

2020-06-19 08:57:18.333 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘localhost’ with clientid embedded-mqtt-broker

2020-06-19 08:57:18.587 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ‘192.168.10.24’ with clientid 37036d2f-e3bd-4a44-b855-086dc2e17217

2020-06-19 08:57:20.282 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel

2020-06-19 08:57:20.418 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder

2020-06-19 08:57:20.528 [INFO ] [openhab.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui

2020-06-19 08:57:40.635 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/000_startup.py’

2020-06-19 08:57:40.640 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/000_startup.py

2020-06-19 08:57:46.963 [TRACE] [ipt.internal.ScriptEngineManagerImpl] - scriptLoaded() is not defined in the script: file:/openhab/conf/automation/jsr223/python/core/000_startup.py

2020-06-19 08:57:46.966 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/100_DirectoryTrigger.py’

2020-06-19 08:57:46.967 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/100_DirectoryTrigger.py

2020-06-19 08:57:47.206 [INFO ] [23.jython.core.DirectoryEventTrigger] - TriggerHandler added [jsr223.DirectoryTrigger]

2020-06-19 08:57:47.211 [INFO ] [23.jython.core.DirectoryEventTrigger] - TriggerType added [jsr223.DirectoryTrigger]

2020-06-19 08:57:47.214 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/100_OsgiEventTrigger.py’

2020-06-19 08:57:47.215 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/100_OsgiEventTrigger.py

2020-06-19 08:57:47.778 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - Error during evaluation of script ‘file:/openhab/conf/automation/jsr223/python/core/components/100_OsgiEventTrigger.py’: ImportError: cannot import name bundle_context in at line number 8

2020-06-19 08:57:47.781 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/100_StartupTrigger.py’

2020-06-19 08:57:47.784 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/100_StartupTrigger.py

2020-06-19 08:57:47.827 [INFO ] [jsr223.jython.core.StartupTrigger ] - TriggerHandler added [jsr223.StartupTrigger]

2020-06-19 08:57:47.831 [INFO ] [jsr223.jython.core.StartupTrigger ] - TriggerType added [jsr223.StartupTrigger]

2020-06-19 08:57:47.834 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonBindingInfoProvider.py’

2020-06-19 08:57:47.836 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonBindingInfoProvider.py

2020-06-19 08:57:47.919 [DEBUG] [thonBindingInfoProvider.scriptLoaded] - Registered service

2020-06-19 08:57:47.928 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonExtensionProvider.py’

2020-06-19 08:57:47.930 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonExtensionProvider.py

2020-06-19 08:57:48.001 [DEBUG] [JythonExtensionProvider.scriptLoaded] - Added JythonExtensionProvider

2020-06-19 08:57:48.004 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonItemChannelLinkProvider.py’

2020-06-19 08:57:48.006 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonItemChannelLinkProvider.py

2020-06-19 08:57:48.081 [DEBUG] [ItemChannelLinkProvider.scriptLoaded] - Registered service

2020-06-19 08:57:48.083 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonItemProvider.py’

2020-06-19 08:57:48.085 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonItemProvider.py

2020-06-19 08:57:48.141 [DEBUG] [core.JythonItemProvider.scriptLoaded] - Registered service

2020-06-19 08:57:48.144 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonThingProvider.py’

2020-06-19 08:57:48.147 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonThingProvider.py

2020-06-19 08:57:48.252 [DEBUG] [ore.JythonThingProvider.scriptLoaded] - Registered service

2020-06-19 08:57:48.261 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonThingTypeProvider.py’

2020-06-19 08:57:48.266 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonThingTypeProvider.py

2020-06-19 08:57:48.377 [DEBUG] [JythonThingTypeProvider.scriptLoaded] - Registered service

2020-06-19 08:57:48.379 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/core/components/200_JythonTransform.py’

2020-06-19 08:57:48.381 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/core/components/200_JythonTransform.py

2020-06-19 08:57:48.436 [DEBUG] [onTransformationService.scriptLoaded] - Registered service

2020-06-19 08:57:48.438 [INFO ] [me.core.service.AbstractWatchService] - Loading script ‘python/community/openweathermap/owm_daily_forecast.py’

2020-06-19 08:57:48.441 [DEBUG] [ipt.internal.ScriptEngineManagerImpl] - Added ScriptEngine for language ‘py’ with identifier: file:/openhab/conf/automation/jsr223/python/community/openweathermap/owm_daily_forecast.py

2020-06-19 08:57:49.033 [DEBUG] [jsr223.jython.add_owm_items ] - owm_thing_uid set to ‘openweathermap:weather-and-forecast:55c3cb8e:local’

2020-06-19 08:57:49.775 [DEBUG] [jsr223.jython.add_owm_items ] - Scale transformation service is already installed

2020-06-19 08:57:53.560 [ERROR] [jsr223.jython.add_owm_items ] - Traceback (most recent call last):

File “”, line 354, in add_owm_items

File “/openhab/conf/automation/lib/python/core/triggers.py”, line 37, in

from core.osgi.events import OsgiEventTrigger

File “/openhab/conf/automation/lib/python/core/osgi/events.py”, line 29, in

from core.osgi import bundle_context

ImportError: cannot import name bundle_context
‘’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’

Just three backticks ```, before and after. Or read this.

This would not be a problem with the script. What do you have in your sitemap? This should be all you need…

Group item=gOpenWeatherMap

quote=“j67, post:126, topic:62579”]
ImportError: cannot import name bundle_context
[/quote]

I thought you were using the beta Jython addon. If not, please download the latest libraries and scripts.

Hi, i had failure in my Sitemap file, and i made everything new with openhelper libaries,scripts and jython addon.
Now it seems to work.

Thank you

1 Like

@5iver -First of all, I’d say that the script you did is just great ! works like a charm. However, when I started playing I found I’m missing ability to give item names in my local language, especially for day of the week. I played with the calendar but there were other difficulties with unicode strings in jython. Besides that I wanted to slightly customize the way how forecast days are displayed - not as name of the days, but instead like “Tomorrow”, “The day after tomorrow”, etc. (of course in my local language). So I end up with using Map transformation service and it lead me to the solution that allows to localise all the Item labels. If you interested to add it to the scripters respository, I created a corresponding PR: https://github.com/openhab-scripters/openhab-helper-libraries/pull/357. However to have it fully functional, another PR is requried to enable unicode characters treatment at least in core/lib/items: https://github.com/openhab-scripters/openhab-helper-libraries/pull/356

Hi,

does this work in OH3?

EDIT:
Nevermind, I found what I needed in the OpenWeatherMap Binding

Sorry, i have the same question.
Is ist possible to migrate the Open Weather Scripts f with jython to OH3?

It’s possible but no longer necessary. The new One Call API OWM provides now gives all the information so there is no longer a need to compile today’s forecast using the hourly forecast.

1 Like