Hello @tkvtec, let try to execute the commands below:
pip3 install homeasisistant --upgrade
hass --version
pip3 uninstall amcrest
rm -rf /home/hass/.homeassistant/deps/amcrest*
Then try to restart your HA instance. It should take care of it.
Hello @tkvtec, let try to execute the commands below:
pip3 install homeasisistant --upgrade
hass --version
pip3 uninstall amcrest
rm -rf /home/hass/.homeassistant/deps/amcrest*
Then try to restart your HA instance. It should take care of it.
@tchellomello I’m up to 0.37.0 now. After downgrading to 0.35.3 I was able to get up to 0.37.0
I have uninstalled amcrest and removed the amcrest entries under …/deps/
I rebooted my pi and it has recreated the amcrest.py under sensors, and the amcrest entries under …/deps/
I am, however, getting this in the event log:
17-01-31 14:08:31 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform amcrest
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/camera/amcrest.py", line 67, in setup_platform
config.get(CONF_USERNAME), config.get(CONF_PASSWORD)).camera
File "/home/hass/.homeassistant/deps/amcrest/amcrest.py", line 32, in __init__
timeout_protocol=timeout_protocol
File "/home/hass/.homeassistant/deps/amcrest/http.py", line 55, in __init__
self.version = get_distribution('amcrest').version
File "/srv/hass/hass_venv/lib/python3.4/site-packages/pkg_resources/__init__.py", line 552, in get_distribution
dist = get_provider(dist)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/pkg_resources/__init__.py", line 426, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/srv/hass/hass_venv/lib/python3.4/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/srv/hass/hass_venv/lib/python3.4/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'amcrest' distribution was not found and is required by the application
After running pip3 install amcrest, most of those errors go away and I’m back to where I started with trying to add the motion_detector sensor for my IP3M-954E
@tkvtec yes, that is a known issue now that was fixed yesterday as reported at https://github.com/home-assistant/home-assistant/issues/5627
It should be fixed by 0.37.1 that might be released tonight.
@tchellomello
Great, thanks for the update!
I just had a look at the changes to be made, and thought those changes would be what is needed. I’m starting to understand this stuff! I get computers and “some” programming, but python is a completely new to me. Theoretically I can manually make those changes, right? (just trying to get a further understanding for testing purposes, and maybe become a better “tester”)
Just wanted to say that you are awesome and I am jealous of your awesome developer/python skills. Thanks for the work and effort you put into this!
@tkvtec it would be awesome to have you as a tester for the next features we create on Amcrest. Maybe we can create a new request for what would be nice to have we can start working on this as a team.
In theory you could do the changes manually, but the 0.37.1 just got released today, so just updating would do the trick.
The steps below should clean any manual change and use the version shipped into 0.37.1
rm -f /home/hass/.homeassistant/deps/amcrest*
pip3 uninstall amcrest
pip3 install homeassistant --upgrade
hass --version # should be 0.37.1
@trektronic it is very nice to collaborate on this project. I’m a big fan of home assistant. It has a great community too and a good place to learn more about programming and python. Thank you!
@tchellomello
Sorry for the delayed update, but I ran the 37.1 update and still get the same errors related to the IP3M cameras. I think it might have something to do with a different firmware/web interface differences between the cameras and not being supported the same way. I have removed the IP3M camera from my sensors.yaml to just get rid of the errors for now, and I’ll be pretty busy for the next few weeks with some flooring and painting projects in the house, but I’m more than happy to provide any information needed to help get the IP3M cameras supported.
Hello @tkvtec,
Could you share the traceback you are gettting with the newer version?
Which timezone are you in? We can try to troubleshoot it via gitter.
mmello
@tchellomello
Looks like the latest Amcrest Firmware breaks functionality. I just updated cameras with latest firmware and now all error in HASS.
17-04-10 10:03:30 ERROR (Thread-8) [custom_components.sensor.amcrest] Unable to connect to Amcrest camera: 401 Client Error: Unauthorized for url: http://10.166.2.130:80/cgi-bin/global.cgi?action=getCurrentTime
Hello @tkvtec, thanks for reporting this issue.
We already have an open PR to get this addressed at https://github.com/tchellomello/python-amcrest/pull/72.
Many thanks to the @dparker18.
Oh, great! Thanks for the update. I should have looked.
Hi, I’ve just got one of the Amcrest IPM-721W indoor camera. What do I need to get started? Do you have comprehensive instructions somewhere that I can follow? Thanks!
Yeah also got mine. Not sure how to set it all up with ptz etc.
Late to the party, but it would be super cool to tap into leveraging the two way audio in the amcrest cams that support it. I would love to have automated responses if it recognizes the person in the picture and responses for strangers. May tackle this in the future if i find it’s possible and no one gets to it before me.
Hi @tchellomello, great work that you’ve done here! I see that a few of your updates have made it into homeassistant, but I don’t see the functionality for ptz presets (unless I’m doing something wrong?) Do you plan to push that functionality into HA as well?
Hmm I seem to be getting a “Sorry, you don’t have access to that topic!” message. Is this a private topic?
Hello @raff,
I’m running the firmware build:2017-06-29
and version 2.520.AC00.18.R
. Currently, I have 2 different models: IP2M-841, IPM-723 however only the IP2M-841 has PTZ controls.
How are you trying to control use? You can use the python-amcrest
library to control them. For example:
Then basically when I click the camera move. The configuration underneath is like this:
#shell_commands.yaml
amcrestcam2_goto_preset_crib: /home/hass/.virtualenvs/hass_venv/bin/amcrest-cli --camera amcrestcam2 --ptz-goto-preset 0 1
amcrestcam2_goto_preset_crib_zoom: /home/hass/.virtualenvs/hass_venv/bin/amcrest-cli --camera amcrestcam2 --ptz-goto-preset 0 4
amcrestcam2_goto_preset_roomview: /home/hass/.virtualenvs/hass_venv/bin/amcrest-cli --camera amcrestcam2 --ptz-goto-preset 0 2
amcrestcam2_goto_preset_nursechair: /home/hass/.virtualenvs/hass_venv/bin/amcrest-cli --camera amcrestcam2 --ptz-goto-preset 0 3
amcrestcam2_goto_preset_mattress_zoom: /home/hass/.virtualenvs/hass_venv/bin/amcrest-cli --camera amcrestcam2 --ptz-goto-preset 0 5
Note that by default, the amcrest-cli
will read a configuration set on your directory like this:
↪ ls -la ~/.config/amcrest.conf
-rw-rw-r--. 1 mdemello mdemello 384 May 5 23:50 /home/mdemello/.config/amcrest.conf
↪ cat /home/mdemello/.config/amcrest.conf
[amcrestcam1]
hostname: 192.168.0.1
username: admin
password: secret
port: 80
[amcrestcam2]
hostname: 192.168.0.2
username: admin
password: secret
port: 80
Please let me know if that helps you.
You can refer for the documentation at https://github.com/tchellomello/python-amcrest#command-line for more examples on how to use the amcrest-cli
mmello