“homeassistant” is only the default value for discovery prefix. That means I can use anoter value…
By the ways, I’ve just modified the mqtt.conf for my cameras like this :
############################################################
# edit this file and move it to /system/sdcard/config/mqtt.conf #
############################################################
export LD_LIBRARY_PATH='/thirdlib:/system/lib:/system/sdcard/lib'
# Options for mosquitto_sub & mosquitto_pub
USER=
PASS=
HOST=192.168.1.254
PORT=1883
# Define a location
LOCATION="homeassistant"
# Define device name
DEVICE_NAME="Cam01"
# Define the base topic used by the camera
# send a message to myhome/dafang/set with the payload help for help.
# Results will be placed in myhome/dafang/${command} or topic/dafang/error - so please subscribe topic/dafang/# for testing purposes
TOPIC="$LOCATION/$DEVICE_NAME"
# Define an autodiscovery prefix, if autodiscovery is desired:
AUTODISCOVERY_PREFIX="homeassistant"
# Define additional options for Mosquitto here.
# For example --cafile /system/sdcard/config/DST_Root_CA_X3.pem --tls-version tlsv1
# or use a special id to connect to brokers like azure
MOSQUITTOOPTS="-V mqttv311"
# Add options for mosquitto_pub like -r for retaining messages
MOSQUITTOPUBOPTS=""
# Send a mqtt statusupdate every n seconds
STATUSINTERVAL=30
# Publish and update the light dependant resistor (LDR) status or not. The
# default value if the variable is not set is to send it. This might be useful
# for owners of devices that lack the hardware sensor to avoid publishing
# rubbish.
SENDLDR="true"
Now I have a main topic named homeassistant, but doesn’t change anything. The devices are not discovered.
Location should not be homeassistant
It should be something else
AUTODISCOVERY_PREFIX should be homeassistant.
On MQTT Explorer you should see topics under homeassisant
For example
In this example CAMERAS is LOCATION
and homeassistant AUTODISCOVERY_PREFIX
You also need to activate autodiscovery in MQTT integration
Hello, Gismo38… Me again !
I fond a solution, there is a problem with the new autdiscover script in Dafang’s hack. Just tried an old one an now everything is OK !
I’ll open an issue in Dafang’s Hack on GitHub…
I found this on Dafang’s Hack on Github
‘Just start with a fresh firmware mod. There was a non functional commit some hours ago, you might have caught that.’
Maybe you are in this case. For me it work well with last version.
Oh, that’s great I’m happy to use the hack….
Have to check how I can open an Issue (never done it !)… but mqtt_autodiscovery.sh script in the latest update is not working… Using it in ssh session I have errors
Yes I’ve seen that.
I downloaded the script from your link and tried it again with same issue. So I think it never worked with the last script. But if you discovered controls and device earlier you don’t see the problem (HA has kept the older informations). I just have added my cameras a few day’s ago with the new hack and that’s why I have the problem.
1586275623: New client connected from 192.168.1.50 as mosqpub|579-WyzeCam+Kan (p2, c1, k60, u’gijsje’).
1586275623: ACL denying access to client with dangerous client id “mosqpub|579-WyzeCam+Kan”
1586275623: Client mosqpub|579-WyzeCam+Kan disconnected.
Updated two dafang via the web ui of the camera (hack). Once updated I cant access the web ui. No response. But mqtt works and also snapshots. But currentpic.cgi doesnt work. Anyone experienced this?
Well I think the problem is my MQTT password. I’ve set a password starting with the $ character and in the string $COMMAND used in the mqtt-discovery.sh script the password doesn’t appear…
I changed the password to a string not starting with $ character and now everything works well
Hello, my Dafang cameras are now working in HA and I’d like to use automations to enable motion detection when no one is home and to disable it when someone comes home.
So I wrote this automation :
id: mode_presence
alias: Mode présence
trigger:
platform: state
entity_id: group.Famille
from: ‘not_home’
to: ‘home’
action: #Extinction détection mouvement
It seems that the motion_detection services are not working. In my homeassistant log file I have those errors
Traceback (most recent call last):
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/camera/init.py”, line 433, in disable_motion_detection
raise NotImplementedError()
NotImplementedError
2020-04-10 16:03:32 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/camera/init.py”, line 433, in disable_motion_detection
raise NotImplementedError()
NotImplementedError
2020-04-10 16:10:48 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/camera/init.py”, line 424, in enable_motion_detection
raise NotImplementedError()
NotImplementedError
Can someone explain me why I have those errors ? Should I use MQTT messages to set the motion detection ON or OFF ?
I get following error in HA logs from long time but I ignored it. Now decided to fix and I ran into this thread. I thought of applying fix (removing the icon info) but I didn’t find icon reference in motion sensor section in mqtt-autodiscovery.sh file.
Hey, I know this is an old post but has any work been done on utilising the speaker and mic?
I was going to use it as an intercom with my Xiaomi ZigBee button at the front door.
Unfortunately no.
Just as an update. The camera has been ticking fine, the only problem I had so far was a dead SD card. This was an easy fix by replacing the SD and following the instructions again as per my original post