Page 1 of 2
Own idx, rules and domoticz
Posted: 20 Jan 2018, 11:27
by bogas
Hi.
I'm trying add PMS5003 to domoticz.
It has one idx so i should add idx's to rules, but it doesn't work.
Domoticz ip: 192.168.0.4, port 8080
idx for pm1.0 : 20
idx for pm2.5 : 21
idx for pm10 : 22
Rules:
on PMS5003#pm1.0 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=20&nvalue=0&svalue=[PMS5003#pm1.0]
endon
on PMS5003#pm2.5 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=21&nvalue=0&svalue=[PMS5003#pm2.5]
endon
on PMS5003#pm10 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=22&nvalue=0&svalue=[PMS5003#pm10]
endon
Please help!
Regards
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 11:30
by grovkillen
What does the log say?
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 14:18
by TD-er
For the SDS011, I use these rules:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.28,8080,/json.htm?type=command¶m=udevice&idx=105&nvalue=0&svalue=[SDS011#PM25] //Send the PM2,5 data to Domoticz
SendToHTTP 192.168.1.28,8080,/json.htm?type=command¶m=udevice&idx=108&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
This sensor also has the problem it can only send the 1st value to Domoticz
These rules work fine for the entire year already

Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 15:53
by bogas
grovkillen wrote: ↑20 Jan 2018, 11:30
What does the log say?
Log
404611 : ACT : SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=20&nvalue=0&svalue=36
405634 : Timeout while reading input data!
405731 : EVENT: PMS5003#pm2.5=64.00
405745 : ACT : SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=21&nvalue=0&svalue=64
406768 : Timeout while reading input data!
406858 : EVENT: PMS5003#pm10=86.00
406880 : ACT : SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=22&nvalue=0&svalue=86
407903 : Timeout while reading input data!
427242 : WD : Uptime 7 ConnectFailures 0 FreeMem 19680
427476 : EVENT: Clock#Time=Sat,14:52
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 16:13
by grovkillen
https://www.letscontrolit.com/wiki/inde ... th_own_IDX
Many users have reported problems with commands being truncated, particularly when trying to send commands to domoticz. It seems to be a parsing error. There is the following workaround
SendToHTTP 192.168.0.243,8080,/json.htm?type=param=switchlight&command&idx=174&switchcmd=On
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 16:19
by vader
What is this after command?
command¶m=udev
Hope it is like this and is just a cut'n'paste problem:
command¶m
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 16:23
by bogas
grovkillen wrote: ↑20 Jan 2018, 16:13
https://www.letscontrolit.com/wiki/inde ... th_own_IDX
Many users have reported problems with commands being truncated, particularly when trying to send commands to domoticz. It seems to be a parsing error. There is the following workaround
SendToHTTP 192.168.0.243,8080,/json.htm?type=param=switchlight&command&idx=174&switchcmd=On
I saw this.
There is switch, i have sensor. :/
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 16:23
by bogas
vader wrote: ↑20 Jan 2018, 16:19
What is this after command?
command
¶m=udev
Hope it is like this and is just a cut'n'paste problem:
command¶m
Yes, it should be &.
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 16:46
by grovkillen
bogas wrote: ↑20 Jan 2018, 16:23
grovkillen wrote: ↑20 Jan 2018, 16:13
https://www.letscontrolit.com/wiki/inde ... th_own_IDX
Many users have reported problems with commands being truncated, particularly when trying to send commands to domoticz. It seems to be a parsing error. There is the following workaround
SendToHTTP 192.168.0.243,8080,/json.htm?type=param=switchlight&command&idx=174&switchcmd=On
I saw this.
There is switch, i have sensor. :/
That was only an example. In your code, try change this :
SendToHTTP 192.168.0.4,8080,/json.htm?
type=command¶m=udevice&idx=20&nvalue=0&svalue=[PMS5003#pm1.0]
To this :
SendToHTTP 192.168.0.4,8080,/json.htm?
type=param=udevice&command&idx=20&nvalue=0&svalue=[PMS5003#pm1.0]
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 17:13
by bogas
That was only an example. In your code, try change this :
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=20&nvalue=0&svalue=[PMS5003#pm1.0]
To this :
SendToHTTP 192.168.0.4,8080,/json.htm?type=param=udevice&command&idx=20&nvalue=0&svalue=[PMS5003#pm1.0]
on PMS5003#pm1.0 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=param=udevice&command&idx=20&nvalue=0&svalue=[PMS5003#pm1.0]
endon
on PMS5003#pm2.5 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=param=udevice&command&idx=21&nvalue=0&svalue=[PMS5003#pm2.5]
endon
on PMS5003#pm10 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=param=udevice&command&idx=22&nvalue=0&svalue=[PMS5003#pm10]
endon
And nothing...
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 17:14
by vader
@grovkillen: It must be: ... type=command¶m= ...
Your version with two "=" will never work....
From Domoticz's Wiki (
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's):
/json.htm?
type=command¶m=udevice&idx=IDX&nvalue=0&svalue=TEMP
Tested here and works.

Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 17:29
by bogas
On PMSx003#pm1.0 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=20&nvalue=0&svalue=[PMSx003#pm1.0]
endon
On PMSx003#pm2.5 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=21&nvalue=0&svalue=[PMSx003#pm2.5]
endon
On PMSx003#pm10 do
SendToHTTP 192.168.0.4,8080,/json.htm?type=command¶m=udevice&idx=22&nvalue=0&svalue=[PMSx003#pm10]
endon
Nothing

Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 18:25
by vader
What makes Domoticz if you send it direct with the browser?
_http://192.168.0.4:8080/json.htm?type=command¶m=udevice&idx=22&nvalue=0&svalue=12.3
Does the value change to 12.3?
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 18:35
by bogas
vader wrote: ↑20 Jan 2018, 18:25
What makes Domoticz if you send it direct with the browser?
_http://192.168.0.4:8080/json.htm?type=command¶m=udevice&idx=22&nvalue=0&svalue=12.3
Does the value change to 12.3?
Code: Select all
{
"status" : "OK",
"title" : "Update Device"
}
Yes:
Code: Select all
22 PMS5003 00082022 1 PM10 General Custom Sensor 12.3 ppm
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 18:41
by vader
Ok, so we know that the syntax of the command is right. Let's have a look at your device config. Can you post a screenshot (ESP easy)?
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 19:45
by bogas
vader wrote: ↑20 Jan 2018, 18:41
Ok, so we know that the syntax of the command is right. Let's have a look at your device config. Can you post a screenshot (ESP easy)?
Of course.
https://ibb.co/gutRZG
https://ibb.co/cH4B1w
I have 18 sensors from which send data, including gp2y10 and they work.
Something is wrong with pms5003.
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 20:21
by vader
I don't think that the sensor is broken. You see values in ESPeasy, so the communication is also ok. Have you setup a controller in ESPeasy (Domoticz HTTP)? Because I don't see a checkmark in "Send to controller".
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 20:27
by bogas
PMS seems to be working, that's not what I meant.
The problem is probably in esp and domoticz communication.
Yes, I have set up sending data to domoticz.
If I select idx in esp, it sends data from the first indication, i.e. from pm1.0.
https://ibb.co/fp0ZMw
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 21:21
by vader
The problem could be the IDX from Domoticz. In ESPeasy you have only IDX 20, but in Domoticz 20, 21 and 22....
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 21:22
by grovkillen
vader wrote: ↑20 Jan 2018, 17:14
@grovkillen: It must be: ... type=command¶m= ...
Your version with two "=" will never work....
From Domoticz's Wiki (
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's):
/json.htm?
type=command¶m=udevice&idx=IDX&nvalue=0&svalue=TEMP
Tested here and works.
Ah, sorry. Messed that one up. Must revise the wiki.
Re: Own idx, rules and domoticz
Posted: 20 Jan 2018, 22:14
by bogas
vader wrote: ↑20 Jan 2018, 21:21
The problem could be the IDX from Domoticz. In ESPeasy you have only IDX 20, but in Domoticz 20, 21 and 22....
for pms it is impossible to set more idx than one.
That's why I'm trying to make a rule for the wiki.
I tried to enable the second and third tasks with separate idx, but I can not.

Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 10:10
by bogas
vader wrote: ↑20 Jan 2018, 21:21
The problem could be the IDX from Domoticz. In ESPeasy you have only IDX 20, but in Domoticz 20, 21 and 22....
Vader, how should i set domoticz to read pm1.0, pm2.5, pm10? Currently shows only pm1.0 on idx20.
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 12:32
by vader
I don't know if that trick works, but what is if you enter 3x the same device in ESPeasy (ok, it needs 3 tasks...), but with different IDX (20,21,22)? And with a correct configured controller, you don't need a rule, because ESPeasy sends the values in the given delay time to Domoticz.
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 12:44
by bogas
Guys, done!
I used this guide:
https://diyprojects.io/esp-easydht22bmp ... mR0TajibDc
I created virtual sensors to which I assigned idx.
Rules:
Code: Select all
on PMSx003#PM25 do
TaskValueSet 3,1,[PMSx003#PM1]
TaskValueSet 4,1,[PMSx003#PM25]
TaskValueSet 5,1,[PMSx003#PM10]
endon
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 13:09
by vader
This is no clean solution. Give every device a unique name! E.g. PMSx003_1, PMSx003_2, and so on. The rule is also not correct.
on PMSx003#PM25 do
TaskValueSet 3,1,[PMSx003#PM1]
TaskValueSet 4,1,[PMSx003#PM25]
TaskValueSet 5,1,[PMSx003#PM10]
endon
You write a value to "TaskValueSet 4,1,[PMSx003#
PM25]" what already changed and is checked with "on PMSx003#
PM25 do". Delete this line.
It makes no sense to me now, because you have the same value (PM25) at all 3 sensors.

Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 13:49
by grovkillen
Better to use timer?
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 15:03
by kimot
And what about to tray do not use "dot" in variable names?
Instead of PMS5003#pm1.0 use PMS5003#pm1_0
I do not see anything else, what can make problems.
But I am not with my ESPeasys to tray now.
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 19:05
by bogas
vader wrote: ↑21 Jan 2018, 13:09
This is no clean solution. Give every device a unique name! E.g. PMSx003_1, PMSx003_2, and so on. The rule is also not correct.
on PMSx003#PM25 do
TaskValueSet 3,1,[PMSx003#PM1]
TaskValueSet 4,1,[PMSx003#PM25]
TaskValueSet 5,1,[PMSx003#PM10]
endon
You write a value to "TaskValueSet 4,1,[PMSx003#
PM25]" what already changed and is checked with "on PMSx003#
PM25 do". Delete this line.
It makes no sense to me now, because you have the same value (PM25) at all 3 sensors.
I know that pm25 should not work and should give the same value, but it is not. This solution works.
You can not add a second device as pmsx003 - I wrote about it, displaying all values as 0.
For example, it is possible for HTU21d, for pms not.
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 19:06
by bogas
grovkillen wrote: ↑21 Jan 2018, 13:49
Better to use timer?
?
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 19:08
by bogas
kimot wrote: ↑21 Jan 2018, 15:03
And what about to tray do not use "dot" in variable names?
Instead of PMS5003#pm1.0 use PMS5003#pm1_0
I do not see anything else, what can make problems.
But I am not with my ESPeasys to tray now.
I tried. See that at the moment - I have pm1, pm25, pm10, and I had dots before.
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 21:08
by grovkillen
bogas wrote: ↑21 Jan 2018, 19:06
grovkillen wrote: ↑21 Jan 2018, 13:49
Better to use timer?
?
If you use a timer in the rules you don't have to rely on a value being changed. I try to use timer when it comes to sensor values. Values from inputs (switches for example) I use "value change" triggers instead. But what you prefer is up to you.

Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 22:05
by bogas
Can You explain it in my example?
Re: Own idx, rules and domoticz
Posted: 21 Jan 2018, 22:36
by grovkillen
Code: Select all
On System#Boot do
TimerSet,1,10 //10 second loop time
EndOn
on Rules#Timer=1 do
TaskValueSet 3,1,[PMSx003#PM1]
TaskValueSet 4,1,[PMSx003#PM25]
TaskValueSet 5,1,[PMSx003#PM10]
TimerSet,1,10
endon
Re: Own idx, rules and domoticz
Posted: 28 Mar 2018, 22:22
by PieterS
TD-er wrote: ↑20 Jan 2018, 14:18
For the SDS011, I use these rules:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.28,8080,/json.htm?type=command¶m=udevice&idx=105&nvalue=0&svalue=[SDS011#PM25] //Send the PM2,5 data to Domoticz
SendToHTTP 192.168.1.28,8080,/json.htm?type=command¶m=udevice&idx=108&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
This sensor also has the problem it can only send the 1st value to Domoticz
These rules work fine for the entire year already
I had the dustsensor build as described by site of
https://Luftdaten.info. There is no api to Domoticz.
Thats why I used this one:
https://blog.jokielowie.com/en/2018/01/ ... og-sensor/
So I build a Wemos D1 with GIT version: mega-20180126
No apply for upload to controller. That should be done by rule
This is the "modified" rule as above
The rule who uploads to Domoticz:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=0&svalue=[SDS011#PM25] //Send the PM2,5 data to Domoticz
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=738&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
This is logfile of Wemos:
No Authentication error because the temperature of Dallas-sensor and SDS011 is read and represented in Domoticz.
In the logfile of Domoticz is no info about IDX-numbers....

The temperaturesensor is updated in the dashboard but the dustsensor not... Why??
Thanks for your help!
By the way: I use Domoticz version V3.8153 on a Synology
Pieter
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 11:26
by toffel969
PieterS wrote: ↑28 Mar 2018, 22:22
TD-er wrote: ↑20 Jan 2018, 14:18
For the SDS011, I use these rules:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.28,8080,/json.htm?type=command¶m=udevice&idx=105&nvalue=0&svalue=[SDS011#PM25] //Send the PM2,5 data to Domoticz
SendToHTTP 192.168.1.28,8080,/json.htm?type=command¶m=udevice&idx=108&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
This sensor also has the problem it can only send the 1st value to Domoticz
These rules work fine for the entire year already
I had the dustsensor build as described by site of
https://Luftdaten.info. There is no api to Domoticz.
Thats why I used this one:
https://blog.jokielowie.com/en/2018/01/ ... og-sensor/
So I build a Wemos D1 with GIT version: mega-20180126
No apply for upload to controller. That should be done by rule
This is the "modified" rule as above
The rule who uploads to Domoticz:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=0&svalue=[SDS011#PM25] //Send the PM2,5 data to Domoticz
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=738&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
This is logfile of Wemos:
No Authentication error because the temperature of Dallas-sensor and SDS011 is read and represented in Domoticz.
In the logfile of Domoticz is no info about IDX-numbers....

The temperaturesensor is updated in the dashboard but the dustsensor not... Why??
Thanks for your help!
By the way: I use Domoticz version V3.8153 on a Synology
Pieter
Looks like you are having the problem with parsing error, see the distorted representation of the command in the log. Check out :
https://www.letscontrolit.com/wiki/inde ... SendToHTTP
Try:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.10,8084,/json.htm?type=param=udevice&command&idx=736&nvalue=0&svalue=[SDS011#PM25] //Send the PM2,5 data to Domoticz
SendToHTTP 192.168.1.10,8084,/json.htm?type=param=udevice&command&idx=738&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 13:24
by PieterS
Many thanks for input!
I gave it a try: changed the rule for both IDX's by copy paste at 12:27:32. But after the change there is no further input in Domoticz: (look at last seen in the screenshot below)
The syntax you suggested did not work out. I am sorry.
So I tried the old one and also your example in the Wemos by Tools, Command-prompt. In both ways in the Wemos the Command Output says OK.
But with the old syntax I see that Domoticz reads the "old" command! But not the value.
I only send one command for IDX 736. That makes the difference.
Too bad that the sensor is not updated in the dashboard with the variable.
I even tried to send a value with the hope it is seen in the dashboard or in Settings, Devices through a paste in the command prompt of the Wemos:
Code: Select all
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=0&svalue=8
No luck!

What goes wrong?
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 15:21
by cyberclwn
Hi,,
From your post:
PieterS wrote: ↑29 Mar 2018, 13:24
I even tried to send a value with the hope it is seen in the dashboard or in Settings, Devices through a paste in the command prompt of the Wemos:
Code: Select all
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=0&svalue=8
From the domoticz
JSON-wiki:
Air quality
Code: Select all
/json.htm?type=command¶m=udevice&idx=IDX&nvalue=PPM
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
PPM = CO2-concentration
so try to change the values:
Code: Select all
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=8
Maybe that helps

Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 16:22
by PieterS
Hi,
Yes! I made some progress! Your suggestion with last code makes some sense!
I pasted your last code with a value in the Wemos, Tools, Command with a value and it is read into Domoticz!
Code: Select all
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=18
But when I replace the value by the name of the variable then it goes wrong...
No idea what name it that should be. I use the names declared in the sensor.
As there were empty readings in Domoticz I change the rule:
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=0&svalue=25 //Send the PM25 data to Domoticz
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=738&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
And there was a litte surprise in the logfile:
Is there somewhere a bug?
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 16:33
by cyberclwn
Hi,
PieterS wrote: ↑29 Mar 2018, 16:22
Code: Select all
On System#Boot do //This will happen at boot ESP8266
timerSet,1,30 //Set and start timer 1 at 30 seconds
endon
On Rules#Timer=1 do //When the timer 1 is up:
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=0&svalue=25 //Send the PM25 data to Domoticz
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=738&nvalue=0&svalue=[SDS011#PM10] //Send the PM10 data to Domoticz
timerSet,1,120 //Set the next cycle at 120 seconds
endon
And there was a litte surprise in the logfile:
Is there somewhere a bug?
I think it is because you still use the wrong values in the rules:)
&nvalue=0&svalue=[SDS011#PM10]
And use the "name" of the device, not the type.
In your screenshot the sds011-name field has the "name" "Fijnstofmeter". (it is even showed in the log, first and second line of last screenshot.

)
So :
Complete lines:
Code: Select all
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=[Fijnstofmeter#PM25] //Send the PM25 data to Domoticz
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=738&nvalue=[Fijnstofmeter#PM10] //Send the PM10 data to Domoticz
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 16:41
by PieterS
Yes! While you typ I got same idea. Sorry! This are my first steps with ESP Easy.. What's in the name.
Thanks anybody for your input!
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 16:47
by cyberclwn
Hi,
It's easy, but you need a little time to get to know it and get it to work.
Good to see you got it working!.
And what is the next project ?

Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 16:59
by PieterS
Thanks a lot.
Still not finished with this. Values much too high. Guess I have to divide through 100..
Got it: Add %value%/100 in Formula.

I have no reference in neighbourhood. Next measurepoint is 6 km ahead.

Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 19:30
by TD-er
I guess those are correct values.
The SDS just reports the correct values (except for faulty devices ofcourse)
I just use the values directly from the sensor and they agree with the RIVM/KNMI values.
If you're close to a road, it is a believable value.
Sometimes fog may lead to higher readings and perhaps some other external factors, but in general the readings are quite believable.
I have a mounting case printed which adds some tunnel to avoid direct wind blowing into the sensor.
Re: Own idx, rules and domoticz
Posted: 29 Mar 2018, 19:43
by grovkillen
Moisture is a big source of error on devices like that. As well as with many environmental sensors.
Re: Own idx, rules and domoticz
Posted: 02 Apr 2018, 17:41
by PieterS
cyberclwn wrote: ↑29 Mar 2018, 16:47
Hi,
It's easy, but you need a little time to get to know it and get it to work.
Good to see you got it working!.
And what is the next project ?
Write a rule to switch a port on the ESP: but have some trouble with that..
I want to change status of GPIO14 (D5) from low to high when GPIO-13 (D7) is changing.
The sensor is a tracker-sensor which sends its output to D7. I see that correct value is represented in the list of Devices
I made this rule:
on Gas#Switch=1 do // Task Gas which reads GPIO-13 (D7)
if [Gas#Switch]=1 // If status Switch = 1
gpio, 14, 1 // Statusled GPIO-14 (D5) aan
else
gpio, 14, 0 // Statusled GPIO-14 (D5) uit
endif
endon
When I send the command in Tools, Command: gpio,14, 1 then i read that D5 is High (3.3 V). That's what i want.
When I send the command in Tools, Command: gpio,14, 0 then i read that D5 is Low (0 V). That's OK.
So I studied in the Wiki on the example of PIR and LDR and SR04 and LDR.. I build this rule:
No luck! How do I write the code for trigger and condition? My script does not work..
In the log is an event written when I give the command via Tools, Command and D5 is high.
Any help is apreciated. Thanks in advance.

Re: Own idx, rules and domoticz
Posted: 02 Apr 2018, 18:27
by grovkillen
Code: Select all
on Gas#Switch do // Task Gas which reads GPIO-13 (D7)
if [Gas#Switch]=1 // If status Switch = 1
gpio, 14, 1 // Statusled GPIO-14 (D5) aan
else
gpio, 14, 0 // Statusled GPIO-14 (D5) uit
endif
endon
Remove the =1 on the event since you're doing a test anyway.
Re: Own idx, rules and domoticz
Posted: 02 Apr 2018, 22:10
by PieterS
Thanks for reply but it did not help, sorry.
Is there need for adding a device or task to switch that port?
Just gave the command again in Tools, Command gives the result. It's yellow marked in logfile.
But that does not happen when done by sensor and modified script.
Why?
Re: Own idx, rules and domoticz
Posted: 02 Apr 2018, 22:22
by toffel969
Try
Code: Select all
on Gas#Switch=1 do // Task Gas which reads GPIO-13 (D7)
gpio,14,1 // Statusled GPIO-14 (D5) aan
Endon
On gas#Switch=0 do
gpio,14,0 // Statusled GPIO-14 (D5) uit
endon
Re: Own idx, rules and domoticz
Posted: 02 Apr 2018, 22:40
by PieterS
That makes sense! You are my hero!
Thank you very much
Re: Own idx, rules and domoticz
Posted: 02 Apr 2018, 23:19
by cyberclwn
PieterS wrote: ↑02 Apr 2018, 22:10
But that does not happen when done by sensor and modified script.
Why?
I think this rule works, if you remove the spaces:
Code: Select all
on Gas#Switch do // Task Gas which reads GPIO-13 (D7)
if [Gas#Switch]=1 // If status Switch = 1
gpio,14,1 // Statusled GPIO-14 (D5) aan
else
gpio,14,0 // Statusled GPIO-14 (D5) uit
endif
endon
On my own rules i noticed that espeasy is very picky on "useless" space in lines.
I known you solved it with other rules, but thought i try explain why what you tried is not working.
For future rules
