Presence detection, BLE, mi flora, RF gateway with ESP32, OpenMQTTGateway is now compatible

Hi,

these messages has been avoided with the current dev branch, you can download it if you want to confirm.

I suggest to test the dev branch and see if they still appears

Ok I started testing. Am I wrong or the discovery feature for mi Flora sensor is not there anymore?

With the dev branch you should have it.

I let the gateway on for all the afternoon after flash.

The old sensor (same MAC adress) are not populated anymore.

No new sensor have been discovered while it is present in mqtt log

And did you uncommented zmqttdiscovery in user_config.h ?

uhm, well. No.

OPS!

And all plants are back!

But I think there’s still something to fix.

Here’s a error example in the log:

Tue Apr 02 2019 09:40:04 GMT+0200 (Central European Summer Time)
Error doing job: Exception in callback <function async_track_state_change..state_change_listener at 0x7f5e4dc0b378>
Traceback (most recent call last):
File “uvloop/cbhandles.pyx”, line 64, in uvloop.loop.Handle._run
File “/usr/src/app/homeassistant/helpers/event.py”, line 82, in state_change_listener
event.data.get(‘new_state’))
File “/usr/src/app/homeassistant/core.py”, line 333, in async_run_job
target(*args)
File “/usr/src/app/homeassistant/components/plant/init.py”, line 203, in state_changed
self._brightness = int(float(value))
ValueError: could not convert string to float:

Tue Apr 02 2019 09:39:22 GMT+0200 (Central European Summer Time)
Error doing job: Exception in callback <function async_track_state_change..state_change_listener at 0x7f5e4dc0b9d8>
Traceback (most recent call last):
File “uvloop/cbhandles.pyx”, line 64, in uvloop.loop.Handle._run
File “/usr/src/app/homeassistant/helpers/event.py”, line 82, in state_change_listener
event.data.get(‘new_state’))
File “/usr/src/app/homeassistant/core.py”, line 333, in async_run_job
target(*args)
File “/usr/src/app/homeassistant/components/plant/init.py”, line 201, in state_changed
self._conductivity = int(float(value))
ValueError: could not convert string to float:

Tue Apr 02 2019 09:39:01 GMT+0200 (Central European Summer Time)
Error doing job: Exception in callback <function async_track_state_change..state_change_listener at 0x7f5e4dc0b378>
Traceback (most recent call last):
File “uvloop/cbhandles.pyx”, line 64, in uvloop.loop.Handle._run
File “/usr/src/app/homeassistant/helpers/event.py”, line 82, in state_change_listener
event.data.get(‘new_state’))
File “/usr/src/app/homeassistant/core.py”, line 333, in async_run_job
target(*args)
File “/usr/src/app/homeassistant/components/plant/init.py”, line 195, in state_changed
self._moisture = int(float(value))
ValueError: could not convert string to float:

Take maybe the last development version, I corrected the format of sensor values.

I have the same errors showing in 0.92.x, the following appears multiple times for various plant states:

Error doing job: Exception in callback async_track_state_change.<locals>.state_change_listener(<Event state_...172392+01:00>>) at /usr/src/app/homeassistant/helpers/event.py:64
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/app/homeassistant/helpers/event.py", line 82, in state_change_listener
    event.data.get('new_state'))
  File "/usr/src/app/homeassistant/core.py", line 333, in async_run_job
    target(*args)
  File "/usr/src/app/homeassistant/components/plant/__init__.py", line 193, in state_changed
    self._moisture = int(float(value))
ValueError: could not convert string to float: 'unavailable'

Could you give the version of OMG used ?

Sorry OMG?

Openmqttgateway ; -)

Sorry I get mi flora data via ESPhome https://esphome.io/components/sensor/xiaomi_miflora.html?highlight=miflora

Not the good thread in this case : -)

But the error is the same?

Yes, and it has been corrected on the last OMG version.

Just integrated the Xiaomi clock, temperature and humidity sensor to OMG:
http://s.click.aliexpress.com/e/cEYIxDVI

It is now working if you take the dev branch.

Hello,

Xiaomi scale v1 can now be read by Openmqttgateway on this test branch :
https://github.com/1technophile/OpenMQTTGateway/tree/ble-scale?files=1

I have added also Xiaomi Scale V2 but I would like an owner to test the data reception of weight and impedance before merging the code.
Do we have the chance to have a V2 owner that would like to test OMG on an esp32 or arduino + hm10 ?

Hi folks
Can you guys recommend the best device to use with OMG for HA. I mostly use the BLE tracker for presence detection. This is working very well but will need to be restarted once a week or so. This can be annoying when I arrive home and my alarm doesn’t disarm.
I also have 6 mifloras that cause issues with HA running on my Pi 3b+, so I have stopped monitoring them for the moment.
I had planned on using a couple of ESP32 boards, but after reading through the thread, it seems like they might not be the most reliable.
I hope you guys can help me out
Thanks in advance

Hi,

Do you mean what is the best board to choose ? Esp32, arduino +hm10 or esp8266 + hm10 ?

There was some issues with esp32 stability in the past but there was a lot of progress done. Mine keeps stable during one month without problem.