BMx/BMP rules problem

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

BMx/BMP rules problem

#1 Post by mackowiakp » 10 Feb 2023, 15:51

FW custom compilation based on ESPEasy-mega-20221224.
I have sensor labeled as BMP/BME280 which is in fact BMP280.
There is a strange problem with the EVENT's rules generated by this sensor.
2 devices are defined to support this sensor. Of course, only one of them is enabled at a time.
Screenshot_20230210_083431.png
Screenshot_20230210_083431.png (118.58 KiB) Viewed 973 times
Also, I only need a pressure reading.
Due to the fact that some sensors can give an abstract result once every few hundred readings (e.g. pressure 3500 hPa), before sending it to Domoticz I check whether the reading is "reasonable". This is done using rules:

Code: Select all

On Temp+Baro#Pressure do
 If [Temp+Baro#Pressure] < 1100 and [Temp+Baro#Pressure] > 910
  SendToHTTP,192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=133&nvalue=0&svalue=[Temp+Baro#Pressure]
 endif
endon
If the BMx280 driver is used, everything is OK and the readout logs look like this:

Code: Select all

3209648: BMP280 : Address: 0x76
3209650: BMP280 : Temperature: 23.78
3209652: BMP280 : Barometric Pressure: 1005
3209673: EVENT: Temp+Baro#Temperature=24.28
3209693: EVENT: Temp+Baro#Humidity=0.00
3209715: EVENT: Temp+Baro#Pressure=1007
3209744: ACT : SendToHTTP,192.168.0.25,8080,/json.htm?type=command¶m=udevice&idx=133&nvalue=0&svalue=1007
3209787: HTTP : SendToHTTP 192.168.0.25 GET... HTTP code: 200
But if the "native" driver for this sensor (BMP280) is used, the reading is not sent to Domoticz and the logs contain the following error:

Code: Select all

747425: BMP280 : Address: 0x76
3747428: BMP280 : Temperature: 23.74
3747430: BMP280 : Barometric Pressure: 1005
3747448: EVENT: Temp+Baro#Temperature=24.24
3747468: EVENT: Temp+Baro#Pressure=1007
3747484: Calculate: Unknown token input: < 1100 and = 0
Whats is wrong? Maybe my mistake or so?

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

Re: BMx/BMP rules problem

#2 Post by Ath » 10 Feb 2023, 16:22

mackowiakp wrote: 10 Feb 2023, 15:51 Whats is wrong? Maybe my mistake or so?
Depending on the build you use, there could have been a warning when saving the device settings that the Temp+Baro name for the device is unsupported. Removing the + from the name will probably improve things much.

Another improvement would be to use the %eventvalue1% event argument:

Code: Select all

On TempBaro#Pressure do
  If %eventvalue1% < 1100 and %eventvalue1% > 910
    SendToHTTP,192.168.0.25,8080,/json.htm?type=command&param=udevice&idx=133&nvalue=0&svalue=%eventvalue1%
  Endif
Endon
(The %eventvalueN% variables will be the value at the time the event was generated, not the current, possibly already changed because of processing delays, value, see: https://espeasy.readthedocs.io/en/lates ... eventvalue)
/Ton (PayPal.me)

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

Re: BMx/BMP rules problem

#3 Post by TD-er » 10 Feb 2023, 16:23

I thought the old BMP280 plugin was disabled in the current builds as the BMx280 plugin does it all?
Apparently not... however this plugin hasn't been touched for years as I thought it was already no longer available in builds.

I will check later this event as there really should not be any use for this plugin anymore.

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

Re: BMx/BMP rules problem

#4 Post by Ath » 10 Feb 2023, 16:26

This is a Custom build, the plugin is marked as Retired in the Plugin overview
/Ton (PayPal.me)

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: BMx/BMP rules problem

#5 Post by mackowiakp » 10 Feb 2023, 16:29

The BMP280 driver is available in ESPEasy-mega-20221224 as _P030_BMP280.ino and I just added it to Custom.h.

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

Re: BMx/BMP rules problem

#6 Post by TD-er » 10 Feb 2023, 16:31

The file may still be available, but it is not being used in any build anymore and as I said the file hasn't been updated for years.

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: BMx/BMP rules problem

#7 Post by mackowiakp » 10 Feb 2023, 16:46

OK, THX. Its clear.

Post Reply

Who is online

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