X-Sense Security - is it possible to create an integration?

I think it should be a single integration (you only have to login once), but it is a completely seperate thing that works differently.
I think it is best to finish the first part before moving on to the camera’s.

I haven’t seen the actual stream yet. Saw a websocket connection, but didn’t look at the contents. I can share the file with you, but you still have to use mitmproxy to open it.

Ok, i will try it. If you like, i can buy a XS01-WX for testing. After some days, I can send it back to amz.

Hi

What do you see for smoke detectors? I have “only” Battery state from them.

Yes, only battery

1 Like

I ordered One

cool! Curious how that wil work

made some progress, I’ve added some simple error handling. When a session is no longer valid, the component tries to login again. If that fails, the reconfigure-flow is used to ask for new credentials.

If a device goes offline, it should now be visible. However, the detection in XSense seems to be very slow.

I also added several entities to the devices:

Currently not happy with the naming of the entities, I still have to figure that out.

Still have to finalize a lot, but I will try to release it in the next few days.

It is still far from ready, but there is progress.

2 Likes

I need the real devices names, like SBS50 for the HACS readme

What I have at the moment:
SBS50 - basestation
XH02-M - Heat Alarm
XC01-M - Carbon Monoxide Alarm
XS01-M - Smoke Detector
SWS51 - Water leak detector
STH51 - Hygrometer-Thermometer

includet the devices

i added the icon to Jarnsen patch 1 by Jarnsen · Pull Request #5400 · home-assistant/brands · GitHub i hope it will work. it must be integrated in the manifest.json

1 Like

now it should be ok for icon an logo, one las review is needed

I spent a lot of time last week, but we are getting there with a functional first version. I’m slowly starting to understand how to build an integration.
The only major issue remaining is that we don’t yet have a way to trigger the system to update automatically. However, since someone has already set up the MQTT, it should be possible to add this feature later.

I’ll test and finalize it in the next few days and plan to push it early next week.

I had an epiphany yesterday. What if we use the system as intended? I’ll check if the base station reports anything if one of the devices is throwing an alarm.

EDIT: I think I’ve found a way to get a status update from a device.
I set a temperature alarm, put it up above an oven, and saw that it had thrown a warning in the app. I then closed the app and started a looped Python script to monitor the device’s temperature and its alarm status.

After four minutes, the device stopped updating its temperature, with the alarm still on. I gave it a couple more minutes to be sure. Then, I’ve put it in the fridge. Viola! Once the device cooled down back into the allowed temperature range, it had updated its temperature reading.

Pic shows current temp and if the alarm is triggered


What I am getting to is that if all you need from the device is to get a reading if it’s too cold/hot, and the most recent temp reading, then it’s okay to use the alarm functionality. The device overcomes its battery saving throttle/logout if it needs to throw an alarm.

Note this method only works with the temp sensor.

2 Likes

Once again, you are the hero Gotham needs!

UPDATE: I GOT IT WORKING AFTER THE UPDATE THROUGH HACS. I’M KEEPING THIS POST HERE IN CASE IT’S SOMEHOW HELPFUL(??)

I still can’t get this working.

So I deleted my install in custom_components and reinstalled manually by downloading the github files and adding the version to manifest.json.

The result was that it “failed setup, will retry” – it appears to keep retrying. I turned on logging, log says:

```
Logger: py.warnings
Source: custom_components/xsense/coordinator.py:113
integration: X-Sense Home Security
First occurred: 9:46:11 AM (1 occurrences)
Last logged: 9:46:11 AM

/usr/local/lib/python3.12/site-packages/xsense/async_xsense.py:161: RuntimeWarning: coroutine ‘ClientResponse.text’ was never awaited raise APIFailure(f’Unable to retrieve station data: {self._lastres.status}/{self._lastres.text()}’
```

I then deleted it once again, reinstalled via the HACS instructions here
GitHub - Elwinmage/ha-xsense-component: Home assistant component for X-sense devices

Same result.

The account I created works fine in the app, sees all my smoke detectors and such. I’m using the same ones mentioned in this thread pretty much.

Thanks again for your hard work!

Hi guys, is there a way to communicate with the gateway directly. So without going via the AWS cloud?

I’ve portscanned the device but it doesn’t seem to listen on any port, so I don’t think it is possible.

A possibility would be to flash the device with esp-home, but that would be a lot of work.

its working, i did some changes with Thero. He did. the work and i does it in the repo. But i did a fork of Elwinmages repo, Its a Little Bit easier for me, and his repo is a Backup. Today now Its Version 1.0.0 out. I installed i many times with HACS it is working, also Elwinmages repo. Its only allowed to have supported devices, you Must have 2 acc for xsense, one Main for the mobile and one for Home Assistant.

Yeah. Because I guess they encrypt the Lora packages… So without the key it’s useless…

First of all, i highly appreciate all your guys work here. I have the cpl. package of x-sense devices including the cam mentioned above. It would be perfect for me to have this integration.

Hi @Jarnsen ,
i followed the HACS integration and was succesfull to integrate my account (2nd acc…) but it cannot integrate any device. Failure is “as never awaited raise APIFailure(f’Unable to retrieve station data:404” The app recognizes my login with HA in the App (same time).

Any idea what i can do to fix it? Is there another prerequisite other than HACS ? With todays update i hoped to fix it, but no difference…
Thank you !