Rules - An error occurred during the script execution: null


(Christoph Schwaeppe) #1
  • Platform information:
    Release = Raspbian GNU/Linux 9 (stretch)
    Kernel = Linux 4.9.80-v7+
    Platform = Raspberry Pi 3 Model B Rev 1.2
  • Java Runtime Environment:
    openjdk version “1.8.0_152”
    OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
    OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
  • openHAB version:
    openHAB 2.3.0~20180314204401-1 (Build #1227)

I tried to install a 433Mhz transmitter as it is described here OpenHAB Exec Binding explained in detail on 433MHz radio transmitter example.

I’m getting log errors when uploading the rules file to my installation. This just happens at the first time uploading. All following uploads don’t send any message. In either case the I can’t switch the transmitter. At the command line the ophenhab user has the rights to execute the command (/opt/433Utils/RPi_utils/codesend 1361) and the switch reacts as expected.

    2018-03-15 16:22:36.565 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplugs.rules'

    2018-03-15 16:22:36.959 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

    2018-03-15 16:22:36.962 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

    2018-03-15 16:22:36.964 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

    2018-03-15 16:22:36.967 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': Script interpreter couldn't be obtain

    2018-03-15 16:22:36.961 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

    2018-03-15 16:22:36.967 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

Nevertheless I get following messages in my log when switching:

    2018-03-15 16:26:51.632 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from OFF to ON

    2018-03-15 16:26:52.583 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_A' received command OFF

    2018-03-15 16:26:52.622 [ome.event.ItemCommandEvent] - Item 'Remote_Send_Args' received command 1364

    2018-03-15 16:26:52.630 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from ON to OFF

    2018-03-15 16:26:52.643 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 1361 to 1364

Here is my things file:

    Thing exec:comand:remote-send [
        command="/opt/433Utils/RPi_utils/codesend %2$s",
        interval=0,
        autorun=true
]

My items file

    Switch Power_Plug_Socket_A <poweroutlet>
    Switch Power_Plug_Socket_B <poweroutlet>
    Switch Power_Plug_Socket_C <poweroutlet>

    Switch Remote_Send      { channel="exec:command:remote-send:run"    }
    String Remote_Send_Args { channel="exec:command:remote-send:input"  }
    String Remote_Send_Out  { channel="exec:command:remote-send:output" }

My rules file

    rule "Poweroutlet A"
        when
            Item Power_Plug_Socket_A received command
        then
            // wait for transmitter to be free
            // State will be NULL if not used before or ON while command is executed
            while(Remote_Send.state == ON){
                Thread::sleep(500)
            }

            if(receivedCommand == ON){
                Remote_Send_Args.sendCommand("1361")
            }else{
                Remote_Send_Args.sendCommand("1364")
            }
                
            // wait for the command to complete
            while(Remote_Send.state != OFF){
                Thread::sleep(500)
            }

            logInfo("Power_Plug", "Result:" + Remote_Send_Out.state )
    end
    rule "Poweroutlet B"
        when
            Item Power_Plug_Socket_B received command
        then
            // wait for transmitter to be free
            // State will be NULL if not used before or ON while command is executed
            while(Remote_Send.state == ON){
                Thread::sleep(500)
            }

            if(receivedCommand == ON){
                Remote_Send_Args.sendCommand("5207728 4 355")
            }else{
                Remote_Send_Args.sendCommand("4908304 4 355")
            }
                
            // wait for the command to complete
            while(Remote_Send.state != OFF){
                Thread::sleep(500)
            }

            logInfo("Power_Plug", "Result:" + Remote_Send_Out.state )
    end
    rule "Poweroutlet C"
        when
            Item Power_Plug_Socket_C received command
        then
            // wait for transmitter to be free
            // State will be NULL if not used before or ON while command is executed
            while(Remote_Send.state == ON){
                Thread::sleep(500)
            }

            if(receivedCommand == ON){
                Remote_Send_Args.sendCommand("5207732 4 355")
            }else{
                Remote_Send_Args.sendCommand("4258212 4 355")
            }
                
            // wait for the command to complete
            while(Remote_Send.state != OFF){
                Thread::sleep(500)
            }

            logInfo("Power_Plug", "Result:" + Remote_Send_Out.state )
    end

And my sitemap file:

    sitemap default label="My first sitemap"
    {
        Frame label="Funkschaltdosen"
        {
            Switch item=Power_Plug_Socket_A label="Power Plug A"
            Switch item=Power_Plug_Socket_B label="Power Plug B"
            Switch item=Power_Plug_Socket_C label="Power Plug C"
         }
     }

I read a lot of articles but didn’t find a solution. Could you please help me?
Maybe @Josar is arround here?


(Josar) #2

Please try to get the formating right. Reading this is hard and makes no fun . :joy:

Mostly its when you try to wrap the code fences around the code after pasted it in. First place the fence then the code.

@ThomDietrich but as i tested the fix for that seems to be on place and working as i did not got code with multiple lines formatted to multiple code fences.

Edit: Thank you, you did as i wrote.


(Josar) #4

Ahhjo.

I can not reproduce your error. I copied your rule A.

What does the log say when you use the full path /home/pi/opt?
Only thing i found was the path. Which has an meaningfull error in my case.

[vent.ItemStateChangedEvent] - Remote_CodeSend_Out changed from sending code[11607815] to Cannot run program "/SourceCode/433Utils/RPi_utils/codesend": error=2, No such file or directory

A null error mostly says one used element is not initialized. Try to change all files and save them again. See if the log shows an error.
Maybe you saved the rule before you had the items? Restart openhab, better the whole RPI.

Make sure the items are instanciated by looking in the openhab console or VSCode.
Do you use VSCode and the Openhab plugin?

And my setup.


(Christoph Schwaeppe) #5

Hi Josar.

very nice of you responding to my post! A lot of questions, I will answer them as good as possible.

  1. full path /home/pi/opt
    My path is “/opt/433Utils/RPi_utils/”. Both users (openhabianpi and openhab) can run the command “/opt/433Utils/RPi_utils/codesend 1361” without any error and the powerplug reacts as expected.

  2. A null error mostly says one used element is not initialized.
    I changed all files in the order exec.things, powerplug.items, powerplugs.rules and default.sitemap.

Afterwards I did a “sudo reboot” in an ssh session. After reboot I started vscode and all powerplug related items are instantiated

Maybe it’s helpful to see my tail -F logs beginning from start up after reboot. All poweroutlet items and related stuff is from a former try through paperUI. I can’t remove them. I didn’t and don’t hav any files, I can’t see them in paperUI nor vscode.

2018-03-15 22:32:11.598 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to de_DE, Location set to 50.757430,6.082693, Time zone set to Europe/Berlin

2018-03-15 22:32:12.507 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.1.9:8080

2018-03-15 22:32:12.515 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.1.9:8443

2018-03-15 22:32:17.147 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = 33b344c7-616d-430f-99fb-069fe93549db, base URL = http://localhost:8080)

2018-03-15 22:32:39.054 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'weather.items'

2018-03-15 22:32:39.212 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'powerplug.items'

2018-03-15 22:32:39.307 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.items'

2018-03-15 22:32:45.327 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

2018-03-15 22:32:52.438 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'powerplugs.rules'

2018-03-15 22:32:53.770 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'default.sitemap'

2018-03-15 22:32:54.490 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'exec.things'

2018-03-15 22:32:54.697 [WARN ] [ore.common.registry.AbstractRegistry] - Could not add element: The specified name of the item 'systeminfo_computer_openhabianpi_network#ip' is not valid!

java.lang.IllegalArgumentException: The specified name of the item 'systeminfo_computer_openhabianpi_network#ip' is not valid!

	at org.eclipse.smarthome.core.items.ItemUtil.assertValidItemName(ItemUtil.java:78) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.internal.items.ItemRegistryImpl.initializeItem(ItemRegistryImpl.java:168) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.internal.items.ItemRegistryImpl.onAddElement(ItemRegistryImpl.java:222) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.internal.items.ItemRegistryImpl.onAddElement(ItemRegistryImpl.java:1) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.addProvider(AbstractRegistry.java:289) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.internal.items.ItemRegistryImpl.addProvider(ItemRegistryImpl.java:352) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.common.registry.AbstractRegistry$ProviderTracker.addingService(AbstractRegistry.java:113) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.eclipse.smarthome.core.common.registry.AbstractRegistry$ProviderTracker.addingService(AbstractRegistry.java:1) [103:org.eclipse.smarthome.core:0.10.0.201802191927]

	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) [?:?]

	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) [?:?]

	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) [?:?]

	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) [?:?]

	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?]

	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) [?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?]

	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) [?:?]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1012) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:968) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:127) [36:org.apache.felix.scr:2.0.12]

	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [?:?]

	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915) [?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127) [?:?]

	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225) [?:?]

	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464) [?:?]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) [36:org.apache.felix.scr:2.0.12]

	at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) [36:org.apache.felix.scr:2.0.12]

	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482) [?:?]

	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415) [?:?]

	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) [?:?]

	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444) [?:?]

	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:903) [?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) [?:?]

	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:156) [?:?]

	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) [?:?]

	at org.eclipse.osgi.container.Module.start(Module.java:467) [?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]

	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

