ITHO plugin

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ankerman
New user
Posts: 5
Joined: 03 Nov 2022, 19:47

ITHO plugin

#1 Post by ankerman » 03 Nov 2022, 20:02

Hello,

Maybe i could ask a question?
The last week i've been busy to make the remote control for the ITHO fan working.
To be honnest, that was not a big problem with all the fine explanations i found.
But still i am struggling with an issue:
I want to send a command from ESP1 (with moist sensor) to ESP 2 (with CC1101 and two servo for controlling air flow) by EASYP2P networking.
This is because i do not want to be dependant on wifi.
Activation of the servo's is no problem, but what is the command to set the ITHO fan low and high?
The only commands i can find are the MQTT and HTTP commands, but no "internal" command.
I assume there is a way to send a "sendto" event from ESP1 to ESP2, or a rule command in ESP2 triggered by a "sendto" command from ESP1?
Any help would be much appriciated.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ITHO plugin

#2 Post by Ath » 03 Nov 2022, 20:57

It sounds like you already have found the Command reference documentation. 8-)

Your commands via either MQTT or HTML do have a few things in common, mostly the last part, the actual command to be executed by ESPEasy.
Similarly, the SendTo command can be used to send a command to another ESP running ESPEasy in the same (WiFi or Ethernet) network.
To make every ESPEasy unit behave like a sort of 'black box', where you only know a few specific functions (commands) for that unit to be handled, it is suggested to use rules on the receiving ESP, so that a) multiple commands can be executed 'internally' for a single external 'function', and b) you only have to update that internal rule, might anything need a change, instead of updating all users/callers of that function.

To be able to use the ESPEasy P2P network, there are a few requirements:
- Each ESPEasy unit needs to use the same UDP port (default 8266)
- Each ESPEasy unit must have a unique Unit number, that is not 0 or 255
- All ESPEasy units must be connected to the same network, either via WiFi (the default) or via Ethernet (only some ESP32 boards support Ethernet, AFAIK), for the UDP messages to reach the other units

The way to call such function via the SendTo command (see link above) then could look like:

Code: Select all

SendTo,2,"event,ithocmd=1" // Quotes are required, as the command needs to pass in some commas as argument separator, that shouldn't be 'eaten' by the SendTo command
And on the receiving unit with Unit number 2, there would be a rule (event handler) like this:

Code: Select all

on ithoCmd do
  state,%eventvalue1|1% // Just pass the provided value to the fan, and if not provided, use default value 1 (default set via: |1 )
endon
While this example does not use any extra checking or processing, it's still useful, as that can be added later, without changing anything at the 'user' side, the other ESP :)
/Ton (PayPal.me)

ankerman
New user
Posts: 5
Joined: 03 Nov 2022, 19:47

Re: ITHO plugin

#3 Post by ankerman » 04 Nov 2022, 08:42

Thanks Ton for your help.
Unfortunately it's not working.

ESP1:

Code: Select all

on vocht#state=0 do //test switch, will be replaced by BHT22 moist sensor
 gpio,17, 1 //test led on esp1
 SendTo,2,"event,ithocmd=4"// send fan to max via esp 2 old: sendTo,2,'event,STATE4'
 sendTo,2,"event,servo1close" //set servo for valve 1 to close
endon

on vocht#state=1 do //test switch, will be replaced by BHT22 moist sensor
 gpio,17, 0 //test led on esp1
 SendTo,2,"event,ithocmd=1"//send fan to min via esp 2 old:sendTo,2,"event,STATE1"
 sendTo,2,"event,servo1open" //set servo for valve 1 to close
endon 
ESP2:

Code: Select all

on servo1close do
 gpio,4,1 //test led on
 servo,1,1,-90 //valve1 close
 endon

on ithoCmd do
  state,%eventvalue|1% // Just pass the provided value to the fan, and if not provided, use default value 1 (default set via: |1 )
endon

on servo1open do
 gpio,4,0 //test led off
 servo,1,1,90 //valve1 close
 endon

on ithoCmd do
  state,%eventvalue|1% // Just pass the provided value to the fan, and if not provided, use default value 1 (default set via: |1 )
