agileek / airgradienthomeassistant Goto Github PK
View Code? Open in Web Editor NEWPublish AirGradient to Home Assistant through MQTT
License: MIT License
Publish AirGradient to Home Assistant through MQTT
License: MIT License
Running into an issue around invalid conversions. Not sure if I have a newer and more strict version of Arduino? Or is there a permissive flag I can set to make this work?
Arduino: 1.8.19 (Mac OS X), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
/Users/dalan/repos/AirGradientHomeAssistant/AirGradientHomeAssistant.ino: In function 'void loop()':
AirGradientHomeAssistant:173:22: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
173 | MQTT_PM2_5.setValue(PM2);
| ^~~
| |
| int
In file included from /Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/ArduinoHA.h:19,
from /Users/dalan/repos/AirGradientHomeAssistant/AirGradientHomeAssistant.ino:43:
/Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/device-types/HASensor.h:33:31: note: initializing argument 1 of 'bool HASensor::setValue(const char*)'
33 | bool setValue(const char* value);
| ~~~~~~~~~~~~^~~~~
AirGradientHomeAssistant:176:20: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
176 | MQTT_CO2.setValue(CO2);
| ^~~
| |
| int
In file included from /Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/ArduinoHA.h:19,
from /Users/dalan/repos/AirGradientHomeAssistant/AirGradientHomeAssistant.ino:43:
/Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/device-types/HASensor.h:33:31: note: initializing argument 1 of 'bool HASensor::setValue(const char*)'
33 | bool setValue(const char* value);
| ~~~~~~~~~~~~^~~~~
AirGradientHomeAssistant:179:28: error: cannot convert 'float' to 'const char*'
179 | MQTT_temperature.setValue(caliTemp);
| ^~~~~~~~
| |
| float
In file included from /Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/ArduinoHA.h:19,
from /Users/dalan/repos/AirGradientHomeAssistant/AirGradientHomeAssistant.ino:43:
/Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/device-types/HASensor.h:33:31: note: initializing argument 1 of 'bool HASensor::setValue(const char*)'
33 | bool setValue(const char* value);
| ~~~~~~~~~~~~^~~~~
AirGradientHomeAssistant:180:32: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
180 | MQTT_humidity.setValue(result.rh);
| ~~~~~~~^~
| |
| int
In file included from /Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/ArduinoHA.h:19,
from /Users/dalan/repos/AirGradientHomeAssistant/AirGradientHomeAssistant.ino:43:
/Users/dalan/Documents/Arduino/libraries/home-assistant-integration/src/device-types/HASensor.h:33:31: note: initializing argument 1 of 'bool HASensor::setValue(const char*)'
33 | bool setValue(const char* value);
| ~~~~~~~~~~~~^~~~~
exit status 1
invalid conversion from 'int' to 'const char*' [-fpermissive]
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Installed libraries
Name Installed Available Location Description
AirGradient Air Quality Sensor 2.0.2 - LIBRARY_LOCATION_USER -
ESP8266 and ESP32 OLED driver for SSD1306 displays 4.3.0 - LIBRARY_LOCATION_USER -
home-assistant-integration 2.0.0 - LIBRARY_LOCATION_USER -
PubSubClient 2.8 - LIBRARY_LOCATION_USER -
SGP30 0.1.5 - LIBRARY_LOCATION_USER -
U8g2 2.33.15 - LIBRARY_LOCATION_USER -
WiFiManager 2.0.14-beta - LIBRARY_LOCATION_USER -
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.