View single post by wexfordman
 Posted: Friday Jun 22nd, 2018 03:40 pm
 PM  Quote  Reply  Full Topic 
wexfordman

 

Joined: Monday Jan 1st, 2007
Location: Cork, Ireland
Posts: 546
Status: 
Offline

  back to top

steefdebruijn wrote: Create a file cytech.items in folder items with (for example) following input:

Contact MyDoor <frontdoor> {mqtt="<[mqtt:comfort2/input1:state:MAP(openclosed.map)]"}
Contact MyWindow <window> {mqtt="<[mqtt:comfort2/input2:state:MAP(openclosed.map)]"}
Contact MyMoveSensor <selfmotion> {mqtt="<[mqtt:comfort2/input3:state:MAP(openclosed.map)]"}
Contact MyCytechController <network> {mqtt="<[mqtt:comfort2/alarm/online:state:MAP(openclosed.map)]"}
String MyAlarmState <alarm> {mqtt="<[mqtt:comfort2/alarm:state:default]"}


In the above situation I have

    * Frontdoor at input 1
    * A window at input 2
    * Motion sensor at input 3
    * Broker has name mqtt

File `open closed.map` in folder `transform`:
key=value
1=OPEN
0=CLOSED
OPEN=1
CLOSED=0



Thanks Steef, I think I am almost there :-)
So in my openhab logfile, motion is being detected, but there seems to be an issue with the transformation ?  Below is the error message. Now I suspect it may be to do with my broker name, which even though I set it up, I cant remember what the broker name is/was ?  How do I get this info ?
2018-06-22 16:37:50.610 [WARN] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-06-22 16:37:50.616 [WARN] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'MyMoveSensor'
[code]Sorted :-)
Had to add the mqtt transformation service, and my mqtt broker name is broker ?

Last edited on Friday Jun 22nd, 2018 03:58 pm by wexfordman

 Close Window