Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon connects and collects data but does not publish to openhab #147

Open
boilermanc opened this issue Oct 13, 2021 · 3 comments
Open

Comments

@boilermanc
Copy link

boilermanc commented Oct 13, 2021

Hi all, I posted this on the openhab forum but thought I would add this over here since its miflora specific.

I had this setup running just fine and then literally it just stopped updating. I’ll explain…

I have two pi’s running. One is the main pi and then one in a greenhouse (right next door) that is a pi zero. The pi zero just has the mqtt and miflora setup. It connects to the sensors and sends the data through mqtt just fine. it publishes to the same ip/broker as the main pi.

[2021-10-13 11:52:10] Connecting to MQTT broker ...
[2021-10-13 11:52:10] MQTT connection established

Adding sensor to device list and testing connection ...
Name:          "Sensor1"
Internal name: "Sensor1"
Device name:   "Flower care"
MAC address:   C4:7C:8D:67:59:ED
Firmware:      3.3.1
[2021-10-13 11:52:13] Initial connection to Mi Flora sensor "Sensor1" (C4:7C:8D:67:59:ED) successful

Adding sensor to device list and testing connection ...
Name:          "Sensor4"
Internal name: "Sensor4"
Device name:   "Flower care"
MAC address:   C4:7C:8D:67:5B:1F
Firmware:      3.3.1
[2021-10-13 11:52:16] Initial connection to Mi Flora sensor "Sensor4" (C4:7C:8D:67:5B:1F) successful

[2021-10-13 11:52:16] Announcing Mi Flora devices to MQTT broker for auto-discovery ...

[2021-10-13 11:52:16] Retrieving data from sensor "Sensor1" ...
[2021-10-13 11:52:25] Result: {"light": 95, "temperature": 14.6, "moisture": 7, "conductivity": 0, "battery": 100}
[2021-10-13 11:52:25] Publishing to MQTT topic "miflora/Sensor1"

[2021-10-13 11:52:26] Retrieving data from sensor "Sensor4" ...
[2021-10-13 11:52:30] Result: {"light": 3, "temperature": 14.6, "moisture": 14, "conductivity": 47, "battery": 45}
[2021-10-13 11:52:30] Publishing to MQTT topic "miflora/Sensor4"`

Nothing is showing in the log for the pi zero. Earlier I would get the confirmation that the message had come across like this:

2021-10-12 14:53:02.208 [INFO ] [openhab.event.ChannelTriggeredEvent ] - mqtt:broker:b57b164b67:sensor_4 triggered {"light": 902, "temperature": 17.9, "moisture": 0, "conductivity": 0, "battery": 100}
2021-10-12 14:53:02.231 [INFO ] [openhab.event.ChannelTriggeredEvent ] - mqtt:broker:b57b164b67:sensor_1 triggered {"light": 902, "temperature": 17.9, "moisture": 0, "conductivity": 0, "battery": 100}

Those numbers look the same because I had the same topic setup. Now fixed.

On the pi zero the mqtt broker is online and i have two channels, Sensor 1 and Sensor 2. They are both setup as “Triggers” and publish to a topic like this:

mqtt:broker:b57b164b67:sensor_4

topic: miflora/Sensor4

when that publishes of course it is on the same mqtt broker as the main pi and I have all my channels and things setup there to publish to a sitemap. again, all that worked fine. yesterday afternoon it just stopped publishing the updates to the pi zero log. I rebooted no joy. i test whether the miflora is running it is as you see in the log above but it does not publish in the openhab log and nothing is updating in the sitemap. Its like its running on the pi just publishing but not transitioning to openhab for lack of better description.

I have tried various reboot timings to see if something is not syncing. I think at a minimum I should be seeing the updates in pi zero log but nada.

thoughts?

thanks!

@ThomDietrich
Copy link
Owner

Hey @boilermanc thanks for the detailed description. It didn't become clear whether you actually checked your mqtt broker. I love mqtt as it creates a very transparent interface between two systems. Use MQTT Explorer or any other client to connect to you broker and have a look at messages. If the sensor_4 messages are published, something is wrong with your openHAB setup, if the messages do not appear this is a miflora-mqtt-daemon issue.

Good luck!

@boilermanc
Copy link
Author

Hey @ThomDietrich thanks for getting back to me!

I ran MQTT Explorer and this is what is in the history.

{"Sensor4": {"name_pretty": "Sensor4", "mac": "C4:7C:8D:67:5B:1F", "refresh": 300, "location_clean": "", "location_pretty": "", "firmware": "0.0.0", "topic": "miflora/Sensor4"}, "Sensor1": {"name_pretty": "Sensor1", "mac": "C4:7C:8D:67:59:ED", "refresh": 300, "location_clean": "", "location_pretty": "", "firmware": "0.0.0", "topic": "miflora/Sensor1"}}

That looks all good. I am seeing Sensor 1 update now but Sensor 4 is not. I have gone through the configs and just not seeing where a difference would be. Sensor 4 look like it is connecting to the mqtt and publishing but oh is just no picking up.

@boilermanc
Copy link
Author

Hey Thomas, I decided to shut down the pi zero and bring the sensors in to where the main pi is. They work fine there. Thinking there may be an issue with the zero so will rebuild and see what happens. Will keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants