Access to Domoticz_2023.2

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Ton_vN
Normal user
Posts: 303
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Access to Domoticz_2023.2

#1 Post by Ton_vN » 30 Jul 2023, 07:42

After upgrade of Domoticz_2023.2 all my ESPEasy_ESP8266es fail to communicate with their counterpart-Domoticzes.
These ESPEasy_ESP8266es apply the basic Domoticz_HTTP as communication protocol for redundant traffic to/from max. 3 Controllers.
No trick found yet at side of Domoticz to revive the channels.

Anyone in this forum knowing how to simply remedy this situation?
This thread seems applicable, but don't see a practical solution which can be 'translated'.
Is this message 'the' solution, by instead of just 8080 inserting a much longer text as port-info?
[The discussion in that thread still applies port 8080, while 443 (IMHO) would be the port to be applied for HTTPS. Why not 443?]

Have been looking at Domoticz_MQTT as alternative, but that limits communication channel to/from the ESP8266es to/from only a single Domoticz.
Obvious risc_increase due to single point of communication, but if unavoidable, perhaps useful to dedicate 1 Domoticz for just that job of ESP-handling,
as nodal point for data-distribution to/from the other Domoticzes.
Better options?

RobertM
Normal user
Posts: 23
Joined: 22 Oct 2017, 15:23

Re: Access to Domoticz_2023.2

#2 Post by RobertM » 30 Jul 2023, 11:26

Try to delete "Credentials" on ESPeasy Controllers - it works for me :roll:

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#3 Post by Ath » 30 Jul 2023, 14:19

It seems that Domoticz have first deprecated (some time ago), and now removed support for some API commands. Maybe your http calls from rules are using those? There is a list over here
/Ton (PayPal.me)

Ton_vN
Normal user
Posts: 303
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Access to Domoticz_2023.2

#4 Post by Ton_vN » 30 Jul 2023, 22:27

RobertH,

Have tried with my oldest ESPEasy and the newest ESPEasy, and after success also the other copies, and on all ESPEasies your hint seems to work.
Although somewhat strange to login without credentials: prefer a safer solution ......

Ath,

Might be good explanation, if I would be using 'Rules' in ESPEasy for that function, but that is not the case.
For those ESP8266es just straightforward use of the basic, background functions triggered in ESPEasy due to the setup-tick under tab 'Controller',
and those background functions I cannot access/change .......

Just wondering why few users of ESPEasy&Domoticz reporting this apparent incompatibility ......
Last edited by Ton_vN on 31 Jul 2023, 18:57, edited 2 times in total.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#5 Post by TD-er » 30 Jul 2023, 23:19

I can imagine most users either won't update Domoticz when it is working fine, or maybe using MQTT instead of HTTP?

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#6 Post by PieterS » 13 Aug 2023, 11:31

Searched Google and https://espeasy.readthedocs.io/en/lates ... Rules.html

