Great, it seems to be working now and I’m getting data back. I’ll let you know if I still get any crazy results though
you updated to 38.1?
I updated to 38.1 then changed the miflora_poller file to the code linked above
Hi, so far so good. No spikes as of yet at least. Although I have noticed that over night the light sensor reports weird values. It seems to vary between 0 and about 20. That could well be the sensor itself though I suppose
@Danielhiversen
Since I put your code is not working.
I upgraded to 38.1 and not working, after changed to your latest code and still not working.
No data displayed
Any errors in the log?
Is the component working with default code (without my changes) ?
Upgrading to 38.1 did not over write your code?
Do not think so.
Ahh
Well so is still your code.
No error in log
This is what I mean about the odd light sensor readings. It seems to be in the same constant range all night, then a random spike to 400 at about 16:00
in configuration.yaml try:
logger:
logs:
miflora.miflora_poller: debug
homeassistant.components.sensor.miflora: debug
ValueError: Expecting value: line 1 column 1 (char 0)
17-02-15 21:08:20 DEBUG (Thread-3) [homeassistant.components.sensor.miflora] Polling data for Flower 1 Light intensity
17-02-15 21:08:20 DEBUG (Thread-3) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-3, started daemon 1955591264)>)
17-02-15 21:08:20 DEBUG (Thread-3) [miflora.miflora_poller] Created lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:08:20 DEBUG (Thread-3) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:08:29 ERROR (Thread-7) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.52:8080/status.json”
17-02-15 21:08:29 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:08:29 ERROR (Thread-8) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.50:8080/status.json”
17-02-15 21:08:29 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Released lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Got from gatttool
17-02-15 21:08:40 DEBUG (Thread-3) [miflora.miflora_poller] Waiting for 10 seconds before retrying
17-02-15 21:08:50 DEBUG (Thread-3) [miflora.miflora_poller] Created lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:08:50 DEBUG (Thread-3) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:08:59 ERROR (Thread-6) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.50:8080/status.json”
17-02-15 21:08:59 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Released lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Got from gatttool
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Waiting for 20 seconds before retrying
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Created lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:09:10 DEBUG (Thread-3) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:09:29 ERROR (Thread-8) [homeassistant.components.switch.command_line] Command failed: curl “http://192.168.1.50:8080/status.json”
17-02-15 21:09:29 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: ‘value_json’ is undefined (value: None, template: {{ value_json.curvals.torch == “on” }})
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Released lock in thread <Thread(Thread-3, started daemon 1955591264)>
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Got from gatttool
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Waiting for 20 seconds before retrying
17-02-15 21:09:30 DEBUG (Thread-3) [miflora.miflora_poller] Exit read_ble, no data (<Thread(Thread-3, started daemon 1955591264)>)
17-02-15 21:09:30 INFO (Thread-3) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] C4:7C:8D:61:7C:01
17-02-15 21:09:30 DEBUG (Thread-1) [homeassistant.components.sensor.miflora] Polling data for Flower 1 Temperature
17-02-15 21:09:30 DEBUG (Thread-1) [miflora.miflora_poller] Using cache (0:15:00.013710 < 0:20:00)
17-02-15 21:09:30 INFO (Thread-1) [homeassistant.components.sensor.miflora] Polling error [Errno Could not read data from Mi Flora sensor %s] C4:7C:8D:61:7C:01
17-02-15 21:09:30 DEBUG (Thread-8) [homeassistant.components.sensor.miflora] Polling data for Flower 1 Battery
17-02-15 21:09:30 DEBUG (Thread-8) [miflora.miflora_poller] Enter read_ble (<Thread(Thread-8, started daemon 1906308192)>)
17-02-15 21:09:30 DEBUG (Thread-8) [miflora.miflora_poller] Created lock in thread <Thread(Thread-8, started daemon 1906308192)>
17-02-15 21:09:30 DEBUG (Thread-8) [miflora.miflora_poller] Running gatttool with a timeout of 20
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Killed hanging gatttool
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Released lock in thread <Thread(Thread-8, started daemon 1906308192)>
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Got from gatttool
17-02-15 21:09:50 DEBUG (Thread-8) [miflora.miflora_poller] Waiting for 10 seconds before retrying
May I have the previous code?
FYI - These are on sale for $10 via email only special
Time to stock up!
It shows up at 12.89$ for me, and they always can be found for less than 10$ on Aliexpress :
Hi, huge fan and I just ordered four sticks
A couple of questions if someone can help out:
- When using multiple mi flora sticks, is there any other issue then that it takes time a bit extra time until all data are collected? (read something about locking…)
- I read something about using Razberry 2 disables bluetooth on the PI3, anyone know the case?
- Would it be possible using PI3 to setup another bluetooth USB adaptor, so it does not interfere with the tracker?
- IF there are issues, is that the case if you use a Z-wave usb stick like Aeon Labs 5gen (in conjunction with either PI3 bluetooth, or a separate bluetooth usb dongle)?
I can’t get it working anymore. How do you connect it to the HASS (I have mine on a pi3 with bluetooth, but is not picking any bluetooth signel from the miflora).
pi@raspberrypi:~ $ sudo hcitool lescan
Set scan parameters failed: Input/output error
pi@raspberrypi:~ $
- Yes, correct. I have several sensors and it is working fine.
3, Yes, from the latest release you can specify which Bluetooth adapter to use for each miflora device
From release 0.39 of HA the will be more failure check of the data: https://github.com/home-assistant/home-assistant/pull/6142
So it should be less change of getting invalid data from the sensors.