Really got few issue or connect need you to clarify me

HI, I have been using OH2 for a while (around 4 weeks), it works awesome as it link up all difference brand hardware works together I believe I have been get no issue on MQTT and few 2.00 binding build support hardware, it makes setup real quick and easy,
and I got stuck with rules, persistence especially I don’t have clear concept on exec,If I am not getting wrong, when binding turns to 2.0 means runs in OH2 way,
after I dig a long while at here. I sucessfully get exec works in two way, one in rules and or one in OH2 way items <> things <> site map, I choice to run in new way, have been sucessfully get out bound to the device take order, but I still not able to get it works at in bound (retrieve info), I saw after forum looks all go to rules, how should I work with it? (or suggest)

second, the console keep time out when no response with limit time, how can I modify it to make it won’t disconnect me?

I always get some strange Warn when I start using,
00:32:36.791 [WARN ] [e.sshd.server.channel.ChannelSession] - Unknown pty opcode value: 42
how to trace it?
sometimes I got error looks relate to home kit
19:45:50.336 [ERROR] [lfe.hap.impl.http.impl.BinaryHandler] - Exception in binary handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)[:1.8.0_121]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)[:1.8.0_121]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)[:1.8.0_121]
at sun.nio.ch.IOUtil.read(IOUtil.java:192)[:1.8.0_121]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)[:1.8.0_121]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447)[190:org.openhab.io.homekit:2.0.0]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:880)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)[190:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)[190:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[190:org.openhab.io.homekit:2.0.0]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
19:45:50.351 [ERROR] [.hap.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)[:1.8.0_121]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)[:1.8.0_121]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)[:1.8.0_121]
at sun.nio.ch.IOUtil.read(IOUtil.java:192)[:1.8.0_121]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)[:1.8.0_121]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447)[190:org.openhab.io.homekit:2.0.0]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:880)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)[190:org.openhab.io.homekit:2.0.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)[190:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)[190:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[190:org.openhab.io.homekit:2.0.0]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

Third) I need to run a python script when openhabian start up, as it can’t run duplicate, and rc.local is not a choice as itside said every ssh login will run this once, so where should I active the script when system startup? and were should I add line to kill this process when shut down?

Final, I need a script but as I don’t know nothing about writing any language,
I try goolge around and modify as good as I can but it still not work
Please give a hand, once I change the value in UI, with number 10-99 is fine, but issue come to 0-9, as I need number to be two digits eg: 01-09

rule "Sharp Volume value correction"
when
Item SharpTVVolume changed
then
if (SharpTVVolume.state < 10) {

		var Number T = SharpTVVolume.state as DecimalType	

		String.format("%02d",T)

    }
		postUpdate(SharpTVVolume, T)

end

please help me and opeimize it, I got many more to ask but I need to sleep now, so please take a look and help me out.

thanks and regards.

If SharpTVVolume is a Number item, then posting a formatted string to it will result in that being converted back to a number…
If you do need to have a string, then you could create another string item to hold the formatted value.

I guess I require a expert to write out the proper script or a proper way how to achive what I want
I don’t know how to write language, I just google many days and try mix and match others rules

Hi

If you want to use feedback from an command you executed via execCommandline, you can define a variable in the same line as your command (inside your rule of course):

var String speedtestCliOutput = executeCommandLine("speedtest-cli --simple", 120*1000)

Then the variable speedtestCliOutput contains the output of the speedtest-cli command (inbound as you call it).

I do as you said and it works. great thx :smile:
excuse me, do you mind teach me what does 120*1000 means? time out?

Thanks and Regards
Ham

I removed this command from .things and run command in rules.
I don’t know is this is the propper method, but I don’t get any other way to get it works.
I changed as below

rule "Volume control"
when
Item SharpTVVolume received command
then
if (SharpTVVolume.state < 10) {executeCommandLine(“sharptv.sh VOLM000” + SharpTVVolume.state)}
executeCommandLine(“sharptv.sh VOLM00” + SharpTVVolume.state)
end

I really wish someone can answer me, in things, I can use %2$s to get the state value, why it won’t work when I change to %2$02d?

Hi Ham,

I understand from other posts that there is a need for a time-out otherwise the command does not execute properly, the value is in milliseconds. So in this case it would be two minutes, what I see most people use is 5000 or 10000 milliseconds.

thx: smiley: