Ikea vindriktning air quality sensor

Moderator: leecollings

mastadook
Posts: 58
Joined: Wednesday 18 April 2018 13:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Deutschland
Contact:

Re: Ikea vindriktning air quality sensor

Post 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...
________________________________________________________________________
global chief of permanent lightning and strike detonator
User avatar
waltervl
Posts: 5714
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Ikea vindriktning air quality sensor

Post 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
    }
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
eleutscher
Posts: 22
Joined: Thursday 15 November 2018 11:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ikea vindriktning air quality sensor

Post 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
Zigbee, KAKU, Hue, Google, Honeywell, MotionEye, Telegram, Tasmota, Shelly, IFTTT, etc
User avatar
waltervl
Posts: 5714
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Ikea vindriktning air quality sensor

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
eleutscher
Posts: 22
Joined: Thursday 15 November 2018 11:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ikea vindriktning air quality sensor

Post by eleutscher »

Yes! That did the trick. Thx. :-)
Zigbee, KAKU, Hue, Google, Honeywell, MotionEye, Telegram, Tasmota, Shelly, IFTTT, etc
purplepumpkin
Posts: 1
Joined: Tuesday 28 September 2021 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ikea vindriktning air quality sensor

Post 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 1293 times
Screenshot 2021-09-28 at 13.25.47.png
Screenshot 2021-09-28 at 13.25.47.png (16.85 KiB) Viewed 1293 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?
Creaky
Posts: 20
Joined: Monday 12 December 2016 15:45
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: NL
Contact:

Re: Ikea vindriktning air quality sensor

Post 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 1110 times
Greetz,

·´¯`·.¸¸.·´¯`·. ( Creaky ) .·´¯`·.¸¸.·´¯ `·
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest