Bug? Usage of sendCommand(...) in Rules

Hi @guessed. Could you please read this message: Rediriger vers Google Groupes
I am not sure but maybe this error is relative to this line in one of my rule that involves the MiOS binding:

SonosSalonTransportState.sendCommand("STOPPED")

I say that because the error appears around the time execution of the rule and the stop action is no more working.

That strange, this rule was working before.

[quote=“lolodomo, post:1, topic:185651”]Hi @guessed. Could you please read this message: Rediriger vers Google Groupes
I am not sure but maybe this error is relative to this line in one of my rule that involves the MiOS binding:

SonosSalonTransportState.sendCommand("STOPPED")

I say that because the error appears around the time execution of the rule and the stop action is no more working.

That strange, this rule was working before.[/quote]

I’ve not seen that before. What happens if you comment out that Rule?

[quote=“guessed, post:2, topic:185651”][quote=“lolodomo, post:1, topic:185651”]Hi @guessed. Could you please read this message: Rediriger vers Google Groupes
I am not sure but maybe this error is relative to this line in one of my rule that involves the MiOS binding:

SonosSalonTransportState.sendCommand("STOPPED")

I say that because the error appears around the time execution of the rule and the stop action is no more working.

That strange, this rule was working before.[/quote]

I’ve not seen that before. What happens if you comment out that Rule?[/quote]

Regarding the error, I only get once today just after saving my rules file.
Regarding the rule that was not doing what I would like, it was due to an error. I was using a test like

if (previousState == "ON")

while I should have used either

if (previousState == ON)

or

if (previousState.toString == "ON")

So you can forget my previous message, sorry for disturbing with that, nothing wrong with your binding.

[quote=“lolodomo, post:3, topic:185651”]Regarding the error, I only get once today just after saving my rules file.
Regarding the rule that was not doing what I would like, it was due to an error. I was using a test like

if (previousState == "ON")

while I should have used either

if (previousState == ON)

or

if (previousState.toString == "ON")

So you can forget my previous message, sorry for disturbing with that, nothing wrong with your binding.[/quote]

No worries, I’d rather people start by assuming my Binding is screwing up, and then working from there. It’s usually easy enough to isolate the problem, at least for the stuff I’ve seen so far.

The Xtend stuff takes a while to get used to, but I love the tricks you can do with iterators and such, but I always get the simple stuff (like your “ON” example when comparing states)

I was looking through this the other day:
Xtend - Modernized Java

and it’s often hard to tell what’s available, and what’s not. The Collections literals only appear to be 1/2 available, for example.

Thought I would add an issue I am having with sending a command via rule. I am issuing the following for a dimmer in my rule:

sendCommand(FF_Kitchen_Island_Light, 50)

I get the following in the log:

2015-02-11 05:06:41.976 [WARN ] [t.i.s.MapTransformationService] - Could not find a mapping for '50' in the file 'miosDimmerCommand.map'.
2015-02-11 05:06:41.980 [INFO ] [runtime.busevents             ] - FF_Kitchen_Island_Light received command 50

My item map for the device:

Dimmer	FF_Kitchen_Island_Light	"Kitchen Island Light [%3d]%"	<slider>	(FF_Kitchen)	{mios="unit:house,device:14/service/Dimming1/LoadLevelStatus,command:MAP(miosDimmerCommand.map)"}

The miosDimmerCommand.map file:

INCREASE=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=?++)
DECREASE=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=?--)
OFF=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=0)
ON=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=100)
_defaultCommand=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=??)

Am I sending the wrong command for the dimmer device or is there an issue with the mios binding somewhere?

  • Garrett

Did it set the light to 50%?

The mechanism I use for transformations is to look for the “exact” value first (to find the mapping) and, if that can’t be found, then I look for a string called “_defaultCommand” and use the pattern attached to fill in the blanks (the ??)

The first call will alway emit an entry into [tt]OH/logs/openhab.log[/tt], but the second entry should be processed normally and should succeed.

