Page 2 of 2

Re: Ikea vindriktning air quality sensor

Posted: Friday 20 August 2021 15:43
by mastadook
waltervl wrote: Friday 20 August 2021 15:32 Why do you do that in dzVents?
You can do this directly from the code on the Wemos/Arduino/8622 D1 mini etc.
So have the code send the MQTT message for the custom sensor and have the code send an MQTT message for the alert sensor
Should be something like
{"idx":4095,"nvalue":0,"svalue":"90.00"} -- Custom sensor with value = 90.00
{"idx":201,"nvalue":"4","svalue":"Value 90 - Bad Air Quality"} -- Alert Sensor Red sign with text: "Value 90 - Bad Air Quality"
Sorry, I have no Idea how to change the Arduino File to send this additional message when Data between different Values...

Re: Ikea vindriktning air quality sensor

Posted: Friday 20 August 2021 15:52
by waltervl
OK in dzvents, if you use a custom sensor you have to use .sensorValue to get the value. It is already a number.
Try the code below and change

Code: Select all

Altertidx = 20378 -- modify to your idx 

return {
	active = true,
	
	 on = { devices = {  'Feinstaubsensor EG'}},

	execute = function(domoticz, device, email)

if      domoticz.devices('Feinstaubsensor EG').sensorValue <= 35 then domoticz.devices(Alertidx).updateAlertSensor(domoticz.ALERTLEVEL_GREEN, 'gering keine besonderen Maßnahmen nötig')
elseif  domoticz.devices('Feinstaubsensor EG').sensorValue > 36 < 85 then domoticz.devices(Alertidx).updateAlertSensor(domoticz.ALERTLEVEL_YELLOW, 'your yellow warning text....')
elseif  domoticz.devices('Feinstaubsensor EG').sensorValue >= 86 then domoticz.devices(Alertidx).updateAlertSensor(domoticz.ALERTLEVEL_RED, 'your red warning text....')
end
end
    }

Re: Ikea vindriktning air quality sensor

Posted: Wednesday 01 September 2021 14:33
by eleutscher
Hai,

As a total Arduino Noob ;-) I tried upload the code, changes the requirements and did an Verify/Compile.
I then get these errors

Vindriktning_for_Domoticz_using_esp8266_mqtt_master:72:5: error: 'SerialCom' has not been declared
72 | SerialCom::setup();

and

Vindriktning_for_Domoticz_using_esp8266_mqtt_master:90:3: error: 'SerialCom' has not been declared
90 | SerialCom::handleUart(state);

What am I doing wrong?

I use the Wemos D1 mini v2. I can upload an example from Arduino like blink the led without any issue.

Thx in advance, Erik

Re: Ikea vindriktning air quality sensor

Posted: Wednesday 01 September 2021 14:46
by waltervl
did you save the other files in the src folder (like SerialCom.h) to the same folder as were the .ino file is?
https://github.com/marceldbo/VINDRIKTNI ... e/main/src

Re: Ikea vindriktning air quality sensor

Posted: Wednesday 01 September 2021 15:19
by eleutscher
Yes! That did the trick. Thx. :-)

Re: Ikea vindriktning air quality sensor

Posted: Tuesday 28 September 2021 13:28
by purplepumpkin
Not sure whats wrong with my setup. Still zeroes in Domoticz, but payload seems fine, Idx 10 filled in at two places in code.
Any tips please? :)
Screenshot 2021-09-28 at 13.24.38.png
Screenshot 2021-09-28 at 13.24.38.png (14.69 KiB) Viewed 1343 times
Screenshot 2021-09-28 at 13.25.47.png
Screenshot 2021-09-28 at 13.25.47.png (16.85 KiB) Viewed 1343 times
I made my mh-z19 sensor work with ESPEasy, it propagates to domoti idx well via HTTP controller.
I'm not sure if I can use ESPEasy for ikea sensor as well. Since I want it all in one box.

Code it is probably better way to get all values I want from two sensors and maybe have json dict with measurements api exposed.
Does it worth to make my arduino speak micropython for this purpose? Not familar with arduino syntax.
Also I'm wondering what difference is between MQTT/HTTP for domoticz use?

Re: Ikea vindriktning air quality sensor

Posted: Wednesday 22 December 2021 15:03
by Creaky
To find out what the difference in measurements is between a normal sensor and the sensor with the low noise mod, I've connected both setups and physically placed them right next to each other. Since the atmospheric circumstances are identical it gives me the exact difference in measurements.
After 24 hours of comparing the low noise modded sensor with the original sensor, I can conclude that the difference ratio between the two is ~1.82. So the 'real' value is the value of the low noise modded sensor times 1.82.

comparison chart modded - not modded 2021-12-22 144950.jpg
comparison chart modded - not modded 2021-12-22 144950.jpg (129.22 KiB) Viewed 1160 times