TS0203 Sensor phoscon don’t send state to HA

Hello,
I have a problem with my TS0203 door sensor.
Before, all was ok, but recently, i have noticed that phoscon doesn’t send state to HA.
All is ok in phoscon app, when i open, the state is on, when i close, the state is off immediately.
I also have lights that work good in HA.
It is like phoscon won’t communicate whit HA.
Sometimes, when i refresh deconz and open a door, that work on time, and stop after.
Have you an idea ?
Ps : im french sorry for my bad english.

Phoscon uses the rest api, and so does Home assistant.

If it does trigger in phoscon and not in home assistant, it’s an issue in home assistant.

1 Like

I’ve posted an issue on HA and the support tell me the problem is on deconz side :frowning:

Where should i do investigate ?

Phoscon is just a third app like HA, It never communicate with HA.

But I m not sure to understand :
It’s working in phoscon and not HA, or not working on both ?

Both are using the API on same way, but they have their own websocket connexion (one by third app)

It seem you probably have a problem with websocket connexion

21:18:32:175 Websocket disconnected 172.30.32.1:53774, state: 0, close-code: 1000, reason:

1000 indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled. 1001 indicates that an endpoint is “going away”, such as a server going down or a browser having navigated away from a page.

@Kane610 the user mentions that it works in phoscon but not home assistant right? Might be something up with his connection?

@Kane610 haven’t say its deconz side, he have just asked HA logs, saying he can’t so something with deconz log.

Little mistake ^^

I m french too, I can help on discord, but I realy have no clue how working the network on HA (if it’s a websocket issue)

But @groovy-ka if you can confirm it’s working only on phoscon (and not deconz) and not HA, or not working on both ?

Aah. Fair enough.

But now after reflexion, if he have websocket issue, strange he have issue only on 1 device …

I think HA logs can be usefull (if the device work correcly on phoscon) to check websocket return.

Edit:

So i have confirmation on the HA github

work only in phoscon, status is not updated in HA

Smanar, ok little confusion :slight_smile: I understand right now the problem was the bad log info
I have put the right log info right now

J’ai du mal avec l’anglais :slight_smile:

Don’t worry, I m on discord too if you have problem with english, but for the moment I realy can’t help you for your issue.

Ok. I have new information right now.
In HA, sometimes when I refresh deconz integration, the first event (open door) is detected. It’s like deconz stop emit event. So the communication seems to be ok.

When i go into deconz add-on, in log API info > event, i see one event at first time and no more :

                {
"22:24:03:84": {
    "attr": {
        "id": "4",
        "lastannounced": null,
        "lastseen": "2022-10-10T20:24Z",
        "manufacturername": "_TZ3000_oxslv1c9",
        "modelid": "TS0203",
        "name": "Fenêtre salon gauche",
        "swversion": null,
        "type": "ZHAOpenClose",
        "uniqueid": "a4:c1:38:8e:20:9a:6a:ef-01-0500"
    },
    "e": "changed",
    "id": "4",
    "r": "sensors",
    "t": "event",
    "uniqueid": "a4:c1:38:8e:20:9a:6a:ef-01-0500"
}
}

Does it change in phoscon?

According to the provided logs there are no state changes reported for the sensor over web socket

Ah, yes, in phoscon, it’ok, sorry.
It seem to be a deconz issue ?

In phoscon it’s okay, the users says.

Not sure what’s going on in that case.

lol funny, I can understand why it don’t work on HA, but not how it can work on phoscon …

There is notification, but with nothing inside.

    "attr": {
        "id": "4",
        "lastannounced": null,
        "lastseen": "2022-10-10T20:24Z",
        "manufacturername": "_TZ3000_oxslv1c9",
        "modelid": "TS0203",
        "name": "Fenêtre salon gauche",
        "swversion": null,
        "type": "ZHAOpenClose",
        "uniqueid": "a4:c1:38:8e:20:9a:6a:ef-01-0500"
    },
    "e": "changed",
    "id": "4",
    "r": "sensors",
    "t": "event",
    "uniqueid": "a4:c1:38:8e:20:9a:6a:ef-01-0500"
}

I just have 2 questions

I confirm that only my door sensor (i have 6) doesn’t update in HA

All are same device ? if yes just re-include the device

else can you take a look in the device json using phoscon / help / API Information / sensors / 4

If the field “state/open” is not missing ?

You have the same websocket when opening and closing ? never a “state” field in the json ? Only “attr” ?

Edit:
There is a problem too, this device is in 2 DDF.

That’s an attribute event, they don’t report state afaik

So can be a setting issue (enrollement/bind), that can be solved by re-inclusing the device.
But how this device is working in phoscon ?

All are same device ? if yes just re-include the device

I confirm that all my 6 sensors are the same.

if yes just re-include the device

I have deleted one and pair again, same problem.

I also confirm that in Phoscon, the state correctly update.

can you take a look in the device json using phoscon / help / API Information / sensors / 4
If the field “state/open” is not missing ?

Yes, is missing (and the event is triggered quite randomly but I imagine that is not the problem here)
How to add the state in websocket event ?

Ha ?
So you have not state/open in the device json ? What do you have instead ?
Can you copy paste the json ?

And you have the issue only on one of the 6 devices ?

BTW have you access to the GUI ? to check what is the difference with this device and the working one ?

But using a DDF, the device is not reconised or is using all the field in the DDF, how you can miss one.

If you have access to the GUI, make a right clic “edit DDF” then on the editor menu “hot reload” and check logs with “DDF” flags.