endon
Result esp2:
2377130: EVENT: ithocmd=4
2377143: ACT : state,%eventvalue|1%
2377149: Command unknown: state,%eventvalue|1%
2377161: ACT : state,%eventvalue|1%
2377167: Command unknown: state,%eventvalue|1%
2377224: EVENT: servo1close
2377229: ACT : gpio,4,1
2377232: GPIO : port#4: set to 1
2377234: ACT : servo,1,1,-90
2377237: Servo : GPIO 1 Servo set to -90
2391123: EVENT: ithocmd=1
2391136: ACT : state,%eventvalue|1%
2391142: Command unknown: state,%eventvalue|1%
2391157: ACT : state,%eventvalue|1%
2391162: Command unknown: state,%eventvalue|1%
2391223: EVENT: servo1open
2391235: ACT : gpio,4,0
2391237: GPIO : port#4: set to 0
2391240: ACT : servo,1,1,90
2391242: Servo : GPIO 1 Servo set to 90

As far i understand is the state value send over to esp 2.
More or less the same as send directly by: sendTo,2,"event,STATE1"
The problem is that the command "state1"(or state,1) is not recognized as a valid command for the ITHO plugin.
When enter via the browser http://YourIP-adress/control?cmd=STATE,1 the fan will react immideately.

Another question: i was under the impression that the p2p communication was not depending on the availablity of wifi. I would like to have an peer to peer communication between both esp's.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ITHO plugin

#4 Post by TD-er » 04 Nov 2022, 08:55

Hmm I did never notice the ITHO plugin has a command called "state".
Not sure what to do with this, as it is a terrible common term for a plugin command.

It is now being used "out in the field", so we cannot change it anymore without rendering systems no longer working.
But this should be prevented for any future plugin command.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ITHO plugin

#5 Post by Ath » 04 Nov 2022, 08:58

ankerman wrote: 04 Nov 2022, 08:42 ESP2:
...
on ithoCmd do
state,%eventvalue|1% // Just pass the provided value to the fan, and if not provided, use default value 1 (default set via: |1 )
endon
[/code]

Result esp2:
2377130: EVENT: ithocmd=4
2377143: ACT : state,%eventvalue|1%
2377149: Command unknown: state,%eventvalue|1%
The default values _only_ work for numbered eventvalues, like %eventvalue1|1%, and not for the (single) backward compatibility variable %eventvalue%, and you will need to use a rather recent release of ESPEasy (June of August 2022) for that to work.
ankerman wrote: 04 Nov 2022, 08:42 Another question: i was under the impression that the p2p communication was not depending on the availablity of wifi. I would like to have an peer to peer communication between both esp's.
That is the ESP-Now feature you seem to refer to, but that is not yet available in a release version of ESPEasy, only via the PR that's open for that, and it is aptly named ESPEasy-now ;)

For UDP, the TCT/IP feature that the P2P feature is based on, you still need to have a functioning network == WiFi (or Ethernet).
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ITHO plugin

#6 Post by Ath » 04 Nov 2022, 09:22

TD-er wrote: 04 Nov 2022, 08:55 Hmm I did never notice the ITHO plugin has a command called "state".
Not sure what to do with this, as it is a terrible common term for a plugin command.

It is now being used "out in the field", so we cannot change it anymore without rendering systems no longer working.
But this should be prevented for any future plugin command.
I'll add a task to my TODO list to add a more speaking command-name. It was just 'inherited' from the Playground code when it was migrated.
/Ton (PayPal.me)

ankerman
New user
Posts: 5
Joined: 03 Nov 2022, 19:47

Re: ITHO plugin

#7 Post by ankerman » 04 Nov 2022, 12:46

That will mean that there is now solution to trigger the ITHO fan from the "rules" in ESPEASY with the use of the "sendTo" command?
I know the ESP-Now fuctionality, but in that platform the ITHO plugin is not available as far as i know.
Anyhow, if p2p is depending on a working wifi connection, then i will make use of domoticz to trigger the ITHO fan.
BTW, the previous collection D had the ITHO plugin, but no servo functionality. Thats why i make use of the "ESP_Easy_mega_20211105_normal_ESP8266_4M1M-newlib" repository which has the ITHO and servo functionality included.
Thanks so far for your help in this.
Greetings,
Paul

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ITHO plugin

