# \[Node-RED\] Contact sensor event-state node missing states

**URL:** <https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751>\
**Category:** eWeLink CUBE\
**Created:** [June 24, 2024, 9:23pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751 "2024-06-24T21:23:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [June 24, 2024, 9:23pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/1 "2024-06-24T21:23:52Z")

</div>

I have some contact sensors that used to work great.  
But, for some reason after **eWeLink CUBE 2.0.0** update, all them stopped updating states on **Node RED** , although they work normally on iHost.

[![image](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/4/4572b13f818492b9898d3881afdcf15071086df6.png)](https://private-user-images.githubusercontent.com/6662129/342493360-17752c19-28ea-4557-96d4-e59dc3b5e2b8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyNjQzODksIm5iZiI6MTcxOTI2NDA4OSwicGF0aCI6Ii82NjYyMTI5LzM0MjQ5MzM2MC0xNzc1MmMxOS0yOGVhLTQ1NTctOTZkNC1lNTlkYzNiNWUyYjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjRUMjEyMTI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWE0MDJjNmQ5ZDExOTM4ODA1MWY3Yzg0MDAxYTJkYjRiNTBmNDM3MWJkOTk5YmE1NjRiNDMyYzNmZDRmYTg0YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.NA2a1kiMSZj4YrgMaXcyKi6C6h_C1wL4aRVM7yoPgxM)

I can’t remember what options it had before as _State_, but now it shows only _Battery_ state and I suspect the lack of a “contact” state (opened/closed) causes the component to be useless when used with a contact sensor.

[![image](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/d/d9b3aa7e4319bb4b3ae6a5a0648525ddb43afa17.png)](https://private-user-images.githubusercontent.com/6662129/342494057-d4eeda5f-317c-4ca5-af18-e28294481650.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyNjQzODksIm5iZiI6MTcxOTI2NDA4OSwicGF0aCI6Ii82NjYyMTI5LzM0MjQ5NDA1Ny1kNGVlZGE1Zi0zMTdjLTRjYTUtYWYxOC1lMjgyOTQ0ODE2NTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjRUMjEyMTI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTcxZjI0MmMyZWYyN2IzNmU2OTMxNzI5MTZjY2IyMzA1NzI4MWVkYTUyMjQ4NTY4ZTFkYjE2OWM5ZjYyMjdlZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ewErG3KX_1ORS1HkKG9FBb7CdPoAIhhB0poIz2MiolY)

As a matter of fact, a temperature sensor I have shows all possible states as expected:

[![image](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/6/683d266e657c47afb4bc9f4a8ebac5f091ab547e.png)](https://private-user-images.githubusercontent.com/6662129/342494273-77ffdf76-e159-4ee4-8333-3cdf89394312.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyNjQzODksIm5iZiI6MTcxOTI2NDA4OSwicGF0aCI6Ii82NjYyMTI5LzM0MjQ5NDI3My03N2ZmZGY3Ni1lMTU5LTRlZTQtODMzMy0zY2RmODkzOTQzMTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjRUMjEyMTI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODYxMThlNTk1Nzg0ZDJjNWI2N2U0MzQ3ZDg0ZGVmNjExYmEyMWY1MTRjMDYyYmM3YWFmYTgzYWM3N2NjZGY5YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.RfGT861tTQYEyIFKd--7wqkPsSsshzVsBGj0-JNBVnI)

**node-red-contrib-ewelink-cube version** : 1.2.2  
**eWeLink CUBE version** : 2.0.0  
**Node-RED version** : 3.1.10

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [June 25, 2024, 2:27am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/2 "2024-06-25T02:27:14Z")

</div>

Can you send us your node-red add-on log?  
We’ll look into it ASAP.

---

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [June 25, 2024, 12:16pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/3 "2024-06-25T12:16:01Z")

</div>

Sure. How can I extract it?

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [June 25, 2024, 12:32pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/4 "2024-06-25T12:32:43Z")

</div>

Just download it from here.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/4/437d1f66c732c8803458e44fca0a43189f6d324f.png)

---

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [June 25, 2024, 2:43pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/5 "2024-06-25T14:43:43Z")

</div>

Here it goes.  
I don’t believe the Node-RED docker image has any issue.  
Maybe it’s a **node-red-contrib-ewelink-cube** problem.

[20e396e3-6724-4d33-baf6-af73a99faec3.zip](https://forum.ewelink.cc/uploads/short-url/crcE2a4cDLKGEdgqxp0wkBXbaSu.zip) (5.6 MB)

---

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [June 25, 2024, 7:19pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/6 "2024-06-25T19:19:43Z")

</div>

I’ve also discovered that **Homebridge** with eWeLink CUBE plugin ( **homebridge-plugin-ewelink-cube** ) isn’t receiving contact sensor states either.

It’s log has:

`[6/25/2024, 4:14:07 PM] [homebridge-plugin-ewelink-cube] This plugin generated a warning from the characteristic 'Contact Sensor State': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.`

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [June 26, 2024, 2:05am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/7 "2024-06-26T02:05:29Z")

</div>

What’s the model of your contact sensor?  
We’ll see if is a compatibility issue.

---

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [June 26, 2024, 10:20am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/8 "2024-06-26T10:20:10Z")

</div>

It’s a Aqara Door/Window ZigBee Sensor MCCGQ11LM.

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [June 26, 2024, 11:42am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/9 "2024-06-26T11:42:47Z")

</div>

It’s working fine in iHost, right?  
We’ve checked.  
The result is this device used new capability which is not supported by node-red plugin yet.  
We’ll support it in next version of node-red-contrib-ewelink-cube.

---

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [June 26, 2024, 12:16pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/10 "2024-06-26T12:16:26Z")

</div>

Yes, it works fine on iHost.

It’s no longer working on both homebridge and node-red eWeLink plugins.

**Thank you** for your feedback.

---

<div class="post-metadata">

**Author:** ![ociepa.ekotox](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@ociepa.ekotox](https://forum.ewelink.cc/u/ociepa.ekotox)\
**Post date:** [July 4, 2024, 7:00am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/11 "2024-07-04T07:00:28Z")

</div>

> [@SuiKa](#):
>
> We’ll support it in next version of node-red-contrib-ewelink-cube.

when can we expect an update?

---

<div class="post-metadata">

**Author:** ![rdaraujo](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/rdaraujo/32/2920_2.png) [@rdaraujo](https://forum.ewelink.cc/u/rdaraujo)\
**Post date:** [July 4, 2024, 10:35am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/12 "2024-07-04T10:35:58Z")

</div>

I’m also really interested in this.  
Unfortunately all my contact sensor are useless outside iHost, where all my automations run.

---

<div class="post-metadata">

**Author:** ![ociepa.ekotox](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@ociepa.ekotox](https://forum.ewelink.cc/u/ociepa.ekotox)\
**Post date:** [July 4, 2024, 10:52am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/13 "2024-07-04T10:52:05Z")

</div>

@ward do you have any information about the ihost update and the node-red ewelink cube add-on?

---

<div class="post-metadata">

**Author:** ![ward](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/ward/32/10437_2.png) [@ward](https://forum.ewelink.cc/u/ward)\
**Post date:** [July 5, 2024, 1:54am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/14 "2024-07-05T01:54:44Z")

</div>

iHost generally has monthly updates, while add-ons will depend.

---

<div class="post-metadata">

**Author:** ![tl.box.212](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@tl.box.212](https://forum.ewelink.cc/u/tl.box.212)\
**Post date:** [July 6, 2024, 4:18pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/15 "2024-07-06T16:18:59Z")

</div>

Just to add what I found –

I was starting to do some NR with a couple of spare contact sensors when in the debug noticed that some do not report ‘detect’ – it is not even a capability – but not every sensor suffers the same!

The sensors report correctly in the ihost dashboard.

 ![Screenshot 2024-07-06 165855](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/9/9945d3e04fd38b39de7b77261cb0eb287c9d9cc6.png)

---

<div class="post-metadata">

**Author:** ![ociepa.ekotox](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@ociepa.ekotox](https://forum.ewelink.cc/u/ociepa.ekotox)\
**Post date:** [July 11, 2024, 6:20pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/17 "2024-07-11T18:20:31Z")

</div>

> [@ociepa.ekotox](#):
>
> > [@SuiKa](#):
> >
> > We’ll support it in next version of node-red-contrib-ewelink-cube.
> 
> when can we expect an update?

When can we expect the expansion?

---

<div class="post-metadata">

**Author:** ![ward](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/ward/32/10437_2.png) [@ward](https://forum.ewelink.cc/u/ward)\
**Post date:** [July 12, 2024, 2:45am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/18 "2024-07-12T02:45:24Z")

</div>

@SuiKa Do we have a vague timeline for this? Or it needs more time?

---

<div class="post-metadata">

**Author:** ![SuiKa](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/suika/32/8656_2.png) [@SuiKa](https://forum.ewelink.cc/u/SuiKa)\
**Post date:** [July 12, 2024, 2:54am UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/19 "2024-07-12T02:54:04Z")

</div>

We’ll fix it at the end of next month.

---

<div class="post-metadata">

**Author:** ![wojtek](https://avatars.discourse-cdn.com/v4/letter/w/c77e96/32.png) [@wojtek](https://forum.ewelink.cc/u/wojtek)\
**Post date:** [July 13, 2024, 8:58pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/20 "2024-07-13T20:58:38Z")

</div>

Oh, so these unfortunate people are F-ed for two months, basically. That’s not something responsible business would do.

Out of sheer curiosity then: how can people bring back the old firmware and run it as a temporary solution, till a new firmware is pushed out?

Seriously guys, telling people that their smart home is out of order for 1/6th of a year on top of all problems the CUBE has been giving so far is ludicrous.

Hotfix! Does it ring any bells anywhere…?

Cheers…

---

<div class="post-metadata">

**Author:** ![a.rezaei123](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@a.rezaei123](https://forum.ewelink.cc/u/a.rezaei123)\
**Post date:** [July 17, 2024, 7:55pm UTC](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751/21 "2024-07-17T19:55:29Z")

</div>

iHost API there is no state object for contact Sensor  
/open-api/v1/rest/devices/status

```auto
{
        "serial_number": "***",
        "name": "test",
        "manufacturer": "eWeLink",
        "model": "DS01",
        "firmware_version": "0.5",
        "display_category": "contactSensor",
        "capabilities": [
          {
            "capability": "battery",
            "permission": "read"
          },
          {
            "capability": "rssi",
            "permission": "read"
          }
        ],
        "protocol": "zigbee",
        "app_name": null,
        "state": {
          "battery": {
            "battery": 100,
            "updated_at": 1721225261166
          },
          "rssi": {
            "rssi": -54,
            "updated_at": 1721225261166
          }
        },

```

[Next page](https://forum.ewelink.cc/t/node-red-contact-sensor-event-state-node-missing-states/37751.md?page=2)
