Emoncms Integration with vThing - Air Monitors (CO2, Dust, Temperature, Light)

Great :slight_smile:

It is indeed possible to power directly the device with 5v (or even 3.3v), so you will not need to do it necessary via the USB cable

Thanks for the reply, I’d already ordered two Si7021 just in case :slight_smile:

I think I’ll need to pickup some power banks, as the one we have is only 2800mAh, so with an average consumption of 10mAh it won’t last two weeks.
I’ll have a look for ones that allow to go to sleep.

Look forward to receiving them and integrating them with emoncms!

@Vladimir_Savchenko sent me a CO2 unit to test. Posting to Emoncms works great :thumbsup:

Config is done via a ChromeApp which then communicates with the device via serial

By default (if ‘host’ is left blank) the Emoncms integration posts to Emoncms.org. See example below setting the ‘Host’ to post to a local emonPi Emoncms

I also tested MQTT wich also worked great. Posting data via MQTT is supported on the emonPi and would be my preferred way to post data to local emonPi Emoncms, as it’s easier to share the data between other services e.g openHAB. Using emon as the base-topic the MQTT messages are automatically converted to Emoncms inputs on the emonPi

1 Like

Thanks @Vladimir_Savchenko received them the other week and got them feeding data back to emonhub perfectly!

I am having this exact issue with one of the power banks, but not sure where I can configure this, is it in the vThings - Device Configuration Tool?
All I can see in Settings is Update Interval, but I’ve no idea what point this power bank shuts down.

Thanks

hmmm, you can try updating to the latest firmware (from the settings menu), but i belive i added this longer time ago
in general the device wakes up every 30 seconds by default, for 1-2 seconds and then goes to sleep.
you can try to increase the update interval to 30 seconds - then it will wake up for ~8 seconds, and see if this will keep the powerbank alive - then each time it wakes up, it will also send data

Hi Guys,

I just wanted to remind you that there is 1 week (until 15.Jan (next Sunday)) time remaining until the end of the promotion.

In addition i’ve been quite busy with the firmware this Christmas so the latest firmware will add a couple new features:

  1. Complete configuration and setup over WiFi, no more USB Connection is required
  2. The build int Light Sensor is now active. It is just analog, so no output in LUX, but you can measure if it is dark or light or somewhere in between
  3. Slightly larger enclosures as heat emission from the ICs could not be avoided via software :frowning:

Regards. Vladimir

1 Like

Hi.
I buy an v.air monitor with temperature, humidity and CO2 (CM1106), and I am trying to send the information to my EmonHub via MQTT.
I write in the vThings device configuration tool
emon/vthings/temp:%TEMP%
emon/vthings/co2:%CO2%
emon/vthings/hum:%HUM%

and when I tested only send the last line, (in this case Humidity).
It is necesary to add something like & or {} or “”

Thanks in advance!

Hi German,

Could you send me in a Private Message the log from the device when it is sending the data

Thanks, Vladimir

Providing there is no sensitive data, it would be nice to try and keep the info in the forum so that the thread is complete (doesn’t just jump from “I’ve got a problem” to “thanks it’s sorted”) then others can benefit from the support and we can also, all get some insight into how the device works and integrates with emoncms.

yeah… of course, just that there are some URLs and IPs in the log files, which might be considered private, this is why i mentioned the private message. Of course in any case i would post later some details, once the issue is resolved

This is the log file:

