Page 1 of 2

PIR using Si-Way not work in Home Assistant

Posted: Tue 16 Mar 2021, 23:47
by doz&doe
Hi,

I have a problem getting my PIR's to work in Home Assistant.

It shows up as an entity and I can see them in logg. But there is no action. Seem there is no data from them. Only get the value "false".

Have PIR on some cameras, that works ok.

It seems that I get data from the PIR when looking in the loggs. They do what supposed to as PIR in the alarm system :)

{"status":"success","data":{"systemlog":{"event":[{"time":"1615931403","raw":"0010000100000000","text":"Zone 16 IR-Kitchen Closed"},{"time":"1615932196","raw":"0010000200000000","text":"Zone 16 IR-Kitchen Open"},{"time":"1615932196","raw":"0010000100000000","text":"Zone 16 IR-Kitchen Closed"},{"time":"1615934291","raw":"0010000200000000","text":"Zone 16 IR-Kitchen Open"},{"time":"1615934291","raw":"0010000100000000","text":"Zone 16 IR-Kitchen Closed"},{"time":"1615934366","raw":"0C000F2700000000","text":"WWW LOGIN OK, User 9999 Engineer"},{"time":"1615934842","raw":"0010000200000000","text":"Zone 16 IR-Kitchen Open"},{"time":"1615934842","raw":"0010000100000000","text":"Zone 16 IR-Kitchen Closed"}]}}}



Running latest version of HA and SPC4300 | ver. 3.11.1 | R.38577



Thanks
/Christian

Re: PIR not work in Home Assistant

Posted: Tue 16 Mar 2021, 23:56
by gol
Hi Christian,
Just to be sure, you are aware that as long you are logged in as Full Engineer no events are sent from the Panel to the SPC Web Gateway.

Check also your event profile settings. You can also run the gateway with the -d option to log the communication with the Panel to the terminal. Please see the manual.

Regards,
Goran

Re: PIR not work in Home Assistant

Posted: Wed 17 Mar 2021, 00:13
by doz&doe
Hi Göran,

Thanks for quick answer!!

Normaly not logged in as engineer, but was not aware of that.

The log seems to tell me that there is some data from the PIR, is that correct? Does the "systemlog" shows what data that are send via the web gateway or "only" read log from panel?

I will check the other things you mentioned tomorrow, get back after that with status..

Thanks again
/Christian

Re: PIR not work in Home Assistant

Posted: Wed 24 Mar 2021, 21:21
by doz&doe
Hi Göran,

Regarding Event Profiles is it some specific that are used, or does it use all profiles. I can see that the one called "Default Events [SPC Connect]" not have "Sektionstatusändring" activated. I think that setting could show PIR info Open or Close?
I could add one more profile to activate that setting, but not sure if SPC Web Gateway read that.

Kind Reagrds
/Christian

Re: PIR not work in Home Assistant

Posted: Wed 24 Mar 2021, 21:44
by gol
Which events are sent to SPC Web Gateway depends only on the Filter settings in the EDP configuration. Zone State need to be selected to get events from your detectors.

Re: PIR not work in Home Assistant

Posted: Wed 24 Mar 2021, 22:10
by doz&doe
OK,

Well for EDP all boxes are checked and all Zones are activated.

In the SystemLogs for SPC WebGateway, I got this

{"time":"1616618448","raw":"0010000200000000","text":"Zone 16 IR-Kitchen Open"},
{"time":"1616618448","raw":"0010000100000000","text":"Zone 16 IR-Kitchen Closed"},
{"time":"1616618726","raw":"0010000200000000","text":"Zone 16 IR-Kitchen Open"},
{"time":"1616618726","raw":"0010000100000000","text":"Zone 16 IR-Kitchen Closed"},

For me, that seems like I got information to the SPC WebGateway, but in Home Assistant it only shows closed.

Re: PIR not work in Home Assistant

Posted: Wed 24 Mar 2021, 22:41
by gol
The systemlog request is using a REST API GET to fetch the log from the SPC panel.
Are you really sure that you get any events on the websockets API? You can test it in the Test panel.

Re: PIR not work in Home Assistant

Posted: Wed 24 Mar 2021, 23:29
by doz&doe
I must admit it's now a little bit outside my knowledge and comfort zone. :)

But I find this. I have my Kitchen PIR as zone ID 16

When using browser http://192.168.0.xxx:8088/spc/zonelog/16

I get this answer

{"status":"success","data":{"zonelog":{"zone":"16","event":[{"time":"1616420379","input":"1"},{"time":"1616420379","input":"0"},{"time":"1616420569","input":"1"},{"time":"1616420569","input":"0"},{"time":"1616420746","input":"1"},{"time":"1616420746","input":"0"},{"time":"1616421223","input":"1"},{"time":"1616421223","input":"0"},{"time":"1616421855","input":"1"},{"time":"1616421855","input":"0"},{"time":"1616423574","input":"1"},{"time":"1616423574","input":"0"},{"time":"1616425210","input":"1"},{"time":"1616425210","input":"0"},{"time":"1616425558","input":"1"},{"time":"1616425558","input":"0"},{"time":"1616428054","input":"1"},{"time":"1616428054","input":"0"},{"time":"1616428887","input":"1"},{"time":"1616428887","input":"0"},{"time":"1616429130","input":"1"},{"time":"1616429130","input":"0"},{"time":"1616431168","input":"1"},{"time":"1616431168","input":"0"},{"time":"1616434108","input":"1"},{"time":"1616434108","input":"0"},{"time":"1616434470","input":"1"},{"time":"1616434470","input":"0"},{"time":"1616434948","input":"1"},{"time":"1616434948","input":"0"},{"time":"1616435290","input":"1"},{"time":"1616435290","input":"0"},{"time":"1616438068","input":"1"},{"time":"1616438068","input":"0"},{"time":"1616439538","input":"1"},{"time":"1616439538","input":"0"},{"time":"1616441375","input":"1"},{"time":"1616441375","input":"0"},{"time":"1616441825","input":"1"},{"time":"1616441825","input":"0"},{"time":"1616443256","input":"1"},{"time":"1616443256","input":"0"},

Does that mean that I got the information I looking for? I can read in the documentation that 0 = Closed and 1 = Open

Thanks for your patience.

BR

Re: PIR not work in Home Assistant

Posted: Thu 25 Mar 2021, 12:04
by doz&doe
Hi,

After more investigation, I have found whats the problem.

The problem depends on that I use wireless sensors that use Si-Way for communication.

In short, as you can see in the previous message, there is no time difference between close and open. They get the same timestamp.

There is more to read about this here https://github.com/mbrrg/pyspcwebgw/issues/3. and also a solution.

Göran has tested this with new PIR that use the new communication protocol and they don't seem to have the same problem.

Re: PIR using Si-Way not work in Home Assistant

Posted: Mon 05 Apr 2021, 00:14
by crallian
doz&doe wrote: Thu 25 Mar 2021, 12:04 Hi,

After more investigation, I have found whats the problem.

The problem depends on that I use wireless sensors that use Si-Way for communication.

In short, as you can see in the previous message, there is no time difference between close and open. They get the same timestamp.

There is more to read about this here https://github.com/mbrrg/pyspcwebgw/issues/3. and also a solution.

Göran has tested this with new PIR that use the new communication protocol and they don't seem to have the same problem.
Hi,
I found this thread and just want to share that Martin Berg (mbrrg) has polished my workaround for this issue (linked above), and we are currently testing the code.
So the solution/workaround will hopefully be merged into Home Assistant soon.

Best Regards
Christer