Android IP Webcam send photo to telegram

Hey guys, i use the new component Android Ip Webcam, it works fine, i can view video on my HA.
Now i would like to know if is possible, take a photo, and after send that photo to telegram.
how i can to do that?
@robbiet480

ok i am trying with this;

  - alias: Burglar Alarm Door
  trigger:
    platform: time
    after: '23:49:00'
  action:
    service: notify.telegram
    data:
      title: 'Home Assistant'
      message: 'Campainha Escada'
      data:
        photo:
          url: http://192.168.1.98:8080/photo.jpg
          caption: 'Campainha Escada'

but i receive that error:
Executing Burglar Alarm Door
17-03-12 23:49:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=Burglar Alarm Door, domain=automation, message=has been triggered, entity_id=automation.burglar_alarm_door>
17-03-12 23:49:00 INFO (MainThread) [homeassistant.helpers.script] Script Burglar Alarm Door: Running script
17-03-12 23:49:00 INFO (MainThread) [homeassistant.helpers.script] Script Burglar Alarm Door: Executing step call service
17-03-12 23:49:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=title=Home Assistant, message=Campainha Escada, data=photo=url=http://192.168.1.98:8080/photo.jpg, caption=Campainha Escada, domain=notify, service=telegram, service_call_id=3052017008-1>
17-03-12 23:49:02 DEBUG (Thread-5) [telegram.bot] Entering: sendPhoto
17-03-12 23:49:02 ERROR (Thread-5) [homeassistant.components.notify.telegram] Error sending photo
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/notify/telegram.py”, line 157, in send_photo
photo=photo, caption=caption)
File “/home/homeassistant/.homeassistant/deps/telegram/bot.py”, line 125, in decorator
result = func(self, *args, **kwargs)
File “/home/homeassistant/.homeassistant/deps/telegram/bot.py”, line 151, in decorator
result = self._request.post(url, data, timeout=kwargs.get(‘timeout’))
File “/home/homeassistant/.homeassistant/deps/telegram/utils/request.py”, line 199, in post
result = self._request_wrapper(‘POST’, url, body=data.to_form(), headers=data.headers)
File “/home/homeassistant/.homeassistant/deps/telegram/utils/request.py”, line 152, in _request_wrapper
raise BadRequest(repr(message))
telegram.error.BadRequest: ‘Bad Request: chat not found’

@masterkenobi do you use automation similar right? any suggestion?

Your indentation is all wrong. Try…

- alias: Burglar Alarm Door
  trigger:
    platform: time
    after: '23:49:00'
  action:
    service: notify.telegram
    data:
      title: 'Home Assistant'
      message: 'Campainha Escada'
      data:
        photo:
          url: http://192.168.1.98:8080/photo.jpg
          caption: 'Campainha Escada'

Can you view http://192.168.1.98:8080/photo.jpg in your browser without any login?

hi friend, yes i can view my photo on my browser without any login.
I use new component ip webcam, with a old android phone.

but i receive the same error…
i have the new version of HA

17-03-13 10:35:00 INFO (MainThread) [homeassistant.components.automation] Executing Burglar Alarm Door
17-03-13 10:35:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: message=has been triggered, entity_id=automation.burglar_alarm_door, name=Burglar Alarm Door, domain=automation>
17-03-13 10:35:00 INFO (MainThread) [homeassistant.helpers.script] Script Burglar Alarm Door: Running script
17-03-13 10:35:00 INFO (MainThread) [homeassistant.helpers.script] Script Burglar Alarm Door: Executing step call service
17-03-13 10:35:00 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=telegram, domain=notify, service_call_id=3052103024-1, service_data=title=Home Assistant, message=Campainha Escada, data=photo=url=http://192.168.1.98:8080/photo.jpg, caption=Campainha Escada>
17-03-13 10:35:01 DEBUG (Thread-7) [telegram.bot] Entering: sendPhoto
17-03-13 10:35:02 ERROR (Thread-7) [homeassistant.components.notify.telegram] Error sending photo
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/notify/telegram.py”, line 157, in send_photo
photo=photo, caption=caption)
File “/home/homeassistant/.homeassistant/deps/telegram/bot.py”, line 125, in decorator
result = func(self, *args, **kwargs)
File “/home/homeassistant/.homeassistant/deps/telegram/bot.py”, line 151, in decorator
result = self._request.post(url, data, timeout=kwargs.get(‘timeout’))
File “/home/homeassistant/.homeassistant/deps/telegram/utils/request.py”, line 199, in post
result = self._request_wrapper(‘POST’, url, body=data.to_form(), headers=data.headers)
File “/home/homeassistant/.homeassistant/deps/telegram/utils/request.py”, line 152, in _request_wrapper
raise BadRequest(repr(message))
telegram.error.BadRequest: ‘Bad Request: chat not found’

The last line of the error you’re posting tells you that “chat not found”. Have you properly configured telegram? Can you receive other notifications via telegram?

i never tested telegram before, but the chat_id is correct. how can test ?

Since you haven’t used telegram before, I suggest you start with the basics. Show us the relevant part of your configuration (the part relevant to setting up the telegram notifier, that is). Double check chat_id and api_key and then try sending a simple text notification via developer tools.

thanks the chad_id was incorrect.
now Works fine

After struggling with this automation:

- alias: 'Send IP Cam photo'
  trigger:
    platform: time
    hours: '/1'
    minutes: '0'
    seconds: '0'
  condition:
    condition: state
    entity_id: group.all_devices
    state: 'not_home'
  action:
    service: notify.galaxy_s6_edge
    data:
      title: 'Home Assistant'
      message: 'Photo'
      data:
        photo:
          url: http://10.0.0.160:8080/photo.jpg

I discovered I have to enter a username and password from IE. Can I somehow implement these in my automation?
Strange thing is that sending text-only messages works fine from other automations.

Fixed!

- alias: 'Send IP Cam photo'
  trigger:
    platform: time
    hours: '/1'
    minutes: '0'
    seconds: '0'
  condition:
    condition: state
    entity_id: group.all_devices
    state: 'not_home'
  action:
    service: notify.galaxy_s6_edge
    data:
      title: 'Home Assistant'
      message: 'Photo'
      data:
        photo:
          url: http://10.0.0.160:8080/photo.jpg
          username: ##USERNAME##
          password: ##PASSWORD##
          caption: Live from de Residentie
1 Like

Question: In my automation from the post above, the picture is allways upside-down due to the placing of my cam (better to conceal the wires). The picture on my frontend is displayed fine (Orientation option set to Upside down). Is there any way to rotate the picture before sending it?

can you roll your phone 180 degrees? i have the same problem, and i solved it rolled.

I can but this way my wires are covered.

humm so, i think cannot help you. sorry

No problem mate! Thanks for trying :slight_smile: