We have moved at community.getvera.com

Author Topic: Problem with rule / action  (Read 2216 times)

Offline cssb25

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Problem with rule / action
« on: December 18, 2015, 08:16:43 pm »
Over the last week or so I started transitioning to openhab from a VeraEdge Z-wave system. Thanks to the help in this forum and especially the Item File Generator provided by "guessed" (many many thanks for that!) I have my system up and running. I use a Pi2 running openhab with the mios binding and the VeraEdge to connect to the z-wave devices.
I do have one major problem which I cannot figure out:
Using an Aeon Gen5 6 in 1 sensor I want to turn on an Aeon switch once motion is detected. I created a simple rule for that.

What is not working:
I cannot get the motion sensor to turn on the switch. And I cannot find out why.

What is working:
1) The motion sensor recognizes motion and reports it to the UI (reports change from "closed" to "open").
2) The rule seems to work as tested with a different trigger device (see below).

This is what I did to test:
-   In the rule, if I replace the Motion Sensor with an Aeon Door sensor everything works (i.e. the switch is turned on when the door sensor trips). i.e. If I replace the item name for the motion sensor in the rule with the item name for the door sensor (copied from the home.items file) it works.
-   As soon as I replace the item name of the door sensor with the item name for the motion sensor it stops to work.
-   As both devices use the same service I thought this is a valid test (as far as I can see motion sensor and door sensor use the same service in the binding (device:xy/service/SecuritySensor1/Tripped), where xy is the ID# of the item).

Does anyone have an idea what I am doing wrong?
« Last Edit: December 18, 2015, 11:06:49 pm by cssb25 »

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Problem with rule / action
« Reply #1 on: December 21, 2015, 10:07:11 am »
Your best bet for this type for scenario is to post the following to https://community.openhab.org :

  • a) A simple problem statement
  • b) The Item definitions for each Item involved.
  • c) The complete Rule definition working/not-working
  • d) A Snippet of your events.log file showing the state changes of the triggering Item (would eventually contain information about the triggered Item)
  • e) Sometimes the snippet from the openhab.log to aid in diag

Use the block markup for any configuration (Items) and log entries (first & last lines have ```)

eg.
Code: [Select]
```
2015-12-21 07:02:01 - NestTStatDownstairs_humidity state updated to 50
2015-12-21 07:02:01 - NestTStatDownstairs_is_using_emergency_heat state updated to OFF
2015-12-21 07:02:01 - NestSmokeGuestBedroom_smoke_alarm_state state updated to ok
2015-12-21 07:02:01 - NestTStatDownstairs_software_version state updated to 5.1.5rc7
2015-12-21 07:02:01 - NestSmokeDownstairs_is_online state updated to ON
2015-12-21 07:02:01 - NestSmokeTopOfStairs_software_version state updated to 2.0rc5
2015-12-21 07:02:01 - NestTStatDownstairs_ambient_temperature_c state updated to 17.0
```

on https://community.openhab.org this results in a syntax highlighted block of text, handy for logs, but essential for Rule snippets.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Problem with rule / action
« Reply #2 on: December 21, 2015, 10:08:00 am »
oh, and tag the post with "mios".  If that doesn't get my attention, you can always @guessed me and I'll get notified.

Offline cssb25

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Problem with rule / action
« Reply #3 on: December 21, 2015, 03:07:42 pm »
Thank you guessed, following your lead I think I found the problem:

In VeraEdge I gave the motion sensor the following device name:
"6in1 11 Motion"

The file generator transformed the item as follows (openhab item definition):

/* Device  39 - 11 6in1 Motion */
Contact  6in111MotionTripped "11 Motion Detected [MAP(en.map):%s]" <contact> (GDevices,GRoom11,GR11V0,GR11V1,GA1) {mios="unit:CSVERA,device:39/service/SecuritySensor1/Tripped"}

However, looking at the events log I see the following line when triggered:

2015-12-21 11:53:05 - in111MotionId state updated to 51

So, the events log shows that the leading digit in the item id is omitted ("in111..." instead of "6in111...")

This leads me to the conclusion that an item definition in openhab has to start with a letter (and not with a number). I have no idea if this is intentional or if it is a bug.
However, the remedy seems to be to rename my items that have a number at the beginning of the name.

Now I need to think through what is the most efficient way for me to change the item names. Something I have to ponder about.


Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Problem with rule / action
« Reply #4 on: December 21, 2015, 03:38:38 pm »
That'd be a bug in my MiOS Item generator code.  It should always build a valid item name and it looks like I doesn't handle the case where the Vera Device label has a leading numeric.

Offline cssb25

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Problem with rule / action
« Reply #5 on: December 21, 2015, 03:50:53 pm »
Thanks!

If I change the item definition in openhab's .items file, should this remedy my problem or would I break something else (i.e. something in the mios binding linking openhab and VeraEdge)?

Appreciate your insight.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Problem with rule / action
« Reply #6 on: December 21, 2015, 03:58:06 pm »
The names I generate are specific to use in openHAB.  You are free to change them to whatever you want - they only impact openHAB rules and sitemaps that are using them

The linkage to Vera is in the binding string at the end, where I use DeviceId and ServiceID strings.  These should not be changed.

PS: best to have these conversations on https://community.openhab.org as it's easier for me to respond there.

Offline cssb25

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Problem with rule / action
« Reply #7 on: December 21, 2015, 04:12:33 pm »
Thank you very much, guessed.

I just want to second another poster here and tell you how much I appreciate the work and help that you (and many others) provide. Your item generator was the single most important factor for me to try out openhab, and I am amazed by the stability and possibilities of this platform.

In the future I will use the openhab community forum if I think I have something to contribute or run into a problem.

Happy Holidays!

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Problem with rule / action
« Reply #8 on: December 21, 2015, 04:33:47 pm »
You're totally welcome!

Hope you have a great holiday also ;)