==> /var/log/openhab2/events.log <==

2018-03-15 22:32:54.861 [.ItemChannelLinkAddedEvent] - Link 'Remote_Send_Out-exec:command:remote-send:output' has been added.

2018-03-15 22:32:54.866 [.ItemChannelLinkAddedEvent] - Link 'Remote_Send_Args-exec:command:remote-send:input' has been added.

2018-03-15 22:32:54.878 [.ItemChannelLinkAddedEvent] - Link 'Remote_Send-exec:command:remote-send:run' has been added.

2018-03-15 22:32:54.895 [.ItemChannelLinkAddedEvent] - Link 'exec_command_poweroutlet_03_control_run-exec:command:poweroutlet-03-control:run' has been added.

2018-03-15 22:32:54.904 [.ItemChannelLinkAddedEvent] - Link 'exec_command_poweroutlet_02_control_run-exec:command:poweroutlet-01-control:input' has been added.

2018-03-15 22:32:54.913 [.ItemChannelLinkAddedEvent] - Link 'exec_command_poweroutlet_01_control_run-exec:command:poweroutlet_01_control:run' has been added.

2018-03-15 22:32:54.925 [.ItemChannelLinkAddedEvent] - Link 'exec_command_poweroutlet_02_control_run-exec:command:poweroutlet_02_control:run' has been added.

