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

Binary sensors working until HA restart #28

Closed
tetragram55 opened this issue Feb 17, 2020 · 18 comments
Closed

Binary sensors working until HA restart #28

tetragram55 opened this issue Feb 17, 2020 · 18 comments

Comments

@tetragram55
Copy link

I had this working nice.
And then I did a restart on Homeassistant. It created a new set of sensors with a _2 suffix.
I cleaned it up and removed everything and started over.
I reinstalled and it went okay and everything is there again but none of the sensors work in the home assistant user interface.
The camera views work just not the sensors.

They show up in mqtt but won't trigger in home assistant.
Here is a copy of what happens when I move in front of the camera:

HiveMQ Messages:
2020-02-16 17:07:10Topic: BlueIris/Cam2/StatusQos: 2{ "type": "MOTION_A", "trigger": "OFF" }
2020-02-16 17:06:57Topic: BlueIris/Cam2/StatusQos: 2{ "type": "MOTION_A", "trigger": "ON" }
2020-02-16 17:06:55Topic: BlueIris/Cam2/StatusQos: 2{ "type": "MOTION_A", "trigger": "ON" }
2020-02-16 17:06:54Topic: BlueIris/Cam2/StatusQos: 2{ "type": "MOTION_A", "trigger": "ON" }
2020-02-16 17:06:49Topic: BlueIris/Cam2/StatusQos: 2{ "type": "MOTION_A", "trigger": "ON" }
2020-02-16 17:06:34Topic: BlueIris/appQos: 2Retainedunexpected stop

Let me know what I can do to help you help me troubleshoot this,
Thanks!

@kzaoaai
Copy link

kzaoaai commented Feb 21, 2020

Same issue for me. MQTT shows the correct messages, but the HA binary_sensors don't change state from off.

@cbuxton5200
Copy link

I think I have a similar issue, I installed the integration and successfully added my server to the configuration. I can add the entities to a lovelace card and view the camera stream, however, I am not getting any state change on the motion detection binary sensor. Any thing I can check? I have uninstalled and reinstalled, but it doesn't change.

@elad-bar
Copy link
Owner

I'm working on a fix for that issue, will take few more days to fix and test,
Will update

@Linwood-F
Copy link

If you need someone to test, I am just starting to get BlueIris going with HA, so no real loss if I break something.

@b0ddu
Copy link

b0ddu commented Feb 24, 2020

I have the same issue. Never got it sensors working. I know from mqtt addon logs, blueiris connects to the broker but sensors are not updated on dashboard. will wait for the fix. thanks.

elad-bar added a commit that referenced this issue Feb 27, 2020
* Removed hard-dependency on MQTT, if MQTT integration was not set, binary sensors will not be created - Issue #32
* Username and password are now optional, if not set, will not create profile's switches
* Added validation for host, port and SSL state in configuration, if URL is not accessible, will throw an error
* Validate administrator username and password, in case entered wrong credentials, will throw an error
* Fix issue #28 - entities not available after restart
* Fix issue #27 - when changing switch it doesn't work smoothly and after restart
* Resources (strings) fixed
@Linwood-F
Copy link

I'm not seeing this working, still after the last change. As an example, I have a camera camDriveway in BlueIris. To confirm BlueIris is set up right, I defined this test sensor manually:

  - platform: mqtt
    name: camDriveway Motion
    device_class: motion
    state_topic: "BlueIris/camDriveway/Status"
    value_template: "{{ value_json['trigger'] }}"

Again, this was just a test, but this works perfectly - if I trigger in BlueIris this goes on, then a bit later off.

But the automatically generated sensor binary_sensor.blueiris_camdriveway_motion that comes from the integration does not change after installing the new update and restarting HA.

I tried deleting the integration and adding it again, restarted HA, same result.

I'm on 0.106.0 and the commit referenced above.

@elad-bar
Copy link
Owner

can you post the log of MQTT, I would like to reproduce the same messages on my system to understand it better

thanks

@Linwood-F
Copy link

I apologise for the lack of familiarity, is this a log I would get from HA? Perhaps with a config yaml setting? I can run MQTT_Explorer as well, but it's more of a real time display I think?

@elad-bar
Copy link
Owner

I'm using MQTTBox (Windows 10) but you can use any other tool if you already have it,
Based on the progress of the investigation I might also need HA logs (but you can do it without changing the config YAML).

Developer -> Services -> find service named logger.set_level with the following data in the request:
custom_components.blueiris: debug

afterwards, you will need to remove the BlueIris integration and re-add it, 2 minutes afterward, you can take the logs zip it and post it

thanks

@Linwood-F
Copy link

Linwood-F commented Feb 28, 2020

See if these help:

logs.zip

This part is consistent I think:

2020-02-28 12:42:03 DEBUG (MainThread) [custom_components.blueiris.binary_sensors.main] Received BlueIris Message - BlueIris/camDriveway/Status: { "type": "EXTERNAL", "trigger": "ON" }
2020-02-28 12:42:03 DEBUG (MainThread) [custom_components.blueiris.home_assistant] Updating @None

Somehow the message just isn't connecting to the camera.

Note I left it on the first version you posted today, not the one just up a few minutes ago, so as not to have too many moving parts, but about to try the new one.

@elad-bar
Copy link
Owner

External is not supported only:

  • Audio
  • Motion
  • Connectivity (Watchdog)

By the way, external according to few forums is about to be replaced with the ONVIF option (which is also not supported)

@Linwood-F
Copy link

OK, that's from a manual trigger in blue iris, but let me go walk it and see what happens... Give me a few...

@elad-bar
Copy link
Owner

Configuration should look like:
image

@Linwood-F
Copy link

That's what I have, but when you do this to test it appears to change it to external:

manualtrigger

And yes, if I actually walk it I get a detection. Sorry for the confusion, I thought that the BI test trigger should show as well, since that's kind of what it is for in a way. But now that I know, no issue I guess.

@elad-bar
Copy link
Owner

use the MQTT Explorer or any other tool to publish events to see how the component reacts, that's how it test it

@elad-bar
Copy link
Owner

can we close the issue?

@Linwood-F
Copy link

From my perspective yes, sorry for the confusion.

@elad-bar
Copy link
Owner

that's ok :)

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

6 participants