#8 Post by Ath » 04 Nov 2022, 14:11

ankerman wrote: 04 Nov 2022, 12:46 That will mean that there is now solution to trigger the ITHO fan from the "rules" in ESPEASY with the use of the "sendTo" command?
yes there is, but as said, for P2P functionality, WiFi connectivity is required.
ankerman wrote: 04 Nov 2022, 12:46 BTW, the previous collection D had the ITHO plugin, but no servo functionality. Thats why i make use of the "ESP_Easy_mega_20211105_normal_ESP8266_4M1M-newlib" repository which has the ITHO and servo functionality included.
That build is quite old, and explains why the default value using %eventvalue1|1% isn't working, as that wasn't coded yet, back then.
We have recently added also the Climate builds (but introduced after Release 20220809), that include everything related to climate, so also the Itho plugin is included there, as well as the Servo command.
A new release is anticipated 'Real Soon Now (c)' :lol: (still work is being done on stability), but you can download a recent mega merge-build from Github Actions, f.e. this one: https://github.com/letscontrolit/ESPEas ... 3392485951, that has all the latest changes up until today. You will need a (free) Github account (and logged in) to be able to download the binaries.zip file.
/Ton (PayPal.me)

ankerman
New user
Posts: 5
Joined: 03 Nov 2022, 19:47

Re: ITHO plugin

#9 Post by ankerman » 04 Nov 2022, 17:22

Ath, TD-er,

Let me start to thank you for all your effort you put into my basic questions, it is much appriciated.
I will try the latest version as advised.
Hopefully the proposed code will do the job, i wil reply with the result.
Many thanks again.

ankerman
New user
Posts: 5
Joined: 03 Nov 2022, 19:47

Re: ITHO plugin

#10 Post by ankerman » 06 Nov 2022, 19:31

Tried the mega merge-build climate.
unfortunately the esp 8266 hangs when the itho device is enabled.
Tried several times, unchecked I2C and checked correct GPIO's
Went back to "ESP_Easy_mega_20211105_normal_ESP8266_4M1M-newlib" and have things working now.
Removing the "|1" in the statement "state,%eventvalue|1%" was enough.
Itho fan and both servo's seems to work ok.

Loekie63
New user
Posts: 5
Joined: 17 Nov 2020, 19:30
Location: NL

Re: ITHO plugin

#11 Post by Loekie63 » 22 Jan 2024, 14:07

Let me start to thank you for the great work put in to this project. I Used the ESPEASY version on a NodeMCU and after fiddeling with the rules as I have a wireless control with low / auto / high and the Temporary button, it works and shows when commands are beïng sent with the remote I got with my Itho and Actions sent with Domoticz. I was wondering, when my Itho (CVE-S-ECO SE) is on Auto no signals are sent but when moisture is sensed with the onboard sensor and the Fan spins up to High, is it possible to have that change in Domoticz to?

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ITHO plugin

#12 Post by Ath » 22 Jan 2024, 14:55

I suspect that that status isn't sent out by the unit, as it would/should have been picked up by ESPEasy.
But it could also be a status that's not (yet) recognized by ESPEasy. Can you collect some logging from when that status change is happening? You will need to turn on the "Enable minimal RF INFO log" option for the task in ESPEasy. You can view the log either from the serial log, via the USB port on the NodeMCU, or via the Web log on the Tools page.
/Ton (PayPal.me)

Loekie63
New user
Posts: 5
Joined: 17 Nov 2020, 19:30
Location: NL

Re: ITHO plugin

#13 Post by Loekie63 » 23 Jan 2024, 09:00

I tested last night and used the plugin log to check for entries but found none except for status and some other remotes. I am short of time and would like to send you my setup. Is it a good idea to copy that here or is there an other way? PM for instance and show the parts that are interesting for the community later and organised here.

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ITHO plugin

#14 Post by Ath » 23 Jan 2024, 09:10

I assume you triggered the high-humidity state, so the fan went to High speed mode.
If it's not in the RF log, then it most likely isn't sent via RF by the unit, so there's no way of catching that :o
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 23 guests