This is about ESPeasy:
{"System":{
"Load":77.90,
"Load LC":3850,
"Build":20230808,
"Git Build":"mega_a48dc65",
"System Libraries":"ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support",
"Plugin Count":56,
"Plugin Description":"[Normal][Energy][No Debug Log]",
"Build Time":"Aug 8 2023 00:32:02",
"Binary Filename":"ESP_Easy_mega_20230808_energy_ESP8266_4M1M",
"Local Time":"2023-08-13 11:04:06",

This about Domoticz:
Image

Every task in ESP creates 4 values.

Image

But only the first one is accepted in Domoticz. As @Ath told: There's no way of sending the next 4 values to Domoticz...
So I want to resolve it in a rule... And send the values one by one.

I used this command? Troubles, so I tried to make it simple..

Code: Select all

SendToHTTP,192.168.1.125,8080,/json.htm?type=command&param=udevice&idx=27&nvalue=0&svalue=1
This command did not change the value of the IDX in Domoticz..
I tried in de cli of ESPeasy and returned in FAILED.

What's wrong?

PS: I prefer MQTT, tried that too, but same troubles..

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#7 Post by Ath » 13 Aug 2023, 13:45

There are several way to solve this, that the HTTP method is failing, is most likely caused by the fact you didn't include credentials to authenticate yourself with Domoticz, that should be used like this (required since Domoticz 2023.2):

Code: Select all

SendToHttp,http://<username>:<password>@192.168.1.125:8080/json.htm?type=command&param=udevice&idx=27&nvalue=0&svalue=[SDM630_L3#kWh]
Note: Including username/password has to be right after http://, and the new style of SendToHTTP needs to be used, having the protocol (http) included and using a regular url. The old Domoticz style of including &username=...&password=... is not supported anymore by Domoticz since 2023.2.

The type of sensor having 4 power values is not accepted/supported by Domoticz, that's why the Domoticz MQTT controller doesn't even send them. Also, ESPEasy doesn't support sending separate values to multiple IDX's from a single plugin.
Easiest solution:
- Set the 'Single event with all values' checkbox Enabled
- Add 3 Dummy device tasks, with each 1 value, and connect them to the Domoticz MQTT controller, using the matching IDX
- Add a Rule:

Code: Select all

On SDM630_L3#All Do // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  TaskValueSetAndRun,Dummy1,Value1,%eventvalue2%
  TaskValueSetAndRun,Dummy2,Value1,%eventvalue3%
  TaskValueSetAndRun,Dummy3,Value1,%eventvalue4%
Endon
Alternative solution:
- Instead of adding 3 Dummy devices to send the values separately, you can still use the Domoticz MQTT controller, but use the Publish command to send data to Domoticz (actually, the first MQTT controller configured and enabled) using this rule:

Code: Select all

On SDM630_L3#All Do // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  Publish,domoticz/in,'{"command":"udevice","idx":24,"nvalue":0,"svalue":"%eventvalue2%"}' // Check for the correct idx...
  Publish,domoticz/in,'{"command":"udevice","idx":26,"nvalue":0,"svalue":"%eventvalue3%"}'
  Publish,domoticz/in,'{"command":"udevice","idx":27,"nvalue":0,"svalue":"%eventvalue4%"}'
Endon
You can also send the first value from rules to Domoticz by duplicating a Publish line, by sending %eventvalue1% to idx 25. In that case the Domoticz MQTT controller option in the plugin should be unchecked.

NB: Air code... untested ;)
/Ton (PayPal.me)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#8 Post by PieterS » 13 Aug 2023, 15:33

Thnx Ton for all your information.

I tried the SendToHttp-way in the CLI of ESPeasy but it gave FAILED. Sure about username and password..

As I prefer MQTT I copy/pasted your example of the rules set, checked the IDX and saved it. But it did not pass by in MQTT Explorer.

So I tried to make it simple for me:
Disabled two tasks for L1 and L2.
Reboot of the ESP.

Image

Made this script as rules set:

Code: Select all

On SDM630_L3#All Do  // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  Publish,domoticz/in,'{"command":"udevice","idx":31,"nvalue":0,"svalue":"%eventvalue2%"}' // Current L3
  Publish,domoticz/in,'{"command":"udevice","idx":34,"nvalue":0,"svalue":"%eventvalue3%"}'  //Power L3
  Publish,domoticz/in,'{"command":"udevice","idx":27,"nvalue":0,"svalue":"%eventvalue4%"}'  //Total kWh
Endon
The value of the Voltage is updated by Task 3. That proves that the message reaches Domoticz.
Image

I have no idea what is wrong with the script in the rules set. The messages do not pass by in the broker..

Image

Any suggestion?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#9 Post by TD-er » 13 Aug 2023, 15:39

There are quite a lot of read errors in the Eastron task.
Sure you have "ESPEasy Console" unchecked on the tools page?
Just to check, you can also set it to "SW Serial" with the same pins, instead of HW Serial.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#10 Post by PieterS » 13 Aug 2023, 16:01

Serial Port Console is Unchecked.
I gonna load the car to give some work to the meter.

Be back in a while.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#11 Post by TD-er » 13 Aug 2023, 16:09

Doesn't matter whether there is a load on the meter.
Those checksum fails are for reading registers, regardless its content.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#12 Post by PieterS » 13 Aug 2023, 16:12

Loading with 11 kW on "3 fase"

I miss some data..
Image

But I guess i have to inform you in a different thread?

Sorry, my conclusion is to early. Sorry
Last edited by PieterS on 13 Aug 2023, 16:33, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#13 Post by Ath » 13 Aug 2023, 16:18

PieterS wrote: 13 Aug 2023, 15:33 As I prefer MQTT I copy/pasted your example of the rules set, checked the IDX and saved it. But it did not pass by in MQTT Explorer.

So I tried to make it simple for me:
Disabled two tasks for L1 and L2.
Reboot of the ESP.
...
Made this script as rules set:

Code: Select all

On SDM630_L3#All Do  // Receives 4 arguments, 1st one is already sent to the controller, so can be ignored
  Publish,domoticz/in,'{"command":"udevice","idx":31,"nvalue":0,"svalue":"%eventvalue2%"}' // Current L3
  Publish,domoticz/in,'{"command":"udevice","idx":34,"nvalue":0,"svalue":"%eventvalue3%"}'  //Power L3
  Publish,domoticz/in,'{"command":"udevice","idx":27,"nvalue":0,"svalue":"%eventvalue4%"}'  //Total kWh
Endon
You didn't enable the 'Single event with all values:' checkbox, so that 'All' event will never be generated, and nothing is sent...
/Ton (PayPal.me)

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#14 Post by PieterS » 13 Aug 2023, 17:16

I disabled because I read:
You can also send the first value from rules to Domoticz by duplicating a Publish line, by sending %eventvalue1% to idx 25. In that case the Domoticz MQTT controller option in the plugin should be unchecked.
I had in mind: the task sends the first message, the rule the rest. :?

So I enabled all tasks as well as MQTT on all tasks:
Image

It takes quite a while to fill the values from 0 to actual values.. but there it is:

Code: Select all

3397623: EVENT: SDM630_L3#All=234.97,10.06,0.00,126.58
3397631: ACT : Publish,domoticz/in,'{'command':'udevice','idx':31,'nvalue':0,'svalue':'10.06'}'
3397647: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'0.00'}'
3397660: ACT : Publish,domoticz/in,'{'command':'udevice','idx':27,'nvalue':0,'svalue':'126.58'}'
3401448: EVENT: SDM630_L1#All=230.93,7.04,0.00,0.00
3401456: ACT : Publish,domoticz/in,'{'command':'udevice','idx':29,'nvalue':0,'svalue':'7.04'}'
3401474: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'0.00'}'
3401487: ACT : Publish,domoticz/in,'{'command':'udevice','idx':32,'nvalue':0,'svalue':'0.00'}'
3412794: EVENT: Clock#Time=Sun,17:02
3418393: EVENT: SDM630_L2#All=235.96,7.01,0.00,0.00
3418401: ACT : Publish,domoticz/in,'{'command':'udevice','idx':30,'nvalue':0,'svalue':'7.01'}'
3418415: ACT : Publish,domoticz/in,'{'command':'udevice','idx':33,'nvalue':0,'svalue':'0.00'}'
3423956: WD : Uptime 57 ConnectFailures 0 FreeMem 17936 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
3424140: EVENT: SDM630_L3#All=234.97,7.02,0.00,126.58
3424148: ACT : Publish,domoticz/in,'{'command':'udevice','idx':31,'nvalue':0,'svalue':'7.02'}'
3424162: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'0.00'}'
3424175: ACT : Publish,domoticz/in,'{'command':'udevice','idx':27,'nvalue':0,'svalue':'126.58'}'
3431616: EVENT: SDM630_L1#All=230.93,7.04,0.00,0.00
3431624: ACT : Publish,domoticz/in,'{'command':'udevice','idx':29,'nvalue':0,'svalue':'7.04'}'
3431643: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'0.00'}'
3431656: ACT : Publish,domoticz/in,'{'command':'udevice','idx':32,'nvalue':0,'svalue':'0.00'}'
3449794: EVENT: SDM630_L2#All=235.96,7.01,0.00,0.00
3449802: ACT : Publish,domoticz/in,'{'command':'udevice','idx':30,'nvalue':0,'svalue':'7.01'}'
3449816: ACT : Publish,domoticz/in,'{'command':'udevice','idx':33,'nvalue':0,'svalue':'0.00'}'
3454209: WD : Uptime 58 ConnectFailures 0 FreeMem 17888 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
3456472: EVENT: SDM630_L3#All=234.97,7.07,-1647.87,126.58
3456480: ACT : Publish,domoticz/in,'{'command':'udevice','idx':31,'nvalue':0,'svalue':'7.07'}'
3456494: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'-1647.87'}'
3456507: ACT : Publish,domoticz/in,'{'command':'udevice','idx':27,'nvalue':0,'svalue':'126.58'}'
3462194: EVENT: SDM630_L1#All=230.93,7.04,-1628.23,0.00
3462202: ACT : Publish,domoticz/in,'{'command':'udevice','idx':29,'nvalue':0,'svalue':'7.04'}'
3462216: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'-1628.23'}'
3462230: ACT : Publish,domoticz/in,'{'command':'udevice','idx':32,'nvalue':0,'svalue':'0.00'}'
3472934: EVENT: Clock#Time=Sun,17:03
3480771: EVENT: SDM630_L2#All=235.96,7.01,0.00,0.00
3480779: ACT : Publish,domoticz/in,'{'command':'udevice','idx':30,'nvalue':0,'svalue':'7.01'}'
3480795: ACT : Publish,domoticz/in,'{'command':'udevice','idx':33,'nvalue':0,'svalue':'0.00'}'
3484659: WD : Uptime 58 ConnectFailures 0 FreeMem 17888 WiFiStatus WL_CONNECTED 3 ESPeasy internal wifi status: Conn. IP Init
3484682: EVENT: SDM630_L3#All=234.97,7.07,-1647.87,126.58
3484690: ACT : Publish,domoticz/in,'{'command':'udevice','idx':31,'nvalue':0,'svalue':'7.07'}'
3484704: ACT : Publish,domoticz/in,'{'command':'udevice','idx':34,'nvalue':0,'svalue':'-1647.87'}'
3484717: ACT : Publish,domoticz/in,'{'command':'udevice','idx':27,'nvalue':0,'svalue':'126.58'}'
Load balanced to 7 Amps because the kitchen is busy.. :lol:

Image

And Domoticz:
Image

Thanks for your help!

Only detail in Domoticz:
What sort of virtual sensor is needed to represent the Total Active Energy.. ESPeasy sends that value in task3

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#15 Post by TD-er » 13 Aug 2023, 19:46

What is the fail/success rate for the Eastron messages now?

It is running here on an ESP8266 and I hardly have any failed checksum messages:
Checksum (pass/fail): 2636984/149

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#16 Post by PieterS » 13 Aug 2023, 22:14

TD-er wrote: 13 Aug 2023, 19:46 What is the fail/success rate for the Eastron messages now?

It is running here on an ESP8266 and I hardly have any failed checksum messages:
Checksum (pass/fail): 2636984/149
At this moment: Checksum (pass/fail): 158/4280 :oops:

Did some tuning in Domoticz and the rule inESPeasy.

Can the interval of 30 seconds make some difference?

Code: Select all

ESP Easy Mega: Energy

System Info	
Unit Number:	1
Local Time:	2023-08-13 22:15:58
Time Source:	NTP
Time Wander:	1.1 [ppm]
Uptime:	0 days 1 hours 3 minutes
Load:	80.08% (LC=3898)
CPU Eco Mode:	false
Boot:	Soft Reboot (7)
Reset Reason:	Software/System restart
Last Action before Reboot:	Intended Reboot: timer, id: 5
SW WD count:	0
Memory
Free RAM:	12832
Heap Max Free Block:	9008
Heap Fragmentation:	29%
Free Stack:	3696
Network
IP Config:	Static
IP / Subnet:	192.168.1.125 / 255.255.255.0
Gateway:	192.168.1.1
Client IP:	192.168.1.104
DNS:	192.168.1.1 / (IP unset)
Allowed IP Range:	192.168.1.0 - 192.168.1.255
Connected:	1h03m
Number Reconnects:	0
WiFi ?
WiFi Connection:	802.11g (RSSI -68 dBm)
SSID:	Thuis (C0:FF:D4:8D:30:E0)
Channel:	13
Encryption Type:	WPA2/PSK
Last Disconnect Reason:	(1) Unspecified
Configured SSID1:	Thuis
Configured SSID2:	
STA MAC:	50:02:91:DD:01:1C
AP MAC:	52:02:91:DD:01:1C
WiFi Settings
Force WiFi B/G:	false
Restart WiFi Lost Conn:	false
Force WiFi No Sleep:	false
Periodical send Gratuitous ARP:	false
Connection Failure Threshold:	0
Max WiFi TX Power:	17.50
Current WiFi TX Power:	17.00
WiFi Sensitivity Margin:	3
Send With Max TX Power:	false
Extra WiFi scan loops:	0
Use Last Connected AP from RTC:	false
Extra Wait WiFi Connect:	false
Enable SDK WiFi Auto Reconnect:	false
Firmware
Build:⋄	20230808 - Mega
System Libraries:⋄	ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄	mega_a48dc65
Plugin Count:⋄	56 [Normal][Energy][No Debug Log]
Build Origin:	GitHub Actions
Build Time:⋄	Aug 8 2023 00:32:02
Binary Filename:⋄	ESP_Easy_mega_20230808_energy_ESP8266_4M1M
Build Platform:⋄	Linux-5.15.0-1042-azure-x86_64-with-glibc2.35
Git HEAD:⋄	mega_a48dc65
System Status
Syslog Log Level:	None
Serial Log Level:	None
Web Log Level:	None
Enable Serial Port Console:	false
Console Serial Port:	-
Network Services
Network Connected:	✔
NTP Initialized:	✔
MQTT Client Connected:	✔
ESP Board
ESP Chip ID:	14483740 (0xDD011C)
ESP Chip Frequency:	80 MHz
ESP Chip Model:	ESP8266
ESP Chip Cores:	1
ESP Board Name:	Espressif Generic ESP8266 ESPEasy 4M Flash 1M FS
Storage
Flash Chip ID:	Vendor: 0xEF Device: 0x4016
Flash Chip Real Size:	4096 kB
Flash IDE Size:	4096 kB
Flash Chip Speed:	40 MHz
Flash IDE Speed:	40 MHz
Flash IDE Mode:	DOUT
Flash Writes:	39 daily / 140 boot
Sketch Size:	989 kB (2080 kB free)
Max. OTA Sketch Size:	1019 kB (1044464 bytes)
OTA possible:	true
OTA 2-step Needed:	false
SPIFFS Size:	934 kB (842 kB free)
Page size:	256
Block size:	8192
Number of blocks:	116
Maximum open files:	5
Maximum path length:	32
Partitions
Partition Table:	
989.16k sketch 2.03M ota 1000k fs SPIFFS 4k eeprom sector:1019 4k RFcal
12k WiFi

Powered by Let's Control It community
Build: ESP_Easy_mega_20230808_energy_ESP8266_4M1M Aug 8 2023

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#17 Post by TD-er » 14 Aug 2023, 01:04

Have you tried running it using SW serial instead of HW serial, using the same pins?
(I have asked this exact same question several times now)

The interval does have nothing to do with the read success rate as it contiously tries to read the registers.
The "Interval" setting only sets how often events are being generated and/or data is being sent to connected controllers.

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#18 Post by PieterS » 14 Aug 2023, 16:51

TD-er wrote: 14 Aug 2023, 01:04 Have you tried running it using SW serial instead of HW serial, using the same pins?
(I have asked this exact same question several times now)
No, not yet.
As I wrote in
#73 Bericht door PieterS » 13 Aug 2023, 17:19
Sorry Gijs, not yet. Too many steps together for me. I will try that in a while.

Yes: chesum (pass/fail) is bad.. :o

And let you know it here. Of course.
Maybe it was better to mention it again in the post of last night..
But your allegation about a repeating question, several times, feels not oke for me. I read that question only once and explained that it distracts me to much.

But that about that. No hard feelings. I really appreciate your involvement.

To respond to your question I step over to the other topic viewtopic.php?t=9740&start=50#p65685 later today

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#19 Post by TD-er » 14 Aug 2023, 22:35

PieterS wrote: 14 Aug 2023, 16:51 [...]
But your allegation about a repeating question, several times, feels not oke for me. I read that question only once and explained that it distracts me to much.
[...]
Sorry about that... :(

PieterS
Normal user
Posts: 87
Joined: 27 Mar 2018, 17:18
Location: NL

Re: Access to Domoticz_2023.2

#20 Post by PieterS » 15 Aug 2023, 08:25

No worries. My deficiency :|

Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: Access to Domoticz_2023.2

#21 Post by Dick60 » 21 Aug 2023, 10:05

Following on from this story I followed, I still haven't figured out how to get my HTTP calls working again (after my update of Domoticz).
As indicated, I had to modify the command to SendToHttp,http://:<password>@ipnumber etc. What I did. The ESP log shows this

263650: SW : GPIO=15 State=1 Output value=1
263832: EVENT: Keuken_Touch#State=1
263848: ACT : SendToHTTP,http:

It is clear that nothing is sent to Domoticz. What am I doning wrong?
Before the Domoticz update< the HTTP rule worked fine, It was

Code: Select all

SendToHTTP xxx.xxx.x.xxx,8080,/json.htm?type=command&param=switchlight&idx=52&switchcmd=On// Turn on

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#22 Post by Ath » 21 Aug 2023, 10:33

Dick60 wrote: 21 Aug 2023, 10:05 Before the Domoticz update< the HTTP rule worked fine, It was

Code: Select all

SendToHTTP xxx.xxx.x.xxx,8080,/json.htm?type=command&param=switchlight&idx=52&switchcmd=On// Turn on
That should be translated into:

Code: Select all

SendToHTTP http://domoticz:secret@xxx.xxx.x.xxx:8080/json.htm?type=command&param=switchlight&idx=52&switchcmd=On // Turn on
You can add quotes around everything like "http......=On" // Turn on, to make it a single argument, explicitly.
There is 1 other requirement, and that is that a somewhat recent release of ESPEasy has to be used (less than ~1 year old), as around that time support for having a username/password in the URL was added.

(I still have a couple of Sonoff units on a rather old ESPEasy release, as they are quite a PITA to upgrade, blocking me to upgrade Domoticz. I'll just have to bite the bullet sometime soon, as I should really update my Domoticz now :lol:)
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#23 Post by TD-er » 21 Aug 2023, 10:51

Just buy a new SD card and new Raspberry Pi for a new instance of Domoticz so you can keep testing both.
By the time this Raspberry pi has arrived, you have bought yourself at least 1 year of procrastination excuse not to update to the latest Domoticz and thus not having to update those old Sonoff units :)

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#24 Post by Ath » 21 Aug 2023, 11:19

TD-er wrote: 21 Aug 2023, 10:51 Just buy a new SD card and new Raspberry Pi for a new instance of Domoticz so you can keep testing both.
By the time this Raspberry pi has arrived, you have bought yourself at least 1 year of procrastination excuse not to update to the latest Domoticz and thus not having to update those old Sonoff units :)
I have been thinking of switching to Home Assistant, that's also a good excuse to procrastinate some more 8-)
/Ton (PayPal.me)

Dick60
Normal user
Posts: 243
Joined: 11 Feb 2018, 17:35
Location: The Netherlands

Re: Access to Domoticz_2023.2

#25 Post by Dick60 » 21 Aug 2023, 13:09

I have already a second pi with SD, every time I logged-on to my Domoticz, I always skipped the update but, as you can imagine, 10 days ago I accidentally hit the UPDATE button. :x :x :x Now I have to solve several errors. First try to find solutions myself ;)

Bert'Ridder
Normal user
Posts: 11
Joined: 08 Jan 2018, 13:15

Re: Access to Domoticz_2023.2

#26 Post by Bert'Ridder » 17 Sep 2023, 20:52

I also was to Stupid to update my Domoticz from an older version 2021 to 2023_2.
Now al my ESP-Easy modules are not getting the data into my domoticz ( Temepratue, Barmoeter, Light etc.)
They are all not recognised anymore

I dit some tests bij creating an update line for an temperatur

So:
http://192.168.178.13:8080/json.htm?typ ... value=20.5
And then the Value in Domotiz gets updated.

Trying with or without the Credentials, it does not work.

Is there probably an proble with the new JSON commands of the Version Domoticz 2023_2 that is not used with the "Controller Domoticz_HTTP"?

As all old Versions and also the newest version of the ESPEasy. ESP_Easy_mega_20230822_collection_E_ESP32_4M316k is not working correctly.

Please correct the values and maken if possible an "Click-field" for the old or the newversion of the Domoticz_HTTP controller.
As it is listed in the latest Domoticz=page about the API's
https://www.domoticz.com/wiki/Domoticz_ ... d_newer.29

