arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.97k stars 4.77k forks source link

Problem getting measured values in script from two BME280 sensors #20589

Closed JR777-1 closed 7 months ago

JR777-1 commented 7 months ago

PROBLEM DESCRIPTION

I'm using two BME280 devices with different addresss 0x76 and 0x77. The data from the sensors are displayed correctly on the webui. BME280-76 Temperature 22.2°C BME280-76 Humidity 39.8% ... BME280-77 Temperature 22.3°C BME280-77 Humidity 40.1% ...

This is working as expected.

So i want to use the measured values in my script. With two connected sensors the names shown when i read "Status 10" in console are "BME280-76" and "BME280-77". But i cannot get the values from the sensors with the code "temp=BME280-76#Temperature" or "temp=BME280-77#Temperature". I tried using the other index separator with SetOption64 1 without success. With only one connected sensor i get the values correctly using "temp=BME280#Temperature". Is there a bug getting the sensor values within a script?

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:

TO REPRODUCE

Steps to reproduce the behavior:

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

JR777-1 commented 7 months ago

Unbenannt

STATUS10 = {"StatusSNS":{"Time":"1970-01-01T00:42:34","BME280-76":{"Temperature":23.8,"Humidity":37.6,"DewPoint":8.4,"Pressure":996.0},"BME280-77":{"Temperature":23.1,"Humidity":35.2,"DewPoint":6.9,"Pressure":996.0},"BH1750":{"Illuminance":969},"SR04":{"Distance":22.8},"PressureUnit":"hPa","TempUnit":"C"}}

JR777-1 commented 7 months ago

Unbenannt The values temperature and humidity did not get the sensor values. The default values are 0.0 and they do not change.

sfromis commented 7 months ago

As the Scripter docs says:

Remark: JSON variable names (like all others) may not contain math operators like - , you should set SetOption64 1 to replace - (dash) with _ (underscore).

JR777-1 commented 7 months ago

As the Scripter docs says:

Remark: JSON variable names (like all others) may not contain math operators like - , you should set SetOption64 1 to replace - (dash) with _ (underscore).

So now i'm a little confused. I've already done this without getting the values (see first posting). Now set Option to 1 and it works. #confused But hey, thank you very much for your help Maybe this information will be helpful in the documentation, see https://tasmota.github.io/docs/BME280/