thkl / homebridge-homematic

Homematic plugin for homebridge: https://github.com/nfarina/homebridge
180 stars 51 forks source link

Request for Support: Garage Door #659

Open bgewehr opened 3 years ago

bgewehr commented 3 years ago

I am using a HM-LC-Sw2-FM to trigger a HÖRMANN 230V sender, needing a 1s pulse to do it right. While the HÖRMANN sender sends, the HM device can not receive another command and stays on. The Garage motor accepts signals up to 2-3s, after that it stops. That`s why I can not make use of the "send off Xs after on", I need "switch on for 1s".

I have mounted a HM-SwI-3-FM on the garage door with three mercury switches in different angles to sense the angle of the garage door. They send short signals "press" when one of those switches close or open, but do not have a permanent state available.

Now I need help on how to set htis up in the homematic-config.json.

a) How to send a 1s pulse to my switch from Homekit? b) I could use a system variable "doorstate" to persist the state of the door - but how to request that in the json correctly?

If there is a better place to ask, please tell... THX!

bgewehr commented 3 years ago

Found my way for a) by taking a virtual switch, hooking a program on press_short that sets the switch to on for a second while making sure it was off before.

image

bgewehr commented 3 years ago

For b) I am still not sure what to do.

{
  "enable_hmip": true,
  "enable_wired": false,
  "ios10": true,
  "special": [
                {
                    "name": "Garage",
                    "type": "HM-THKL-GARAGEDOOR",
                    "parameter": {
                        "address_sensor_close": "BidCos-RF.BidCoS-RF:1.Garage_State",
                        "address_sensor_open": "BidCos-RF.BidCoS-RF:1.Garage_State",
                        "state_sensor_close": "0",
                        "state_sensor_open": "100",
                        "address_actor_open": "BidCos-RF.BidCoS-RF:1.PRESS_SHORT",
                        "address_actor_close": "BidCos-RF.BidCoS-RF:1.PRESS_SHORT",
                        "message_actor_open": {
                            "on": true,
                            "off": false
                        },
                        "message_actor_close": {
                            "on": true,
                            "off": false
                        },
                        "delay_actor_open": 0,
                        "delay_actor_close": 0
                    }
                }
            ],
            "services": [
                {
                    "type": "HM-THKL-GARAGEDOOR",
                    "service": "HomeMaticHomeKitGarageDoorService"
                }
            ]
}

The doorstate result is placed into system variable Garage_State which is added to the virtual switch as well. Picked a name that makes thm all look the same although no knowing if this is helpful or not:

<channel name="HM-RCV-50 BidCoS-RF:1" ise_id="1037" index="1" visible="true" operate="true">
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_LONG" type="PRESS_LONG" ise_id="1039" value="false" valuetype="2" valueunit="" timestamp="1613906332" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_SHORT" type="PRESS_SHORT" ise_id="1040" value="false" valuetype="2" valueunit="" timestamp="1613926669" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.LEVEL" type="LEVEL" ise_id="1038" value="" valuetype="6" valueunit="100%" timestamp="0" operations="2"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.Garage_State" type="Garage_State" ise_id="3991" value="100.000000" valuetype="4" valueunit="" timestamp="1613926851" operations="7"/>
</channel>

But the state wheel keeps turning and no state is ever reached. So I guess my addresses are wrong.

bgewehr commented 3 years ago

Ich lese immer 0 (Tor zu), nie 100 (Tor offen)

[2/21/2021, 7:38:48 PM] [HomeMatic CCU] [GDS] One sensor mode. Fetching value for Close Sensor BidCos-RF.BidCoS-RF:1.Garage_State
[2/21/2021, 7:38:48 PM] [HomeMatic CCU] [GDS] get close value result is 0.000000
[2/21/2021, 7:38:48 PM] [HomeMatic CCU] [GDS] values match close state
BerndGewehr commented 3 years ago

Interesting fact:

If i name my system variable like "Garage_State", I receive values on null

<channel name="HM-RCV-50 BidCoS-RF:1" ise_id="1037" index="1" visible="true" operate="true">
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_LONG" type="PRESS_LONG" ise_id="1039" value="false" valuetype="2" valueunit="" timestamp="1613906332" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_SHORT" type="PRESS_SHORT" ise_id="1040" value="false" valuetype="2" valueunit="" timestamp="1613932620" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.LEVEL" type="LEVEL" ise_id="1038" value="" valuetype="6" valueunit="100%" timestamp="0" operations="2"/>
<datapoint name="Garage_State" type="" ise_id="3991" value="50.000000" valuetype="4" valueunit="" timestamp="1614019665" operations="7"/>
</channel>

[2/22/2021, 7:48:55 PM] [HomeMatic CCU] [GDS] garage event CH:BidCos-RF.BidCoS-RF:1|DP:Garage_State|NV:|TCS:false

while when I name it like "BidCos-RF.BidCoS-RF:1.Garage_State", I receive constantly 0.00000 (initial value of variable on start of homebridge)

<channel name="HM-RCV-50 BidCoS-RF:1" ise_id="1037" index="1" visible="true" operate="true">
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_LONG" type="PRESS_LONG" ise_id="1039" value="false" valuetype="2" valueunit="" timestamp="1613906332" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_SHORT" type="PRESS_SHORT" ise_id="1040" value="false" valuetype="2" valueunit="" timestamp="1614020015" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.LEVEL" type="LEVEL" ise_id="1038" value="" valuetype="6" valueunit="100%" timestamp="0" operations="2"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.Garage_State" type="Garage_State" ise_id="3991" value="0.000000" valuetype="4" valueunit="" timestamp="1614020035" operations="7"/>
</channel>

[2/22/2021, 7:44:52 PM] [HomeMatic CCU] [GDS] garage event CH:BidCos-RF.BidCoS-RF:1|DP:Garage_State|NV:0.000000|TCS:false

But in this state of the name, when my variable has a value like 50.00000 on homebridge start, it is recognized correctly (but never changed again, although the values of the variables change)

<channel name="HM-RCV-50 BidCoS-RF:1" ise_id="1037" index="1" visible="true" operate="true">
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_LONG" type="PRESS_LONG" ise_id="1039" value="false" valuetype="2" valueunit="" timestamp="1613906332" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.PRESS_SHORT" type="PRESS_SHORT" ise_id="1040" value="false" valuetype="2" valueunit="" timestamp="1614020015" operations="6"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.LEVEL" type="LEVEL" ise_id="1038" value="" valuetype="6" valueunit="100%" timestamp="0" operations="2"/>
<datapoint name="BidCos-RF.BidCoS-RF:1.Garage_State" type="Garage_State" ise_id="3991" value="50.000000" valuetype="4" valueunit="" timestamp="1614020334" operations="7"/>
</channel>

[2/22/2021, 7:53:34 PM] [HomeMatic CCU] [GDS] garage event CH:BidCos-RF.BidCoS-RF:1|DP:Garage_State|NV:50.000000|TCS:false

BerndGewehr commented 3 years ago

All in all, I need your help, @tkoenig How to address a system variable for the doorstate correctly?

bgewehr commented 3 years ago

Also creating a (virtual) CuXD switch that keeps the state dows not help, doesn't get refreshed somehow:

[2/23/2021, 9:17:22 PM] [HomeMatic CCU] [GDS] garage event CH:CUxD.CUX4010001:1|DP:STATE|NV:true|TCS:false

Stays always true from cache, never changes...

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.