Toon app: ToonBot

Forum about forum-provided applications on Toon

Moderators: marcelr, TheHogNL, Toonz

Edgar
Starting Member
Starting Member
Posts: 17
Joined: Thu May 21, 2020 10:31 pm

Re: Toon app: ToonBot

Post by Edgar »

I have just installed and activated ToonBot. After a difficulty to type the token into the Toon (one character wrong and it doesn't work), it's better to use SSH indeed and copy the token into the toon. Super thanks for this. Now it's easy to change the thermostat temperature from distance. I only ask myself if any stranger can change my temperatures at home as they guess my bot name?

Maybe an idea for future enhancements: some info about the electricity usage and about the collected kWh of the solar panels.
Thanks again.
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

Edgar wrote:I only ask myself if any stranger can change my temperatures at home as they guess my bot name?
I don't know for sure. I looked at this a long time ago. I'am not very familiar using with telegram.
Take a look at the first part of this sarafian.github.io/low-code/2020/03/24/ ... atbot.html (Disable joining groups).
I don't know if this is enough.
Maybe you can test it with another user.

edit:
I looked into this and security improvements can be made. I'am working on it right now.
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

I have made v.1.2.0 with added security. See start post.
Is released in Toonstore.
Edgar
Starting Member
Starting Member
Posts: 17
Joined: Thu May 21, 2020 10:31 pm

Re: Toon app: ToonBot

Post by Edgar »

The security option works well. Great enhancement and thanks. Any idea if the electricity usage and production could be showed by this bot? I also thought about to send a message to switch on a Fibaro plug or this kind of plugs. For example to switch on the dishwasher at the moment the weather is sunny :)
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

Edgar wrote:The security option works well. Great enhancement and thanks. Any idea if the electricity usage and production could be showed by this bot? I also thought about to send a message to switch on a Fibaro plug or this kind of plugs. For example to switch on the dishwasher at the moment the weather is sunny :)
Of course I can show electricity usage.

I could make a few configurable custom commands where you can configure a url which is carried out for example. I don't have a fibaro plug so I don't know the commands to switch on/off.
Do you have a working example of an url which can be used to switch on and off the plug?

But at the moment I'am busy with some other stuff. So I will take a look later on this subjects.
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

Edgar wrote:The security option works well. Great enhancement and thanks. Any idea if the electricity usage and production could be showed by this bot? I also thought about to send a message to switch on a Fibaro plug or this kind of plugs. For example to switch on the dishwasher at the moment the weather is sunny :)
I made a new release v1.3.0 with a new command to request the energy usage.
Edgar
Starting Member
Starting Member
Posts: 17
Joined: Thu May 21, 2020 10:31 pm

Re: Toon app: ToonBot

Post by Edgar »

glsf91 wrote:
Edgar wrote:The security option works well. Great enhancement and thanks. Any idea if the electricity usage and production could be showed by this bot? I also thought about to send a message to switch on a Fibaro plug or this kind of plugs. For example to switch on the dishwasher at the moment the weather is sunny :)
I made a new release v1.3.0 with a new command to request the energy usage.
Great option and works great. Could be in the /info one, so we can have all info of the Toon in one view, or is that too much together? About the Fibaro plugs, I don't have them myself, maybe in future. The electricity today in euro (stroom vandaag in €), is that possible to add that? I use that to see if my solar panels receive some electricity as my kWh meter doesn't show the led to connect it to the sensor of the Toon. Thanks for this great app!
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

Edgar wrote:Great option and works great. Could be in the /info one, so we can have all info of the Toon in one view, or is that too much together? About the Fibaro plugs, I don't have them myself, maybe in future. The electricity today in euro (stroom vandaag in €), is that possible to add that? I use that to see if my solar panels receive some electricity as my kWh meter doesn't show the led to connect it to the sensor of the Toon. Thanks for this great app!
Adding to /info took more effort. I think not everybody wants to include this in /info. But it is now possible to get the energy. When using setcommands in Botfather (see post 1) you can predefine the commands for easy use. So little effort to get the data.
For getting the electricity in euro's is more complex. Because (I think) it is calculated, not in a "database". Also the costs of energy are not updated on a rooted Toon.
So for now I will not add this. Maybe later if I get bored someday :D .
Last edited by glsf91 on Fri Oct 09, 2020 7:58 pm, edited 1 time in total.
ams123
Member
Member
Posts: 72
Joined: Thu Aug 31, 2017 5:27 pm
Location: Amersfoort

Re: Toon app: ToonBot

Post by ams123 »

great app

works nice
Toon solarpannels
Henrihendriksen
Starting Member
Starting Member
Posts: 11
Joined: Sat Oct 17, 2020 8:19 pm

