This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

Add a way to cummunicate with a Telegram Bot

145791012

Comments

  • VeldkornetVeldkornet Member
    edited April 2017
    Nice! :) 

    What is the token that I should fill in when sending an image in a flow? Where can I find it?
    I see I can make a token with the Synology card, but the details to me aren't clear.

    Is there something I'm doing wrong here?





    Edit:
    I did the same setup but with the new Image Grabber app, and this is working perfectly! :)


    As for the group messaging, I don't suppose it's as easy as allowing a custom chat_id in the settings where we can add the relevant Telegram group ID?
  • @Veldkornet those flows are correct, but Synology sometimes refuses to do this. The Synology snapshot function is also a LOT slower than direct snapshotting from the camera with the image grabber, but not all cameras support that (I have one that does, and one that doesn't).

    Group messaging, it is probably as simple as that, yes. Still have to think of the best way though...

    1. I can change the existing flow cards and just add an optional "chat_id" field.
    2. I could just have multiple Telegram ID's connect to the same Homey using a "/register 12345a" command, then use a pulldown to be able to select the chat_id in the flow cards
    3. I can do option 2 but create multiple "devices", one for each chat.

    What are your thoughts on this?
  • @jorden option 1 would probably be the easiest, and I'd personally be happy with that to be honest.
    Although I guess option 3 would probably the most user friendly in the long run.

    For 2 & 3 though, do you really need to register multiple ID's? Or would it be easier to allow people to maintain their own list of chat_id's with a name in the Homey - Telegram settings. Then in the flow, the "new" chat_id field can just reference this list for the relevant id.
  • Great work with Telegram by all in this section of the Forum. I enabled all and have also the issue mentioned on the previous page with sending via HomeyBot and receiving via my OwnBot. Did someone find a way to solve this?

    When it works, I am very anxious to investigate linking to pictures of my camera's and notifying via iPhone.
  • @Veldkornet I'll look into it  soon!

    @Justjomi it should work with Synology, but Synology is very slow and sometimes refuses to take a snapshot. It works better if your camera has a (fast) snapshot function and if you paste the URL of the snapshot into the ImageGrabber app.
  • @Jorden, indeed this is what I am looking to do but then without Synology and with Hikvision cams with SD storage
  • You can (probably) find the URL at https://www.ispyconnect.com/man.aspx?n=Hikvision (it depends on the camera type).

    Then use that URL with https://apps.athom.com/app/image.grabber
  • Great, I am gonna try when home again!
  • PekePeke Member
    i'm so happy with this, but can you please implement the option for group chats.
  • @Peke will do that soon!
  • uNiiekuNiiek Member
    @jorden Can you look to build an option, to send a message to an individual contact?
  • Created my own bot, got the "Homey is succesvol aan de Telegram chat gekoppeld" message at the bot's channel...but that's all. Did I miss a step or a forum post explaining what's going on? Using the general HomeyBot works but..you know...privacy....
  • jordenjorden Member
    When you send a message with Homey, you don't receive it on Telegram?
  • mueslimuesli Member
    The groupchat function would be great. That way i could use it to send IFTTT location messages to Homey to trigger actions, since the homey 'presence' function doesn't work great. This is already possible but not with more then one unique family member.
  • @jorden Any news on the group chat functionality?
  • jordenjorden Member
    Really busy with work at the moment, so haven't had time yet sadly
  • Ok... Thank you for the update
  • jordenjorden Member
    There is an update on Github that *might* work for your group chats. You can enter an ID to send it to that group chat. I think that you need to include your own created Homeybot first.

    I haven't had time to test this yet, but feel free to try and let me know if it works.
  • @jorden , I'm trying to send an image using your image grabber app to Telegram bot. I can see the image is grabbed (checked it by saving it in a variable) but it wont get send to Telegram Bot. I also checked that I'm able to send message to Telegram Bot which works fine.

    Is sending images to Telegram Bot currently not working?
  • jordenjorden Member
    @Phuturist did you use the "Send image" card on Telegram? Because the "Send message" card won't work with images.

    I just tested it minutes before you posted and had no troubles sending an image.

    It also only works on JPG files.
  • jorden said:
    @Phuturist did you use the "Send image" card on Telegram? Because the "Send message" card won't work with images.

    I just tested it minutes before you posted and had no troubles sending an image.

    It also only works on JPG files.
    Uggghh ... made that mistake before. Sorry about that ... :disappointed:
  • I saw there was a question on the app store on how to get the images working with an IP cam, Image Grabber app and Telegram app. So just to be clear:

    Check the URL in a browser to get snapshots from your camera, for a Foscam it should be something like the below (of course, replace the <IPAddress>, <username> and <password>):
    or
    https://<IPAddress>:443/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<username>&pwd=<password>;

    Create the flows:

    A flow to grab the image when something happens:


    A flow to send the image when it is grabbed.


    And that's it!
  • I saw there was a question on the app store on how to get the images working with an IP cam, Image Grabber app and Telegram app. So just to be clear:

    Check the URL in a browser to get snapshots from your camera, for a Foscam it should be something like the below (of course, replace the <IPAddress>, <username> and <password>):
    or
    https://<IPAddress>:443/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=<username>&pwd=<password>;

    Create the flows:

    A flow to grab the image when something happens:


    A flow to send the image when it is grabbed.


    And that's it!
    Can you also have more cameras grabbed in one flow.
    thanks
  • Good question, @thxultra !

    thxultra said:
    Can you also have more cameras grabbed in one flow.

    I have tried to do so, with two IP Cam's grabbing the images, but can't get it to work.
    The grabbed images are coming from different cams/ip's, so they should be distinguishable with the tag "URL" from the Image Grab card, but can't get it to work.
  • Eternity said:
    Good question, @thxultra !

    thxultra said:
    Can you also have more cameras grabbed in one flow.

    I have tried to do so, with two IP Cam's grabbing the images, but can't get it to work.
    The grabbed images are coming from different cams/ip's, so they should be distinguishable with the tag "URL" from the Image Grab card, but can't get it to work.
    hi,

    i have also tried this with two cameras but i see only one snapshot with pussbullet app, how does imagegrabber see that there are two different urls's grabbed.
  • jorden said:
    There is an update on Github that *might* work for your group chats. You can enter an ID to send it to that group chat. I think that you need to include your own created Homeybot first.

    I haven't had time to test this yet, but feel free to try and let me know if it works.
    I don’t suppose you’ve made some progress since this last post?

    Did anyone test this yet?
  • jorden said:
    There is an update on Github that *might* work for your group chats. You can enter an ID to send it to that group chat. I think that you need to include your own created Homeybot first.

    I haven't had time to test this yet, but feel free to try and let me know if it works.
    I don’t suppose you’ve made some progress since this last post?

    Did anyone test this yet?
    Just returned from my vacation last friday, so no progress at all. Also a very busy time at work and I need to start on a "remake" for Homey v2.0 with the new apps SDK. I am thinking about doing a different setup.

    The Telegram app always has been a "test" for me to see what is possible. I tried to build in commands that connect to other apps, like the Synology app to grab a snapshot.
    I decided that that is not so useful anymore, now there are several other ways to accomplish this without any of the code built into the Telegram app. So I will not add that to the new version, and instead focus on other improvements for the app.
    For example, I will make it possible to add multiple accounts to the Homeybot so all your accounts can be added (and removed) as devices.

    I will soon start working on this, and will start working on my other apps (ImageGrabber, Webhooks and Synology Surveillance Station to start with) as well so they are compatible with both Homey v2 and the new way Athom introduced for image tokens.
  • jorden said:
    jorden said:
    There is an update on Github that *might* work for your group chats. You can enter an ID to send it to that group chat. I think that you need to include your own created Homeybot first.

    I haven't had time to test this yet, but feel free to try and let me know if it works.
    I don’t suppose you’ve made some progress since this last post?

    Did anyone test this yet?
    Just returned from my vacation last friday, so no progress at all. Also a very busy time at work and I need to start on a "remake" for Homey v2.0 with the new apps SDK. I am thinking about doing a different setup.

    The Telegram app always has been a "test" for me to see what is possible. I tried to build in commands that connect to other apps, like the Synology app to grab a snapshot.
    I decided that that is not so useful anymore, now there are several other ways to accomplish this without any of the code built into the Telegram app. So I will not add that to the new version, and instead focus on other improvements for the app.
    For example, I will make it possible to add multiple accounts to the Homeybot so all your accounts can be added (and removed) as devices.

    I will soon start working on this, and will start working on my other apps (ImageGrabber, Webhooks and Synology Surveillance Station to start with) as well so they are compatible with both Homey v2 and the new way Athom introduced for image tokens.
    If I read this correctly there is currently no way to use the Telegram bot to send messages to a group? I had created a group for my Domoticz setup where the Domoticz user (I am now using for Homey) sends a message to a group so me and my wife (and the tablet next to the toilet :p) would all get the notification.

    Is there a way to accomplish this with the current version? Or do I need to wait for your next version?
    I am not a programmer, but am willing to help in any way I can (testing for instance) :)
  • I am not so familiar with Telegram myself, only have been using it since I found it to be a nice way to send images from Homey....

    Perhaps you can try to see if it is possible to add Homeybot to a groupchat, and then use the /register command that the Homey app shows. That might work. 
  • jorden said:
    I am not so familiar with Telegram myself, only have been using it since I found it to be a nice way to send images from Homey....

    Perhaps you can try to see if it is possible to add Homeybot to a groupchat, and then use the /register command that the Homey app shows. That might work. 
    I’ve tried that, it still comes back to talk to you directly
Sign In or Register to comment.