2018-03-15 22:32:54.934 [.ItemChannelLinkAddedEvent] - Link 'exec_command_poweroutlet_03_control_run-exec:command:poweroutlet_03_control:run' has been added.

2018-03-15 22:32:54.938 [.ItemChannelLinkAddedEvent] - Link 'systeminfo_computer_openhabianpi_network_networkDisplayName-systeminfo:computer:openhabianpi:network' has been added.

2018-03-15 22:32:54.948 [.ItemChannelLinkAddedEvent] - Link 'exec_command_poweroutlet_02_control_input-exec:command:poweroutlet-02-control:input' has been added.

==> /var/log/openhab2/openhab.log <==

2018-03-15 22:33:01.817 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app

2018-03-15 22:33:01.983 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui

2018-03-15 22:33:03.412 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin

2018-03-15 22:38:20.720 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_A' received command ON

2018-03-15 22:38:20.779 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from NULL to ON

2018-03-15 22:38:21.748 [ome.event.ItemCommandEvent] - Item 'Remote_Send_Args' received command 1361

2018-03-15 22:38:21.758 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from NULL to 1361

2018-03-15 22:38:21.919 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_A' received command OFF

2018-03-15 22:38:21.956 [ome.event.ItemCommandEvent] - Item 'Remote_Send_Args' received command 1364

2018-03-15 22:38:21.969 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from ON to OFF

2018-03-15 22:38:21.975 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 1361 to 1364
2018-03-15 22:39:31.024 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'exec.things'

2018-03-15 22:39:56.560 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplug.items'

2018-03-15 22:40:18.858 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'powerplugs.rules'

2018-03-15 22:40:19.254 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

2018-03-15 22:40:19.256 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: null

2018-03-15 22:41:07.229 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'default.sitemap'

(Josar) #6

To put it simple this is not your absolute path from the root directory. Executing something whit / defines that it is from the root. When you just start with the folder name it starts from the working directory.

When openhab runs a skript the working directory directory is /var/lib/openhab2. So you musst define your path absolute from the root of the disk.

If you go backwards you can see that you are not at the end when you are in home/pi/ folder

pi@raspberrypi:~ $ cd ..
pi@raspberrypi:/home $ cd ..
pi@raspberrypi:/ $ 

Thats said, you should at least get the error massage:

'Cannot run program "/SourceCode/433Utils/RPi_utils/codesend": error=2, No such file or directory'

So maybe cleaning the cache helps or a new installation of openhab.

sudo systemctl stop openhab2.service
sudo rm -rf /var/lib/openhab2/cache/*
sudo rm -rf /var/lib/openhab2/tmp/*
sudo systemctl start openhab2.service

(Christoph Schwaeppe) #7

I’m no Linux newbie but I can’t follow you. In which directory I should execute which command? When and how should I get an error message? “/SourceCode/433Utils/RPi_utils/codesend” can’t work. This directory doesn’t exist. Is it a placeholder? For what?

Executing “/opt/433Utils/RPi_utils/codesend 1361” should work from everywhere.

Also I stoped openhab, deleted all the mentioned files and started openhab again. This doesn’t change anything. Even after reboot.


(Josar) #8

Sorry my bad, this is your full path from root. :man_facepalming:

Your rule file must be error free, when i just add randome text the rules do not execute anymore. When i save i get following error which hints to the obvious.

[WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'RF433.rules' has errors, therefore ignoring it: [15,13]: no viable alternative at input 'sfmsd'

Do you have more then this 3 rules in the file? Try to remove all besides one.

And maybe try to get the log error free.

2018-03-15 22:32:54.697 [WARN ] [ore.common.registry.AbstractRegistry] - Could not add element: The specified name of the item 'systeminfo_computer_openhabianpi_network#ip' is not valid!
java.lang.IllegalArgumentException: The specified name of the item 'systeminfo_computer_openhabianpi_network#ip' is not valid!

If you say you can’t delete the items from paper UI there is something wrong.
Sometimes, cleaning everything up and start from scratch is the best solution.
Remove Openhab abd set it up again and Add one one thing, one item, one rule …


(Christoph Schwaeppe) #9

I decided to start up from scratch. Afterwards I will install only one powerplug nothing else. I will report my experience here.

That’s no problem for now, because it is no productive and complex running system. Once my installation has reached this target, is there any way to backup and restore a running system in case there will appear a similar problem in the future. Than I wouldn’t like to start up from scratch again. Are this advises (openHAB Community Backing/Restoring up openHAB2.x) and (openHAB 2 on Linux, Backup and Restore) suitable for this?

Thanks for your assistance
Christoph


(Christoph Schwaeppe) #10

Last greetings of my dying system :wink:

2018-03-16 17:01:22.186 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A1': cannot invoke method public org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.items.GenericItem.getState() on null

2018-03-16 17:01:22.273 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A1': cannot invoke method public org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.items.GenericItem.getState() on null

2018-03-16 17:01:22.273 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A1': cannot invoke method public org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.items.GenericItem.getState() on null

2018-03-16 17:01:22.278 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A1': cannot invoke method public org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.items.GenericItem.getState() on null

(Christoph Schwaeppe) #11

I have done all this. I have no more any warnings and exceptions. I’m able to switch from the commandline as openhabian and openhab. All openhab items in vscode appear as expected. The logs also.

In reality using basic ui NOTHING happens. ???

Should I continue this discussion in the original thread?
OpenHAB Exec Binding explained in detail on 433MHz radio transmitter example

I will do well formated posts. I promise! :wink:


(Vincent Regaud) #12

What do the logs show when you switch your items on basicUI?


(Christoph Schwaeppe) #13
2018-03-16 21:11:05.246 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_A' received command ON

2018-03-16 21:11:05.953 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from NULL to ON

2018-03-16 21:11:06.076 [ome.event.ItemCommandEvent] - Item 'Remote_Send_Args' received command 1361

2018-03-16 21:11:06.094 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from NULL to 1361

2018-03-16 21:11:06.944 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_A' received command OFF

2018-03-16 21:11:06.972 [ome.event.ItemCommandEvent] - Item 'Remote_Send_Args' received command 1364

2018-03-16 21:11:06.982 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from ON to OFF

2018-03-16 21:11:06.994 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 1361 to 1364

(Vincent Regaud) #14

In your things file:

comand … two m in command!!

It should be:

    Thing exec:command:remote-send [
        command="/opt/433Utils/RPi_utils/codesend %2$s",
        interval=0,
        autorun=true
]


(Christoph Schwaeppe) #15

I can’t see any difference in the things file. Nevertheless I copied your code and got thist:

2018-03-16 23:40:26.448 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'exec.things'

==> /var/log/openhab2/events.log <==

2018-03-16 23:40:26.742 [hingStatusInfoChangedEvent] - 'exec:command:remote-send' changed from UNINITIALIZED to INITIALIZING

2018-03-16 23:40:26.809 [hingStatusInfoChangedEvent] - 'exec:command:remote-send' changed from INITIALIZING to ONLINE

==> /var/log/openhab2/openhab.log <==

2018-03-16 23:40:26.863 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'exec.things'

==> /var/log/openhab2/events.log <==

2018-03-16 23:40:26.940 [me.event.ThingUpdatedEvent] - Thing 'exec:command:remote-send' has been updated.

==> /var/log/openhab2/openhab.log <==

2018-03-16 23:40:29.936 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_notEquals(java.lang.Object,java.lang.Object) on instance: NULL

2018-03-16 23:40:29.936 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Poweroutlet A': An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_notEquals(java.lang.Object,java.lang.Object) on instance: NULL

(Vincent Regaud) #16

At the very top of your post, your thing was defined with:

    Thing exec:comand:remote-send [
        command="/opt/433Utils/RPi_utils/codesend %2$s",
        interval=0,
        autorun=true
]

with 1 m in comand

Your log now shows that you thing is online - That’s good.
The null errors are normal because your items are not initialised… yet.
Action the switches on the basicUI and it should work… I hope…


(Christoph Schwaeppe) #17

Complete mystery! Just in the moment I tried it again just for fun, and it WORKED! :rofl:


(Christoph Schwaeppe) #18

All the time it is a good idea to use more than two eyes. Thank you very much! :slight_smile:


(Christoph Schwaeppe) #19

This is how my log looks now:

==> /var/log/openhab2/openhab.log <==

2018-03-17 01:33:15.176 [INFO ] [se.smarthome.model.script.Power_Plug] - Result:sending code[1364]

==> /var/log/openhab2/events.log <==

2018-03-17 01:33:15.188 [vent.ItemStateChangedEvent] - Remote_Send changed from OFF to ON

2018-03-17 01:33:15.698 [vent.ItemStateChangedEvent] - Remote_Send changed from ON to OFF

2018-03-17 01:33:15.704 [vent.ItemStateChangedEvent] - Remote_Send_Out changed from sending code[1364] to sending code[1361]

2018-03-17 01:33:16.893 [ome.event.ItemCommandEvent] - Item 'Power_Plug_Socket_A' received command OFF

2018-03-17 01:33:16.907 [vent.ItemStateChangedEvent] - Power_Plug_Socket_A changed from ON to OFF

2018-03-17 01:33:16.920 [ome.event.ItemCommandEvent] - Item 'Remote_Send_Args' received command 1364

==> /var/log/openhab2/openhab.log <==

2018-03-17 01:33:16.931 [INFO ] [se.smarthome.model.script.Power_Plug] - Result:sending code[1361]

==> /var/log/openhab2/events.log <==

2018-03-17 01:33:16.945 [vent.ItemStateChangedEvent] - Remote_Send_Args changed from 1361 to 1364

2018-03-17 01:33:16.957 [vent.ItemStateChangedEvent] - Remote_Send changed from OFF to ON

2018-03-17 01:33:17.461 [vent.ItemStateChangedEvent] - Remote_Send changed from ON to OFF

2018-03-17 01:33:17.471 [vent.ItemStateChangedEvent] - Remote_Send_Out changed from sending code[1361] to sending code[1364]

(Josar) #20

Whoa, next time I will copy the whole setting. It look so neat and copy pasted. I never thought of something in this direction. But why is there no warning for unsupported thing type? Or something in this direction?

Nevertheless, I am glad it works for you now.


(Christoph Schwaeppe) #21

The devil is in the detail. :japanese_ogre: