letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.22k stars 2.2k forks source link

NDIR sensor in relation to Domoticz controller #232

Open rvakkeren opened 7 years ago

rvakkeren commented 7 years ago

Steps to reproduce

Using ESP Easy with the NDIR MH-Z19 plugin

Expected behavior

Domoticz should be updated, but it only updates the sensor with a zero-value.

Actual behavior

The Domoticz API requires the following syntax for a Air Quality sensor "/json.htm?type=command&param=udevice&idx=IDX&nvalue=PPM".

Instead of a nvalue, a svalue is used by ESP Easy. That's why the data isn't processed in Domoticz.

psy0rz commented 7 years ago

i have this sensor myself and will test (and fix) this in the future.

remyderuysscher commented 6 years ago

Wow, this bug is pretty severe. Can't believe it's still open.

TD-er commented 6 years ago

If this is still an issue, I will write a fix for it. Is it an idea to add the option to select the output format?

TD-er commented 6 years ago

Just a question... Does the Senseair sensor work like expected? It looks like both Domoticz controllers output only "&svalue=" statements. Controller Plugin 001 (Domoticz HTTP) does not even contain the "nvalue" string. Controller Plugin 002 (Domoticz MQTT) does only output a '0' for "nvalue".

So this issue is bigger than only adding an option to a single plugin. It will be an extension to at least both Domoticz controllers and perhaps even others and IMHO is that something for after the 2.0 release.

@psy0rz and @Grovkillen Do you agree this is actually a totally different kind of bug?

Grovkillen commented 6 years ago

Yes I believe that this is a revamp of the way we need to publish to Domoticz. A thing for 2.1 for sure.

psy0rz commented 6 years ago

@remyderuysscher i'm indeed using this sensor myself, but i added it as "Custom sensor". Then it works without problems.

Maybe its enough to just update the documentation on the wiki to explain this?

remyderuysscher commented 6 years ago

I'm still not getting any reading in domoticz with a custom sensor type using the REST API. I compiled the the MEGA build from 29/10/2017. With plugin sets normal, testing and development on.

Grovkillen commented 6 years ago

Not with custom publish using rules either?

Den 21 nov. 2017 17:43 skrev "remyderuysscher" notifications@github.com:

I'm still not getting any reading in domoticz with a custom sensor type using the REST API.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/letscontrolit/ESPEasy/issues/232#issuecomment-346086689, or mute the thread https://github.com/notifications/unsubscribe-auth/AZeBYi9T6_3HEmuJ-zVY_PY7tyW57Gt2ks5s4v2WgaJpZM4NAYpU .

remyderuysscher commented 6 years ago

What kinds of rules should I be using?

On Tue, Nov 21, 2017 at 6:46 PM, Grovkillen notifications@github.com wrote:

Not with custom publish using rules either?

Den 21 nov. 2017 17:43 skrev "remyderuysscher" notifications@github.com:

I'm still not getting any reading in domoticz with a custom sensor type using the REST API.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/letscontrolit/ESPEasy/issues/ 232#issuecomment-346086689, or mute the thread https://github.com/notifications/unsubscribe-auth/AZeBYi9T6_3HEmuJ-zVY_ PY7tyW57Gt2ks5s4v2WgaJpZM4NAYpU .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/letscontrolit/ESPEasy/issues/232#issuecomment-346105796, or mute the thread https://github.com/notifications/unsubscribe-auth/ANVLNxsgjr6aUz01II1tYs1il_Jt--77ks5s4wx1gaJpZM4NAYpU .

--

Met vriendelijke groet / best wishes, Remy de Ruysscher

remy@unix-asp.com (MOBIEL NUMMER: 06-28184781)

TD-er commented 6 years ago

Just add it as a "Custom sensor", via the "Dummy" (Virtual) devices. Then select Domoticz HTTP as controller and couple that to the sensor device. Then you can use these sensors in Domoticz. I've several of them working here.

remyderuysscher commented 6 years ago

Thanks, works now with a custom sensor. Will try it with rules and type CO2 sensor later...

On Tue, Nov 21, 2017 at 9:09 PM, Gijs Noorlander notifications@github.com wrote:

Just add it as a "Custom sensor", via the "Dummy" (Virtual) devices. Then select Domoticz HTTP as controller and couple that to the sensor device. Then you can use these sensors in Domoticz. I've several of them working here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/letscontrolit/ESPEasy/issues/232#issuecomment-346146294, or mute the thread https://github.com/notifications/unsubscribe-auth/ANVLN1gfNM6SkGBXryELmXa894Cwqrgqks5s4y4VgaJpZM4NAYpU .

--

Met vriendelijke groet / best wishes, Remy de Ruysscher

remy@unix-asp.com (MOBIEL NUMMER: 06-28184781)

svde commented 6 years ago

I use this rule:

on CO2#PPM do SendToHTTP domoticz-fqdn,80,/json.htm?type=command&param=udevice&idx=228&nvalue=[CO2#PPM] endon

sincze commented 5 years ago

on CO2#PPM do SendToHTTP domoticz-fqdn,80,/json.htm?type=command&param=udevice&idx=228&nvalue=[CO2#PPM] endon

i used that rule as well, It works. However now I changed to Domoticz that requires authentication.... and it does not work anymore.

(ESP_Easy_mega-20190315_normal_ESP8266_4M.bin)

Created Controllers (Domoticz HTTP) I tried with Device - Generic Dummy Device (SENSOR_TYPE_SINGLE). But it seems it is unable to call a /json.htm?type=command&param=udevice&idx=IDX&nvalue=PPM

Generic Dummy that I use for Temperature work correctly /json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP

TD-er commented 5 years ago

As far as I know, all data we send to Domoticz in one of both controllers only send "svalue" data, not "nvalue". So I just use a "custom sensor" in Domoticz and send my CO2 values to that IDX and it sends it as "svalue" since we do not yet support sending "nvalues"

sincze commented 5 years ago

That would indeed be a nice work around and nvalue feature request :).

sincze commented 5 years ago

Jups it does the trick, nvalue_cheated

tonhuisman commented 10 months ago

This seems to be solved, so can be closed.

TD-er commented 10 months ago

Nope, this still is not (yet) finished.