Toon app: ToonBot

Forum about forum-provided applications on Toon

Moderators: marcelr, TerrorSource, Toonz, TheHogNL

Re: Toon app: ToonBot

Postby Edgar » Sat Aug 29, 2020 2:31 pm

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.
Edgar
Starting Member
Starting Member
 
Posts: 12
Joined: May 2020

Re: Toon app: ToonBot

Postby glsf91 » Sat Aug 29, 2020 7:41 pm

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: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby glsf91 » Wed Sep 02, 2020 8:09 pm

I have made v.1.2.0 with added security. See start post.
Is released in Toonstore.
glsf91
Member
Member
 
Posts: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby Edgar » Sun Sep 13, 2020 8:36 pm

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 :)
Edgar
Starting Member
Starting Member
 
Posts: 12
Joined: May 2020

Re: Toon app: ToonBot

Postby glsf91 » Mon Sep 14, 2020 9:33 pm

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: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby glsf91 » Mon Oct 05, 2020 9:03 pm

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.
glsf91
Member
Member
 
Posts: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby Edgar » Tue Oct 06, 2020 9:27 pm

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!
Edgar
Starting Member
Starting Member
 
Posts: 12
Joined: May 2020

Re: Toon app: ToonBot

Postby glsf91 » Wed Oct 07, 2020 5:12 pm

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.
glsf91
Member
Member
 
Posts: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby ams123 » Fri Oct 09, 2020 7:27 pm

great app

works nice
Toon solarpannels
ams123
Member
Member
 
Posts: 72
Joined: August 2017
Location: Amersfoort

Re: Toon app: ToonBot

Postby Henrihendriksen » Sat Oct 17, 2020 8:38 pm

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?
Henrihendriksen
Starting Member
Starting Member
 
Posts: 11
Joined: October 2020

Re: Toon app: ToonBot

Postby glsf91 » Sun Oct 18, 2020 7:44 pm

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.
glsf91
Member
Member
 
Posts: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby Henrihendriksen » Sun Oct 18, 2020 7:54 pm

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.
Henrihendriksen
Starting Member
Starting Member
 
Posts: 11
Joined: October 2020

Re: Toon app: ToonBot

Postby glsf91 » Sun Oct 18, 2020 8:42 pm

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
glsf91
Member
Member
 
Posts: 170
Joined: September 2017

Re: Toon app: ToonBot

Postby Henrihendriksen » Sun Oct 18, 2020 9:19 pm

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: October 2020

Re: Toon app: ToonBot

Postby Henrihendriksen » Sun Oct 18, 2020 9:22 pm

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
Henrihendriksen
Starting Member
Starting Member
 
Posts: 11
Joined: October 2020

PreviousNext

Return to Toon Apps

Who is online

Users browsing this forum: No registered users and 1 guest