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

MQTT support #12

Open
P1-Ro opened this issue Nov 6, 2023 · 3 comments
Open

MQTT support #12

P1-Ro opened this issue Nov 6, 2023 · 3 comments

Comments

@P1-Ro
Copy link

P1-Ro commented Nov 6, 2023

I found this on Tindie and I am extremely interested.

Would it be possible to add MQTT support? That way it could be easily connected to Home Assistant.
It could work or example something like this: when screen information refreshes, check if mqtt is configured, if yes then publish message to it.

@davidkreidler
Copy link
Owner

davidkreidler commented Nov 6, 2023

Hello @P1-Ro & thank you for reaching out regarding this.
Generally MQTT support is implemented but not jet fully validated.
I would appreciate your support regarding this a lot.

Currently its enabled via a special firmware or via your own build by enabling it here: https://github.com/davidkreidler/OpenCO2_Sensor/blob/main/OpenCO2_Sensor.ino#L40C10-L40C10
Please then also comment out "#define airgradient" and use esp board version 2.0.13

How to install it:

  1. Download "OpenCO2_Sensor.ino.bin" from https://drive.google.com/file/d/1W8UEv53j-Czv9JsQuHC9AA_DrWFvl-n6/view?usp=sharing
  2. Connect Power to the Sensor and enable WiFi via the Menu on the OpenCO2 Sensor. Then connect a client to the new WiFi Network "OpenCO2 Sensor".
  3. Navigate in your Webbrowser to http://192.168.4.1 (It also opens automatically on modern smartphones)
  4. Under Update select the OpenCO2_Sensor.ino.bin file and click Update. The Sensor will restart.

Connect again to the "OpenCO2 Sensor" network and insert your home network credentials and MQTT settings under "Configure WiFi".
mqtt

@P1-Ro
Copy link
Author

P1-Ro commented Nov 8, 2023

Super stoked about that. I'll let you know when I have time to play with it :)

@ThomasWaldmann
Copy link
Contributor

ThomasWaldmann commented May 7, 2024

Currently playing around with the MQTT enabled firmware, but already run into a problem:

The device was previously joined to a WiFi (so it does not open its own AP and show up under 192.168.4.1 any more), but I can ping its home wifi client IP.

How do I get the WiFiManager configuration web form now to enter the MQTT data? It does not seem to listen on port 80.

Update: found it out: one can erase all the flash via the arduino IDE option, then, after enabling WiFi via the OpenCO2 menu, it will start from scratch.

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

3 participants