Hello Josar,
thanks for your answer
I did’nt have success with the powerplug access yet.
I added my config and log files.
There are errors.
By changing the sudoers file the system crashed two times.
So I want to fix the errors in config first and then get to the wrong access rights.
-
I dont’t know if the path to the send command is right.
I cant find it in dir opt at my system
-
which user I have to edit in sudoers?
the user on my pi is openhabian.
Should I edit openhab or openhabian?
looking forward hearing from you
Thorsten
meine.items
Switch Power_Plug_Socket_B
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” }
powerplug.rules
rule "Poweroutlet B"
when
Item Power_Plug_Socket_B received command
then
if(receivedCommand == ON){
Remote_Send_Args.sendCommand(“00001 2 1”)
}else{
Remote_Send_Args.sendCommand(“00001 2 0”)
}
// wait for the command to complete
while(Remote_Send.state != ON){
Thread::sleep(500)
}
logInfo(“Power_Plug”, “Results are: \n” + Remote_Send_Out.state)
end
meine.sitemap
sitemap powerplugs label=“Wireless Poweroutlets”
{
Frame label=“Poweroutlets”
{
Switch item=Power_Plug_Socket_B label=“Power Plug B”
}
}
meine.things
Thing exec:command:remote-send [
command=“sudo /opt/raspberry-remote/send %2$s”,
interval=0,
autorun=true,
]
openhab.log
2017-10-05 19:03:46.910 [INFO ] [panel.internal.HABPanelDashboardTile] - Stopped HABPanel
2017-10-05 19:03:46.936 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2017-10-05 19:03:47.025 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2017-10-05 19:03:47.086 [INFO ] [.dashboard.internal.DashboardService] - Stopped dashboard
2017-10-05 19:04:42.698 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'meine.items’
2017-10-05 19:04:42.812 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'powerplugs.items’
2017-10-05 19:04:46.860 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘meine.rules’ has errors, therefore ignoring it: [15,70]: missing ‘)’ at ‘")\r\nend\r\n’
2017-10-05 19:04:48.785 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'powerplugs.rules’
2017-10-05 19:04:51.019 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'powerplugs.sitemap’
2017-10-05 19:04:51.060 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'meine.sitemap’
2017-10-05 19:04:52.052 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'exec.things’
2017-10-05 19:04:52.085 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘meine.things’ has errors, therefore ignoring it: [5,1]: mismatched input ‘]’ expecting RULE_ID
2017-10-05 19:04:53.786 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://192.168.1.81:8080
2017-10-05 19:04:54.006 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://192.168.1.81:8443
2017-10-05 19:04:54.532 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-10-05 19:04:54.606 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-10-05 19:04:54.671 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-10-05 19:05:30.611 [WARN ] [sitemap.internal.SitemapProviderImpl] - Filename meine.sitemap
does not match the name powerplugs
of the sitemap - please fix this as you might see unexpected behavior otherwise.
2017-10-05 19:05:31.248 [WARN ] [sitemap.internal.SitemapProviderImpl] - Filename meine.sitemap
does not match the name powerplugs
of the sitemap - please fix this as you might see unexpected behavior otherwise.
2017-10-05 19:05:34.117 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command ‘00001 2 1’ for item ‘Remote_Send_Args’ to handler for channel ‘exec:command:remote-send:input’, because no thing with the UID ‘exec:command:remote-send’ could be found.
2017-10-05 19:05:34.121 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update ‘00001 2 1’ for item ‘Remote_Send_Args’ to handler for channel ‘exec:command:remote-send:input’, because no thing with the UID ‘exec:command:remote-send’ could be found.
2017-10-05 19:05:34.554 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command ‘00001 2 0’ for item ‘Remote_Send_Args’ to handler for channel ‘exec:command:remote-send:input’, because no thing with the UID ‘exec:command:remote-send’ could be found.
2017-10-05 19:05:34.559 [WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate update ‘00001 2 0’ for item ‘Remote_Send_Args’ to handler for channel ‘exec:command:remote-send:input’, because no thing with the UID ‘exec:command:remote-send’ could be found.
events.log
2017-10-05 19:03:47.369 [temChannelLinkRemovedEvent] - Link ‘Remote_Send_Out => exec:command:remote-send:output’ has been removed.
2017-10-05 19:03:47.371 [temChannelLinkRemovedEvent] - Link ‘Remote_Send_Args => exec:command:remote-send:input’ has been removed.
2017-10-05 19:03:47.373 [temChannelLinkRemovedEvent] - Link ‘Remote_Send => exec:command:remote-send:run’ has been removed.
2017-10-05 19:04:51.732 [ItemChannelLinkAddedEvent ] - Link ‘Remote_Send_Out-exec:command:remote-send:output’ has been added.
2017-10-05 19:04:51.734 [ItemChannelLinkAddedEvent ] - Link ‘Remote_Send_Args-exec:command:remote-send:input’ has been added.
2017-10-05 19:04:51.736 [ItemChannelLinkAddedEvent ] - Link ‘Remote_Send-exec:command:remote-send:run’ has been added.
2017-10-05 19:05:33.792 [ItemCommandEvent ] - Item ‘Power_Plug_Socket_B’ received command ON
2017-10-05 19:05:33.838 [ItemStateChangedEvent ] - Power_Plug_Socket_B changed from NULL to ON
2017-10-05 19:05:34.120 [ItemCommandEvent ] - Item ‘Remote_Send_Args’ received command 00001 2 1
2017-10-05 19:05:34.126 [ItemStateChangedEvent ] - Remote_Send_Args changed from NULL to 00001 2 1
2017-10-05 19:05:34.529 [ItemCommandEvent ] - Item ‘Power_Plug_Socket_B’ received command OFF
2017-10-05 19:05:34.539 [ItemStateChangedEvent ] - Power_Plug_Socket_B changed from ON to OFF
2017-10-05 19:05:34.558 [ItemCommandEvent ] - Item ‘Remote_Send_Args’ received command 00001 2 0
2017-10-05 19:05:34.565 [ItemStateChangedEvent ] - Remote_Send_Args changed from 00001 2 1 to 00001 2 0