eWeLink CUBE to Home Assistant via Node-RED

How to extend the SNZB-04P from eWeLink CUBE to Home Assistant via Node-RED ?

I believe you would have to create a sensor via the HA API node.
However, it would be easier to send via some integration.

But as you are already using node-red it would be better to use it to talk to both of you. instead of sending the sensor to HA. you should create the automations in the red node.
There would be no reason why export the sensor to the HA.

Because the red node talking to HA and iHost you would have access to everything that is connected on both platforms.

I have no choice, because the SNZB-04P does not work in the home bridge. From home bridge, I can extend it into HA, but it doesn’t work. Therefore, I am looking for options on how to implement it correctly.

Matter Bridge would work, but you didn’t mention which installation type of your HA; Supervised and HAOS would do the job.

Also a fix for HomeBridge will land by the end of this month.

In Node Red SNZB04P don’t have state “Contact (binary)”, only battery, rssi and tamper alert. What should I do?
snzb04p-node-red

Please upgrade your node-red-contrib-ewelink-cube to version 1.2.4.
Then you should be able to receive the state in event-state node with “All” option selected.

It’s a temporary workaround.

version 1.2.4 installed
1.2.4

only node (event - state) works

i’am talking about SNZB04P, in node red, it has only 3 statuses - rssi, battery, tamper alert and doesn’t have - detect state

I did the test. I removed the sensor and added it to ihost again. in node-red the status is displayed. what version of snzb-04P do you have (mine is v2.2.0)

Can you tell me how to make a virtual door sensor correctly? I want to make a virtual sensor with a status that can be turned on or off. And take the state from the real SNZB 04P sensor. I don’t understand how to implement it yet. All this is to throw at homebridge.

UPD
It seems to have been done (attached a screenshot). But I don’t know if it’s right. The state is transmitted and the virtual door changes state, although without a battery.

Could you pass on the node configuration?
So I can help?

image
An example here would be getting the information about the on or off status!

Captura de tela 2024-08-06 192344

I don’t see the point in using Json and the status change node.

Since I believe you are using the ALL status.

Everything works like a switch. Extend to Homebridge. When opening the door, the switch is on, when closing the switch is off.
Here is the code from top to bottom if you look at my previous screenshot:

register-device-Virtual door:
Category -Switch


set flow.door-state:
msg.payload.payload.contact.contact


switch:
Property - flow.door-state

  1. is true
  2. is false

switch (is true) Virtual door - on
switch (is false) Virtual door - off


set flow.door-state:
msg.payload.payload.power.powerState