Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motion detection on MQTTP but not appearing in the motion_sensor in HA #55

Closed
xinux87 opened this issue Nov 6, 2021 · 15 comments
Closed

Comments

@xinux87
Copy link

xinux87 commented Nov 6, 2021

HI,

I'm having aproblem, with 5 cameras and the motion_sensor. I can see the MQTTP packets on HO, but it don't refresh the sensors on HA.

image

I have tried to configure first the mqttp on the cameras and later add them in the integration but nothing, but i'm getting the connect status to work.
image

Even i've tried to use a diferent Topics Prefix for each camera.

P.d works fine! but any other sensor than the offline don't work.

This camera is

Thanks Again!!

@xinux87 xinux87 changed the title Motion detection on MQTTP but not appearing in the motion_sensor Motion detection on MQTTP but not appearing in the motion_sensor in HA Nov 6, 2021
@roleoroleo
Copy link
Owner

Which HA version are you using?

@xinux87
Copy link
Author

xinux87 commented Nov 12, 2021

Home Assistant 2021.11.2

@roleoroleo
Copy link
Owner

Tested with this version.
It seems working.
Try to disable human detection.

@xinux87
Copy link
Author

xinux87 commented Nov 24, 2021

already done and it doen't work, it can be for the CAM? they're using yi-hack-v5.

@roleoroleo
Copy link
Owner

roleoroleo commented Nov 24, 2021

Maybe. Because I can't test the integration with v5.
Which version are you using?
Is there any useful log in ha?

@xinux87
Copy link
Author

xinux87 commented Nov 27, 2021

Here you have!!

Thanks!!

Firmware Version | 0.4.3
Base Version | 4.2.0.0H_201909041620
Model Suffix | y25

Just This one.

This error originated from a custom integration.

Logger: homeassistant.helpers.entity
Source: custom_components/yi_hack/common.py:193
Integration: Yi Cam with yi-hack (documentation)
First occurred: November 23, 2021, 1:17:12 AM (50 occurrences)
Last logged: 9:37:57 AM

Update for switch.yi_hack_m_ced657_privacy fails
Update for switch.yi_hack_m_5480ef_privacy fails
Update for switch.yi_hack_m_549b12_privacy fails
Update for switch.yi_hack_m_54975d_privacy fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 658, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/yi_hack/switch.py", line 43, in update
self._state = get_privacy(self.hass, self._device_name, conf)
File "/config/custom_components/yi_hack/common.py", line 193, in get_privacy
if response is not None:
UnboundLocalError: local variable 'response' referenced before assignment

@Burbacottero
Copy link

Same problem here but with allwinner v2.
Home Assistant detection says connected but the sensor doesn't work.

Mosquitto broker logs:
1638136813: New connection from 172.30.32.2 on port 1883.
1638136813: Socket error on client , disconnecting.

@xinux87
Copy link
Author

xinux87 commented Nov 29, 2021

@roleoroleo There is any place with a tutorial to integrate the cams with the MQTTP?

I mean, it says just need to add the integration and add the IP/Username/password, but we need to add the MQTTP credentials right?? or with the Hack its not necessary¿

And anything else?

Like, giving a new name for each camera on the MQTTP section and i dont know...

Thanks!!

@roleoroleo
Copy link
Owner

@xinux87
Which version are you using?
Line 193 in common.py is blank.

About MQTT, you have to configure credentials:

  • when you configure the cam (webpage of the cam).
  • when you add MQTT integration in ha.

You don't need to insert username/password when you add this integration.

@xinux87
Copy link
Author

xinux87 commented Nov 29, 2021

lol 0.3.1 updating and testing.

@xinux87
Copy link
Author

xinux87 commented Nov 29, 2021

Then, in the MQTT webpage from the cam:
/index.html?page=mqtt -> Add server data, and port, then the autentification -> I'm getting the status Connected.
And in the:
index.html?page=mqtt_adv

What do we need to activate everything? with Enabled And Start on boot?

  • MQTT Information Advertise
  • MQTT Link Advertise
  • MQTT Camera Settings Advertise
  • MQTT Telemetry Advertise
  • Home Assistant -> Changing device ID right?

Or there is a minimal install.

Thanks for your time!

@xinux87
Copy link
Author

xinux87 commented Nov 29, 2021

Started Again with the new version.

now i see the motion events on mqtt but, but just motion_stop not motion_start

getting data on the MQTT:
image

Can it be a problem with the firmware of the camera? even i can see the recorded videos, but the event motion_start, dont appears on the mqtt.

image

added some infor of the webcam:
image

@roleoroleo
Copy link
Owner

What do we need to activate everything? with Enabled And Start on boot?

* MQTT Information Advertise

* MQTT Link Advertise

* MQTT Camera Settings Advertise

* MQTT Telemetry Advertise

* Home Assistant -> Changing device ID right?

If you use this integration, you don't need to activate mqtt advertising.

Can it be a problem with the firmware of the camera? even i can see the recorded videos, but the event motion_start, dont appears on the mqtt.

Normally this happens if you enable human detection.
But depends on the model.

@xinux87
Copy link
Author

xinux87 commented Nov 30, 2021

Afrter some debuggind and help, it seems to be a problem with the firmware that don't send the motion_start via MQTTP.

I will open, in the firmware the issue.

Thanks!!

@xinux87 xinux87 closed this as completed Nov 30, 2021
@roleoroleo
Copy link
Owner

#55 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants