Own idx, rules and domoticz
Moderators: grovkillen, Stuntteam, TD-er
Own idx, rules and domoticz
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
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
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
What does the log say?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
For the SDS011, I use these rules:
This sensor also has the problem it can only send the 1st value to Domoticz
These rules work fine for the entire year already
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
These rules work fine for the entire year already

Re: Own idx, rules and domoticz
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
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
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
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
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
What is this after command?
command¶m=udev
Hope it is like this and is just a cut'n'paste problem:
command¶m
command¶m=udev
Hope it is like this and is just a cut'n'paste problem:
command¶m
Re: Own idx, rules and domoticz
I saw this.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
There is switch, i have sensor. :/
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
That was only an example. In your code, try change this :bogas wrote: ↑20 Jan 2018, 16:23I saw this.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
There is switch, i have sensor. :/
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]
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
on PMS5003#pm1.0 do
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]
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
@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.
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.

Last edited by vader on 20 Jan 2018, 18:43, edited 1 time in total.
Re: Own idx, rules and domoticz
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
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
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?
_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
Code: Select all
{
"status" : "OK",
"title" : "Update Device"
}
Code: Select all
22 PMS5003 00082022 1 PM10 General Custom Sensor 12.3 ppm
Re: Own idx, rules and domoticz
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
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
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
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
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
The problem could be the IDX from Domoticz. In ESPeasy you have only IDX 20, but in Domoticz 20, 21 and 22....
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
Ah, sorry. Messed that one up. Must revise the wiki.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.![]()
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
Re: Own idx, rules and domoticz
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
Guys, done!
I used this guide:
https://diyprojects.io/esp-easydht22bmp ... mR0TajibDc
I created virtual sensors to which I assigned idx.

Rules:
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
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.
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.

- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
Better to use timer?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
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.
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
I know that pm25 should not work and should give the same value, but it is not. This solution works.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.![]()
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
I tried. See that at the moment - I have pm1, pm25, pm10, and I had dots before.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
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.

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
Can You explain it in my example?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
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
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
I had the dustsensor build as described by site of https://Luftdaten.info. There is no api to Domoticz.TD-er wrote: ↑20 Jan 2018, 14:18 For the SDS011, I use these rules:
This sensor also has the problem it can only send the 1st value to DomoticzCode: 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
These rules work fine for the entire year already![]()
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

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....

Thanks for your help!
By the way: I use Domoticz version V3.8153 on a Synology
Pieter
Re: Own idx, rules and domoticz
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 ... SendToHTTPPieterS wrote: ↑28 Mar 2018, 22:22I had the dustsensor build as described by site of https://Luftdaten.info. There is no api to Domoticz.TD-er wrote: ↑20 Jan 2018, 14:18 For the SDS011, I use these rules:
This sensor also has the problem it can only send the 1st value to DomoticzCode: 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
These rules work fine for the entire year already![]()
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:This is logfile of Wemos: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
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
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
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Own idx, rules and domoticz
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:
No luck! 
What goes wrong?
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

What goes wrong?
Re: Own idx, rules and domoticz
Hi,,
From your post:
Maybe that helps 
From your post:
From the domoticz JSON-wiki: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
so try to change the values:Air qualityIDX = id of your device (This number can be found in the devices tab in the column "IDX")Code: Select all
/json.htm?type=command¶m=udevice&idx=IDX&nvalue=PPM
PPM = CO2-concentration
Code: Select all
SendToHTTP 192.168.1.10,8084,/json.htm?type=command¶m=udevice&idx=736&nvalue=8

Re: Own idx, rules and domoticz
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!

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:
And there was a litte surprise in the logfile:

Is there somewhere a bug?
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

Is there somewhere a bug?
Re: Own idx, rules and domoticz
Hi,
I think it is because you still use the wrong values in the rules:)
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:
PieterS wrote: ↑29 Mar 2018, 16:22And there was a litte surprise in the logfile: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
Is there somewhere a bug?
I think it is because you still use the wrong values in the rules:)
And use the "name" of the device, not the type.&nvalue=0&svalue=[SDS011#PM10]
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 :
Code: Select all
&nvalue=[Fijnstofmeter#PM10]
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
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!

Thanks anybody for your input!
Last edited by PieterS on 29 Mar 2018, 16:48, edited 1 time in total.
Re: Own idx, rules and domoticz
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 ?
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
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. 
Still not finished with this. Values much too high. Guess I have to divide through 100..
Got it: Add %value%/100 in Formula.


Re: Own idx, rules and domoticz
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.
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.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
Moisture is a big source of error on devices like that. As well as with many environmental sensors.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
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:
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.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, 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.

- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Own idx, rules and domoticz
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
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Own idx, rules and domoticz
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
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: Own idx, rules and domoticz
That makes sense! You are my hero!
Thank you very much


Thank you very much
Re: Own idx, rules and domoticz
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
I known you solved it with other rules, but thought i try explain why what you tried is not working.
For future rules

Who is online
Users browsing this forum: No registered users and 16 guests