They changed a lot of commands and the way th commands are called.
Warning Stable 2023.2 (and newer)

For users using API calls from outside Domoticz there has been some changes in API calls. They now always should be of the form /json.htm?type=command&param=**command**

For example

/json.htm?type=graph will be /json.htm?type=command&param=graph

/json.htm?type=devices will be /json.htm?type=command&param=getdevices

Bert'Ridder
Normal user
Posts: 11
Joined: 08 Jan 2018, 13:15

Re: Access to Domoticz_2023.2

#27 Post by Bert'Ridder » 30 Sep 2023, 19:56

With the lates version of SPEasy 20230930 on the ESP32, it is unfortannatly still not working.

In the Log I get still the errormessage 401 back and the data is not coming into my Domoticz.
I have set up the use of the Credentials.

Code: Select all

6002853: ESP32: Raw temperature value: 93
6003471: BH1750 Address: 0x23 Mode: 0x63 : Light intensity: 3
6003476: Domoticz: Sensortype: 1 idx: 1932 values: 3
6004867: ESP32: Raw temperature value: 94
6004869: /json.htm?type=command¶m=udevice&idx=1932&nvalue=0&svalue=3&rssi=9
6004898: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6004908: EVENT: http#192.168.178.13=401
6004908: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6004911: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6004939: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6004949: EVENT: http#192.168.178.13=401
6004949: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6004956: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6004986: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6004997: EVENT: http#192.168.178.13=401
6004997: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6004998: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6005028: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6005040: EVENT: http#192.168.178.13=401
6005041: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6005047: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6005082: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6005092: EVENT: http#192.168.178.13=401
6005092: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6005093: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6005125: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6005135: EVENT: http#192.168.178.13=401
6005135: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6005144: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6005183: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
6005190: EVENT: http#192.168.178.13=401
6005190: EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
6005195: /json.htm?type=command¶m=udevice&idx=1933&nvalue=0&svalue=0&rssi=9
6005227: HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401
Does anyone have an solution?

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#28 Post by Ath » 30 Sep 2023, 20:28

What type of device is your Domoticz idx 1932? I'm not sure if the rssi value should be included there

Edit: It seems the rssi and battery values can be appended to all transfers of data.

Edit2: Would it be possible to get your logs from the serial log, as there is an issue with the web log that &param= is mangled a bit, and the log level isn't included for each line as it is color-coded, but that's not preserved when copying the log-text.

Edit3: HTTP error 401 means "not authorized", so it seems the username/password aren't correct. Are there any special characters in there, like % : @ ? and &, as that would probably be confused somewhere
/Ton (PayPal.me)

Bert'Ridder
Normal user
Posts: 11
Joined: 08 Jan 2018, 13:15

Re: Access to Domoticz_2023.2

#29 Post by Bert'Ridder » 07 Oct 2023, 22:03

The Domoticz IDX 1932 is an Dummy, Light-Sensor. As it was working with the old Domoticz-version for an long time

Image

Image


The Data in the Serial log ( Debug Dev):

Code: Select all

617612865 : Debug More : UDP  : C0:49:EF:F0:C5:4C,192.168.178.123,202
617613469 : Info   : BH1750 Address: 0x23 Mode: 0x63 : Light intensity: 9
617613474 : Info   :  Domoticz: Sensortype: 1 idx: 1932 values: 9
617613483 : Info   : EVENT: Licht_1#All=9
617613483 : Debug  : EVENT: Licht_1#All=9 Processing time:1 milliSeconds
617613491 : Debug  : /json.htm?type=command&param=udevice&idx=1932&nvalue=0&svalue=9&rssi=10
617613531 : Error  : HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401 
617613541 : Info   : EVENT: http#192.168.178.13=401
617613542 : Debug  : EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
617613544 : Debug  : /json.htm?type=command&param=udevice&idx=1932&nvalue=0&svalue=9&rssi=10
617613571 : Error  : HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401 
617613585 : Info   : EVENT: http#192.168.178.13=401
617613586 : Debug  : EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
617613590 : Debug  : /json.htm?type=command&param=udevice&idx=1932&nvalue=0&svalue=9&rssi=10
In the Credentials, I don't use any special caracters in the username nor password. I have checkd it in several ways, as i also added the internal I-Adresses to the "Trusted Networks" also. ( 127.0.0.0.*; 192.168.178.*; 127.0.0.1 )