---Sending data---
CustomHTTPDest::process]
[Calling HTTP: [http://192.168.43.74/emoncms/input/post.json?node=vthings&json={Co2:564}&apikey=abc123]]
[Error Code: -1 = connection refused
Failed
Response Code: -1]
[Calling HTTP: [http://192.168.0.101/emoncms/input/post.json?json={co2vair:564,tempvair:22.58,humvair:59.30,press:%PRES%,pm25:%PM25%,pm10:%PM10%,lux:%LUX%}&apikey=def456]]
[CLOSED
Response Code: 401]
[CustomHTTP : 9214ms
SerialDumpDest::process
IP	: 192.168.0.104
CHIPID	: 1337A6
RUNTIME	: 433
GMTTIME	: 4294967295
RSSI	: -63
CO2	: 564
TEMP	: 22.58
TEMPR	: 23.18
HUM	: 59.30
SerialDump : 192ms
MQTTDest::process]
[Sending via MQTT: 192.168.0.101,1883]
[Connecting to server :vESPrino,emonpi,emonpimqtt2016
MQTT Connected]
[Mqtt Dest: sending: to topic:emon/vthings1/temp, msg: 22.58]
[Mqtt Dest: sending: to topic:emon/vthings1/co2, msg: 564]
[Mqtt Dest: sending: to topic:emon/vthings1/hum, msg: 59.30]
[MQTT : 1346ms
RFDest::process
RFX10 : 0ms
Blynk : 0ms
RGBLed : 0ms]

With this file, I only see the humidity value of 59.3

Thanks in advance!

[edit - fudged 2x apikeys, they were not the same so “fudged” them differently - pb66]

hmm this is weird, seems like the MQTT sending complets w/o errors
if you try to send only temp or co2, does it succeed?
have you made sure that they are correctly configured in emocms?
And eventually test it standalone ?

mosquitto_pub -u 'emonpi' -P 'emonpimqtt2016' -t 'emon/vthings1/co2' -m '1234'

You should also try seeing if all the values are available via MQTT using

mosquitto_sub -v -u 'emonpi' -P 'emonpimqtt2016' -t 'emon/vthings1/#'

If they are, try rebooting the emonPi (see the “Newly created inputs not appearing in emonCMS via MQTT” thread) or maybe restarting just the mqtt service (See the “MQTT Strangeness” thread).

I think I have the correct configuration of the v.air monitor because it sends correctly one value. But in the example of MQTT configuration explains:

data/temp:%TEMP%
domoticz/in:{key:"%TEMP%", key2: "%HUM%"}

and I don´t know if the correct code are:

emon/vthings/temp:%TEMP%
emon/vthings/co2:%CO2%
emon/vthings/hum:%HUM%

or

emon/vthings:{temp":%TEMP%",co2:"%CO2%",hum:"%HUM%"} 

or other…

Because, the last one do not run,

with only a sentence (emon/vthings/temp:%TEMP%)
works fine

and with the three sentences I only see the last one, as if v.air overwrite the data.

I will try mosquito.
Thanks

maybe you can try also the log file, to see what arrives there
$ tail /var/log/emonhub/emonhub.log
in general this is the correct way of sending multiple values, and the fact that in the device log there is

MQTT Connected]
[Mqtt Dest: sending: to topic:emon/vthings1/temp, msg: 22.58]
[Mqtt Dest: sending: to topic:emon/vthings1/co2, msg: 564]
[Mqtt Dest: sending: to topic:emon/vthings1/hum, msg: 59.30]
[MQTT : 1346ms

means that they have been parsed and the messages sent
what is more weird, is that you are receiving the “hum” value, but not the others

If you are publishing to emoncms directly there will be no related info in emonhub.log as it is not part of the route and therefore unaware of that traffic.

That’s precisely why I suggested checking the published MQTT via the commandline, there is a known issue with the mqtt input to emoncms, If the Pi has not been rebooted, this behaviour is unsurprising, See the first link I posted, the issue is comprehensively documented and as yet unresolved.

This issue is not unique to the vThing!

yeah, i supposed that German tried it after you mentioned, but maybe he hasn’t yet checked it

Finally I solve this issue using HTTP instead of MQTT.
With MQTT I think that each line overwrites the previous line, and with the correct configuration of HTTP works fine.

Thanks a lot for your comments. It is a pity that I not have been able to configure the device with MQTT :sweat:

Mine run fine. Have you updated the firmware as there were some bugs in it.

I really wish this project were still going.
I need multiple WIFI based devices (20+) to log temperature across a large estate so we can match mechanical systems energy usage to environmental data and refine our HVAC scheduling/programming.