Yes a mqtt broker is needed. the miflora daemon collects the plant data and publishes it to a mqtt broker and to this mqtt broker openhab is connected.
In the openhabian image you will find a mqtt broker (mosquitto). If it is on the same host like the miflora daemon the localhost is ok. i am not sure about the default mqtt user that is installed in the openhabian package.
but when i try to load the item file it seems it is not working
2018-02-15 20:07:57.337 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'miflora.items'
2018-02-15 20:07:57.713 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'miflora.items'
2018-02-15 20:07:57.798 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'miflora.items'
2018-02-15 20:07:57.871 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
2018-02-15 20:07:57.875 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type JSONPATH
Feb 15 20:25:44 openHABianPi miflora-mqtt-daemon.py[29266]: connect error: Transport endpoint is not connected (107)
Is there something wrong with my mqtt.config?
#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
miflora.url=tcp://localhost:1883
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
miflora.clientId=miflora
# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
#<broker>.allowLongerClientIds=false
# Optional. User id to authenticate with the broker.
miflora.user=openhabian
# Optional. Password to authenticate with the broker.
miflora.pwd=testblabla
# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>
# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
#<broker>.retain=<retain>
# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
#<broker>.async=<async>
# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>
just to bring us in the same level. The broker ist in the middle and openhab and miflora are connecting to the broker. Based on this you need to understand that the mqtt binding establishes the connection between broker and openhab. If you restart openhab you should find some kind off connection message in the openhab log. Next part is then to connect miflora. It should be possible to use the same credentials as in opnehab. If you have success with that is shown within the miflora status.
To check if the broker is working you should use a tool like mqttspy. With this tool it is possible to establish ab connection to the broker and read all miflora readings.
Miflora ---- ------ Mqtt broker -------- openhab
So i think we should first check if the broker is running
setting up and working with MQTT is out of the scope of the daemon documentation but you should find everything you need to first make sure MQTT is up and running here:
@curlyel happy you got it working right away. The battery information would certainly be something we can add. Please create a GitHub issue! The battery use is something I never looked at closely but I’ve been polling my sensors at home for quite some time now and they report 90-something percent. I wonder if those readings are correct. @skatun do you know more?
Regarding signal quality: Please check the output of sudo systemctl status miflora.service, also there is the idea to enhance this: https://github.com/ThomDietrich/miflora-mqtt-daemon/issues/16
One of my miflora is down to 19% now! I bought it 26/10/2016 add 3 weeks for shipping from china, and we probably end up with 1.5-1.8 years of battery time at 20C
One thing @ThomDietrich I would like to mentioned what I recently implemented lately is this: Number Miflora_Sensor4_Moisture “Sensor4 Soil Moisture [%d %%]” <text> (gMiflora, Group_Moisture,Group_Moisture_LivingRoom) {mqtt="<[mosquitto:miflora/sensor4:state:JSONPATH($.moisture)]", expire=“1h” }
Which will tell me if i have not got an update from my sensor in the last hour! Works like a charm.
Also I know that the py script says something about signal strength, maybe we could also forward this info to the broker? And finally I were wondering if you do check if the sensor have changed its value(any of the 4 value it reports) from last reading or not, if it hasn’t the sensor needs to be reset.
In generally the connection miflora -> RasPi3 -> WLAN -> mqtt-broker -> OpenHAB works for me.
Credentials are correct.
But only ~3-4 packages per day are reaching the broker.
“sudo hcitool lescan” lists a lot of Bluetoothdevices but nearly never the miflora sensor.
Hello, just to let you know, I tried to install the Daemon directly from openhabian, with the optional component installation, but it didn’t work (something wrong with the colorama module in python).
for more details, see below
Excited to get this up and going. Want to use it in our greenhouse. Will be quite awesome to keep track of the state of our seedlings. I have two that I have used for some time on the android app but want to integrate into openhab. Having issues right off the bat though.
I’m on OH2.3 and raspi. Installed Bluez per the instructions. Checked I have version 5.43 running. When I run
sudo hcitool lescan
I get Set scan parameters failed: Input/output error. Did some reading but could not overcome that. Found an article here that uses the bluetoothctl to search for bluetooth. That worked in a sense. It finds the controller and says searching but never finds the sensor even though its right by the raspi. I have connect the sensor to my phone and it has the latest version of the plant care software running on it.
Thoughts on how to get them connected? Sounds like most people on here it just connects.
But I saw somewhere in old posts that they could see the connection quality. Was that taken out again?
It`s very hard for me to currently find out why it would not work through a window. It did sometimes and then all of a sudden it does not again?! Any idea?
What kind of window do you have. I am moving from the miflora daemon to the Bluetooth binding from @vkolotov and while this i regocnized that the sensore on our veranda are nearly never reached. In the blutooth diskussion some other people have the same problem. Modern Windows …