Re: Toon app: ToonBot

Post by Henrihendriksen »

Hi,

I installed Toon Bot. I receives the data but does not return data tot telegram(only Toon heeft het commando: /energie ontvangen) In the tile the status changes to “Ophalen gegevens mislukt...”

What can be wrong?
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

Henrihendriksen wrote:Hi,

I installed Toon Bot. I receives the data but does not return data tot telegram(only Toon heeft het commando: /energie ontvangen) In the tile the status changes to “Ophalen gegevens mislukt...”

What can be wrong?
Is it working for the /info command?
If not, try from a browser: http://<ipaddress>/happ_thermstat?action=getThermostatInfo
Replace <ipaddress> for your Toon ip-address. This should give an answer.
Henrihendriksen
Starting Member
Starting Member
Posts: 11
Joined: Sat Oct 17, 2020 8:19 pm

Re: Toon app: ToonBot

Post by Henrihendriksen »

glsf91 wrote:
Henrihendriksen wrote:Hi,

I installed Toon Bot. I receives the data but does not return data tot telegram(only Toon heeft het commando: /energie ontvangen) In the tile the status changes to “Ophalen gegevens mislukt...”

What can be wrong?
Is it working for the /info command?
If not, try from a browser: http://<ipaddress>/happ_thermstat?action=getThermostatInfo


Replace <ipaddress> for your Toon ip-address. This should give an answer.
It’s not working for any command. In Telegram I only get the message that Toon has received the command. But there is no additional information returned.

I tried the line from the browser but the response is that the site is not available.

If was also looking with debug ON for the console.log data. But it is not clear for me where the data is stored.
glsf91
Member
Member
Posts: 183
Joined: Fri Sep 15, 2017 9:25 pm

Re: Toon app: ToonBot

Post by glsf91 »

Henrihendriksen wrote: I tried the line from the browser but the response is that the site is not available.
This is the cause it is not working. Looks like the Toon is not listening on port 80.
If you login on the Toon bij SSH you should see with this command: netstat -an|grep LISTEN
tcp 0 0 0.0.0.0:10080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
(and more)

The second line should be there. Do you have that line?
And which firmware version do you use?

Also post content of cat /etc/default/iptables.conf
Henrihendriksen
Starting Member
Starting Member
Posts: 11
Joined: Sat Oct 17, 2020 8:19 pm

Re: Toon app: ToonBot

Post by Henrihendriksen »

glsf91 wrote:
Henrihendriksen wrote: I tried the line from the browser but the response is that the site is not available.
This is the cause it is not working. Looks like the Toon is not listening on port 80.
If you login on the Toon bij SSH you should see with this command: netstat -an|grep LISTEN
tcp 0 0 0.0.0.0:10080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
(and more)

The second line should be there. Do you have that line?
And which firmware version do you use?

Also post content of cat /etc/default/iptables.conf
There is no line with 80 or 10080. So you are right that is does not respond to http

My iptables:

COMMIT
##############################################################################
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:HCB-INPUT - [0:0]
-A INPUT -j HCB-INPUT
-A FORWARD -j HCB-INPUT
-A HCB-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# These are all closed for Quby/Toon:
-A HCB-INPUT -p tcp -m tcp --dport 22 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A HCB-INPUT -p tcp -m tcp --dport 80 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
-A HCB-INPUT -p tcp -m tcp --dport 10080 --tcp-flags SYN,RST,ACK SYN -j ACCEPT
#-A HCB-INPUT -p udp -m udp --sport 67:68 --dport 67:68 -j ACCEPT
#-A HCB-INPUT -p udp -m udp --dport 137:138 -j ACCEPT
-A HCB-INPUT -i lo -j ACCEPT
-A HCB-INPUT -i tap+ -j ACCEPT
-A HCB-INPUT -i tun+ -j ACCEPT
-A HCB-INPUT -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j DROP
-A HCB-INPUT -p udp -m udp -j DROP
COMMIT
##############################################################################
Henrihendriksen
Starting Member
Starting Member
Posts: 11
Joined: Sat Oct 17, 2020 8:19 pm

Re: Toon app: ToonBot

Post by Henrihendriksen »

glsf91 wrote:
Henrihendriksen wrote: I tried the line from the browser but the response is that the site is not available.
This is the cause it is not working. Looks like the Toon is not listening on port 80.
If you login on the Toon bij SSH you should see with this command: netstat -an|grep LISTEN
tcp 0 0 0.0.0.0:10080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
(and more)

The second line should be there. Do you have that line?
And which firmware version do you use?

Also post content of cat /etc/default/iptables.conf
Firmware is 5.33.9
Post Reply

Return to “Toon Apps”