That isn't changed at all.
Attachments
2023-10-07 21_56_38-ESP32_E1_201.png
2023-10-07 21_56_38-ESP32_E1_201.png (34.86 KiB) Viewed 11301 times
2023-10-07 21_49_55-Domoticz.png
2023-10-07 21_49_55-Domoticz.png (18.05 KiB) Viewed 11301 times

Bert'Ridder
Normal user
Posts: 11
Joined: 08 Jan 2018, 13:15

Re: Access to Domoticz_2023.2

#30 Post by Bert'Ridder » 07 Oct 2023, 22:44

I haven been testing again.

If I just send the line out of the Serial Log with the IP-Adress of my Domoticz manually . The Domoticz gets updated normally.

Part of the DebugDev serial log:

Code: Select all

619324221 : Debug  : EVENT: http#192.168.178.13=401 Processing time:1 milliSeconds
619324223 : Debug  : /json.htm?type=command&param=udevice&idx=1932&nvalue=0&svalue=8&rssi=10
619324269 : Error  : HTTP : C001 192.168.178.13:8080 GET... failed HTTP code: 401 
619324280 : Info   : EVENT: http#192.168.178.13=401
Then the line I send manually:

Code: Select all

http://192.168.178.13:8080/json.htm?type=command&param=udevice&idx=1932&nvalue=0&svalue=8&rssi=10=10
I get the respose:

Code: Select all

{
	"status" : "OK",
	"title" : "Update Device"
}
And the Data is updated in the Domoticz
2023-10-07 22_16_58-Domoticz.png
2023-10-07 22_16_58-Domoticz.png (17.33 KiB) Viewed 11298 times
Somehow it looks like the way the data is send is not accepted anymore or there is some other issue?
Is the way it is send from ESP different then it is in the serial Log?

I also tried different settings, als changing the port to "443" and "8443" but also did not help. Those settings did change the error reported back.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Access to Domoticz_2023.2

#31 Post by TD-er » 07 Oct 2023, 22:51

Ports 443 and 8443 are very likely meant for HTTPS (not HTTP) and that's not yet supported in ESPEasy.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#32 Post by Ath » 08 Oct 2023, 11:09

Again/still there is a HTTP 401 error, meaning "not authorized".
Seems you have some Username/Password set in your ESPEasy Domoticz Controller configuration, as that information is only included if it is set. According to your SendToHTTP example, you don't need that so it should (also) be removed (cleared) from the controller settings.
/Ton (PayPal.me)

Bluesea
New user
Posts: 5
Joined: 16 Jun 2020, 15:26
Location: Switzerland

Re: Access to Domoticz_2023.2

#33 Post by Bluesea » 13 Oct 2023, 20:02

Hello

I had the same here. To disable the API Protection solved the issue.
Attachments
Screenshot 2023-10-13 200040.jpg
Screenshot 2023-10-13 200040.jpg (38.73 KiB) Viewed 11184 times

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Access to Domoticz_2023.2

#34 Post by Ath » 13 Oct 2023, 20:48

Bluesea wrote: 13 Oct 2023, 20:02 Hello

I had the same here. To disable the API Protection solved the issue.
That's really helpful, and also very easy to fix. Thanks :!:
/Ton (PayPal.me)

Bert'Ridder
Normal user
Posts: 11
Joined: 08 Jan 2018, 13:15

Re: Access to Domoticz_2023.2

#35 Post by Bert'Ridder » 14 Oct 2023, 13:38

Hello,

for me now it is working. I not really understand the reasons.

What did i do:

- Removed the API Protection => Didn't solve it
- On the ESP32, I disabled the Credentials.
- On the Domoticz, I deleted the Trusted Networks
- On the ESP i enabled the Credentials again. Now some Values were updated from that one ESP
- On the Domotics I enaalble the API- Protection alllowance for HTTP again
- On the Domotics did add the Trusted Networks again woth 127.0.0.0.*; 192.168.178.*; 127.0.0.1
- on the other ESP's I disabled an after that enabled the Credentials again

After all this testing, now all the Data is transferred to my Domoticz again.

What is the cause ? I don't know.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 37 guests