If it didn’t, then take a look in Vera’s LuaUPnP.log file, and see what it was sent (just in case)

Guessed, it does still issue the command. I wasn’t sure if it was something to worry about as I watch my logs to make sure all my items and rules are working as they should. I have finally merged my automation to openhab and have cleaned up my vera of all automation and plugins with the exception of a few. So now my vera is just a zwave controller. Just ordered a odroid c1 for testing. May move my openhab instance over to that from my vm. Also want to test vpn performance on it as well.

  • Garrett

ok, good to hear.

I have finally merged my automation to openhab and have cleaned up my vera of all automation and plugins with the exception of a few. So now my vera is just a zwave controller.

It should be fairly stable that way. There are still feature gaps moving into openHAB, from a Bindings standpoint, but they’re coming along (I can’t wait until @watou ports his Nest Binding over)

Just ordered a odroid c1 for testing. May move my openhab instance over to that from my vm. Also want to test vpn performance on it as well.

I swapped out my Samsung EVO MicroSD card for the PNY MicroSD that I had laying around. I can now safely use software reboot on the Odroid C1, and it’s completely stable… not as fast (IO-wise) as the Sammy, but doing well.

What do you need the VPN for? You have one in the Router you’re running, so are you looking for a client?

[quote=“guessed, post:8, topic:185651”]

I have finally merged my automation to openhab and have cleaned up my vera of all automation and plugins with the exception of a few. So now my vera is just a zwave controller.

It should be fairly stable that way. There are still feature gaps moving into openHAB, from a Bindings standpoint, but they’re coming along (I can’t wait until @watou ports his Nest Binding over)[/quote]

To be honest my Vera 3 was already stable. It would go months with out rebooting and my luup engine would not restart for a month or more. I also disabled the mios routing to stop the nightly heals. But it should be even more stable now.

Quote Just ordered a odroid c1 for testing. May move my openhab instance over to that from my vm. Also want to test vpn performance on it as well.

I swapped out my Samsung EVO MicroSD card for the PNY MicroSD that I had laying around. I can now safely use software reboot on the Odroid C1, and it’s completely stable… not as fast (IO-wise) as the Sammy, but doing well.

What do you need the VPN for? You have one in the Router you’re running, so are you looking for a client?

I have a vm configured with chrooted ssh access and openvpn installed. I wanted to move the remote access portion over to hardware in case I have a server failure or loose power I can have something that is low power and access to bring my network back up remotely. There have been times where I needed access to my network and the vm server would be down due to a power failure (ups runs out) or in the event that I need to do remote updates.

I was looking at getting openvpn configured on the edgerouter, but only found kinds for site-to-side openvpn installs. Do you have openvpn configured on the edgerouter? If so, how is performance and recommend any guides? I have heard that the openvpn performance is not the greatest on the edgerouter due to not being hardware accelerated. Right now my openvpn server is configured to push routes to the clients and the clients having access to certain parts of the network on different vlans. The edgerouter is configured with a static route to the vpn subnet.

  • Garrett

Got a chance to configure an openvpn server on the EdgeRouter. It was simpler than I thought to do. I used my vm openvpn config as a baseline and went from there. I ran some iperf tests and received results that I was expecting… Slow performance! : ( Now I remember why I did not go that route in the first place. I am getting around 6 - 10Mbits/s where I max out my download / upload of my internet connection when testing the vpn connection through my vm. I am curious to know how the odroid c1 will perform. I will leave my edgerouter openvpn setup for emergencies.

  • Garrett

I’m using L2TP on the EdgeRouter, mostly so I can use the OOBox configurations for iPad/iPhone & Mac - no extra software required. I also needed this so I can (eventually) setup AutoVPN, so it’ll VPN to my house automatically (as needed) to avoid firing it up before firing up the various apps.

ie. I also don’t use the my.openHAB service and I junked the MiOS Tunnel ~18 months back for the instability it was creating within Vera.