Giter Club home page Giter Club logo

Comments (7)

justme-1968 avatar justme-1968 commented on June 24, 2024

yes. you can use all types from HomeKitTypes.js directly.

in your case this would be SecuritySystem (no space) for the service type. this has to go to genericDeviceType.

for the setList in fhem you can use whatever you want and makes sense in the fhem ui as you have to provide a mapping from the fhem values to the homekit values anyway. in values you can (and should) use the defined terms from HomeKitTypes.js as the target. for example for the current state would look something like this:

setList state:stay,away,night,...
homebridgeMapping SecuritySystemCurrentState=state,values=stay:STAY_ARM;away:AWAY_ARM;...

for SecuritySystemTargetState you have to provide the values mapping and also the reverse mapping from the homekit values to the fhem values with the cmds mapping.

important: spaces are a source of problems. try to avoid them.

from homebridge-fhem.

tobiasmuecksch avatar tobiasmuecksch commented on June 24, 2024

Thank you very much!

I tried the solution you provided. But it doesn't work yet.

I've set the state to "DISARMED" manually in fhem. But in the home app it is shown in the stay_armed state. When I change the state in the app, a spinner as shown and nothing happens.

The console outputs this error:

ALRM_SYSTEM-state value DISARMED not handled in values

This is my device:

{ 
  "Arg":"ALRM_SYSTEM", 
  "Results": [ 
  { 
    "Name":"ALRM_SYSTEM", 
    "PossibleSets":"setList state:STAY_ARM,AWAY_ARM,NIGHT_ARM,DISARMED,ALARM_TRIGGERED", 
    "PossibleAttrs":"alias comment:textField-long eventMap group room suppressReading userReadings:textField-long verbose:0,1,2,3,4,5 readingList setList useSetExtensions event-on-change-reading event-on-update-reading event-aggregator event-min-interval stateFormat:textField-long timestamp-on-change-reading alarmDevice:Actor,Sensor alarmSettings cmdIcon devStateIcon devStateStyle genericDeviceType:ignore,switch,outlet,light,blind,thermometer,thermostat,garage,window,lock homebridgeMapping:textField-long icon sortby webCmd widgetOverride userattr", 
    "Internals": { 
      "CFGFN": "", 
      "NAME": "ALRM_SYSTEM", 
      "NR": "101", 
      "STATE": "DISARMED", 
      "TYPE": "dummy" 
    }, 
    "Readings": {      "state": { "Value":"DISARMED", "Time":"2016-10-04 11:23:11" }    }, 
    "Attributes": { 
      "genericDeviceType": "SecuritySystem", 
      "homebridgeMapping": "SecuritySystemCurrentState=state,values= STAY_ARM:STAY_ARM; AWAY_ARM:AWAY_ARM;NIGHT_ARM:NIGHT_ARM;DISARMED:DISARMED;ALARM_TRIGGERED:ALARM_TRIGGERED", 
      "room": "Alarm", 
      "setList": "setList state:STAY_ARM,AWAY_ARM,NIGHT_ARM,DISARMED,ALARM_TRIGGERED" 
    } 
  }  ], 
  "totalResultsReturned":1 
} 

from homebridge-fhem.

justme-1968 avatar justme-1968 commented on June 24, 2024

i see lots of spaces in the homebridgeMapping :)

from homebridge-fhem.

tobiasmuecksch avatar tobiasmuecksch commented on June 24, 2024

@justme-1968 Shoot. You're right.

I fixed it. Now the disarmed state is shown correctly but when I change the state it still shows the spinner and does nothing...

But this time there is no error on the console :(

{ 
  "Arg":"ALRM_SYSTEM", 
  "Results": [ 
  { 
    "Name":"ALRM_SYSTEM", 
    "PossibleSets":"setList state:STAY_ARM,AWAY_ARM,NIGHT_ARM,DISARMED,ALARM_TRIGGERED", 
    "PossibleAttrs":"alias comment:textField-long eventMap group room suppressReading userReadings:textField-long verbose:0,1,2,3,4,5 readingList setList useSetExtensions event-on-change-reading event-on-update-reading event-aggregator event-min-interval stateFormat:textField-long timestamp-on-change-reading alarmDevice:Actor,Sensor alarmSettings cmdIcon devStateIcon devStateStyle genericDeviceType:ignore,switch,outlet,light,blind,thermometer,thermostat,garage,window,lock homebridgeMapping:textField-long icon sortby webCmd widgetOverride userattr", 
    "Internals": { 
      "NAME": "ALRM_SYSTEM", 
      "NR": "66", 
      "STATE": "DISARMED", 
      "TYPE": "dummy" 
    }, 
    "Readings": {      "state": { "Value":"DISARMED", "Time":"2016-10-04 11:23:11" }    }, 
    "Attributes": { 
      "genericDeviceType": "SecuritySystem", 
      "homebridgeMapping": "SecuritySystemCurrentState=state,values=STAY_ARM:STAY_ARM;AWAY_ARM:AWAY_ARM;NIGHT_ARM:NIGHT_ARM;DISARMED:DISARMED;ALARM_TRIGGERED:ALARM_TRIGGERED", 
      "room": "Alarm", 
      "setList": "setList state:STAY_ARM,AWAY_ARM,NIGHT_ARM,DISARMED,ALARM_TRIGGERED" 
    } 
  }  ], 
  "totalResultsReturned":1 
} 

from homebridge-fhem.

justme-1968 avatar justme-1968 commented on June 24, 2024

as i said: you also have to map the SecuritySystemTargetState with reading, values and cmds.

some service classes use the same characteristic for both directions, others (mainly the multivalued) use two characteristics and you have to configure both.

from homebridge-fhem.

tobiasmuecksch avatar tobiasmuecksch commented on June 24, 2024

Sorry so much, I over read that!

from homebridge-fhem.

tobiasmuecksch avatar tobiasmuecksch commented on June 24, 2024

It worked! Thank you very much for being so patient with me!

For any other people struggling with this in the future.
This is my solution:

SecuritySystemCurrentState=state,values=STAY_ARM:STAY_ARM;AWAY_ARM:AWAY_ARM;NIGHT_ARM:NIGHT_ARM;DISARMED:DISARMED;ALARM_TRIGGERED:ALARM_TRIGGERED SecuritySystemTargetState=state,cmds=0:STAY_ARM;1:AWAY_ARM;2:NIGHT_ARM;3:DISARMED;4:ALARM_TRIGGERED,values=STAY_ARM:0;AWAY_ARM:1;NIGHT_ARM:2;DISARMED:3;ALARM_TRIGGERED:4

(attribute homebridgeMapping)

from homebridge-fhem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.