No transfer to domoticz [Solved]

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

No transfer to domoticz [Solved]

#1 Post by ManS-H » 26 Aug 2022, 13:02

Hello,

I was very careless not to secure Domoticz with a password.
Now I have secured Domoticz with a username and password and also used this data at the EspEasy Controller page and then did a reboot at the ESP.
But now no data is going to Domoticz.
What am I doing wrong?
Last edited by ManS-H on 28 Aug 2022, 11:51, edited 1 time in total.

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

Re: No transfer to domoticz

#2 Post by Ath » 26 Aug 2022, 13:15

A few possibilities:
- Password is very long (> 32 characters)? -> Enable 'Use Extended Credentials' and re-enter the password
- Made a typo in the Controller Password? -> re-enter the password
- Made a typo in the Controller User? -> re-enter the username
- Are you using the http port for Domoticz? By default it enables https (SSL/TLS), and you have to enable http access, f.e. on port 8080, as ESPEasy doesn't (yet) support https
/Ton (PayPal.me)

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#3 Post by ManS-H » 26 Aug 2022, 13:25

Ath wrote: 26 Aug 2022, 13:15 A few possibilities:
- Password is very long (> 32 characters)? -> Enable 'Use Extended Credentials' and re-enter the password
- Made a typo in the Controller Password? -> re-enter the password
- Made a typo in the Controller User? -> re-enter the username
- Are you using the http port for Domoticz? By default it enables https (SSL/TLS), and you have to enable http access, f.e. on port 8080, as ESPEasy doesn't (yet) support https
The username and password i copies from a file to Domoticz and EspEasy they are the same, but i use the character "-" in the username. Can that be the problem?

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

Re: No transfer to domoticz

#4 Post by Ath » 26 Aug 2022, 14:00

What Domoticz controller are you using, HTTP or MQTT?
ManS-H wrote: 26 Aug 2022, 13:25 The username and password i copies from a file to Domoticz and EspEasy they are the same, but i use the character "-" in the username. Can that be the problem?
It should not matter, but if you can change it, it won't hurt either. If it does make a difference, then we might need to fix this on ESPEasy.
Edit: Checked the source, but the username is used without any parsing, so it really shouldn't matter.
/Ton (PayPal.me)

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

Re: No transfer to domoticz

#5 Post by TD-er » 26 Aug 2022, 14:54

Which build are you using?
Since the last build, there is an issue with sending to HTTP, on which I'm working hard to fix.

The build from June should not have this issue.

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#6 Post by ManS-H » 26 Aug 2022, 19:02

ManS-H wrote: 26 Aug 2022, 13:25
Ath wrote: 26 Aug 2022, 13:15 A few possibilities:
- Password is very long (> 32 characters)? -> Enable 'Use Extended Credentials' and re-enter the password
- Made a typo in the Controller Password? -> re-enter the password
- Made a typo in the Controller User? -> re-enter the username
- Are you using the http port for Domoticz? By default it enables https (SSL/TLS), and you have to enable http access, f.e. on port 8080, as ESPEasy doesn't (yet) support https
The username and password i copies from a file to Domoticz and EspEasy they are the same, but i use the character "-" in the username. Can that be the problem?
I use a no secure port: 192.168.xxx.xx:8080
I checked all thing several times, even when i change Username and Password in a "A", without quotes it doesn't work. Leaving user and password in Domoticz and EspEasy empty i have no troubles at all. Where must search it? Domoticz of EspEasy?

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#7 Post by ManS-H » 26 Aug 2022, 19:04

TD-er wrote: 26 Aug 2022, 14:54 Which build are you using?
Since the last build, there is an issue with sending to HTTP, on which I'm working hard to fix.

The build from June should not have this issue.
I used this build: ESP_Easy_mega_20210223_normal_ESP8266_4M1M

I use various builds side by side under the motto "If it works well, don't change a thing".
But I it 15 units with EspEasy, which build do you recommend me to use for all the same, is then Release mega-20220616 the right choice?

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

Re: No transfer to domoticz

#8 Post by Ath » 26 Aug 2022, 19:44

What Domoticz version are you running? The latest (& greatest)?
And you haven't disclosed what type of controller you use, HTTP or MQTT?
/Ton (PayPal.me)

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

Re: No transfer to domoticz

#9 Post by Ath » 26 Aug 2022, 20:18

Just to be sure I tested on Domoticz 2022.1 (latest GA release, AFAIK) using both the Domoticz MQTT and HTTP controllers (latest mega code) and both controllers work as expected with my username/password configured Domoticz, at least when sending a switch state, so that gives me confidence to say that "It Works" as intended.
/Ton (PayPal.me)

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#10 Post by ManS-H » 26 Aug 2022, 20:27

Ath wrote: 26 Aug 2022, 19:44 What Domoticz version are you running? The latest (& greatest)?
And you haven't disclosed what type of controller you use, HTTP or MQTT?
The latest and i use http

I see something strange, have updated 2 units to HEAD_56d3225, 20116 - Mega The data is refreshed with user and password in EspEasy and Domoticz. Only the values of the CO2 are not taken into account, they are in the same housing.
ESP-1.jpg
ESP-1.jpg (29.25 KiB) Viewed 9164 times
ESP-2.jpg
ESP-2.jpg (24.76 KiB) Viewed 9164 times
I used this rule for it:
on CO2#PPM do
SendToHTTP,192.168.xxx.xx,8080,/json.htm?param=udevice&type=command&idx=4706&nvalue=[CO2#PPM]
endon

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

Re: No transfer to domoticz

#11 Post by TD-er » 26 Aug 2022, 22:11

There used to be some issue with CO2, at least when using a device in Domoticz defined as CO2 sensor.
The CO2 plugin in ESPEasy does send it as nvalue and it should be svalue (or vise verse)
That's the reason I've been using the CO2 sensors as "custom" in Domoticz.
But that's an issue for when sending it via the Domoticz controllers.

When sending it via rules, you must add credentials, which is only added very recently and which is also what is somewhat breaking the sendtohttp on the last build.

Can you try this build from GitHub Actions: https://github.com/letscontrolit/ESPEas ... 2925704851
You need to be logged in on GitHub to download it.
The Zip file is "Binaries" right below the Artifacts label.

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#12 Post by ManS-H » 27 Aug 2022, 11:54

TD-er wrote: 26 Aug 2022, 22:11 There used to be some issue with CO2, at least when using a device in Domoticz defined as CO2 sensor.
The CO2 plugin in ESPEasy does send it as nvalue and it should be svalue (or vise verse)
That's the reason I've been using the CO2 sensors as "custom" in Domoticz.
But that's an issue for when sending it via the Domoticz controllers.

When sending it via rules, you must add credentials, which is only added very recently and which is also what is somewhat breaking the sendtohttp on the last build.

Can you try this build from GitHub Actions: https://github.com/letscontrolit/ESPEas ... 2925704851
You need to be logged in on GitHub to download it.
The Zip file is "Binaries" right below the Artifacts label.
I know that the custom CO2 sensor works well with Domoticz but I miss that the text whether the air quality is good, bad or average.
I have installed ESP_Easy_mega_20220825_collection_C_ESP8266_4M1M but now maybe a stupid question? How do I put the username and password in a rule format.
I can't find any info on this. I read the discussion with ThomasB on the same question, but then my knowledge falls short.

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

Re: No transfer to domoticz

#13 Post by Ath » 27 Aug 2022, 12:07

ManS-H wrote: 27 Aug 2022, 11:54 ...How do I put the username and password in a rule format.
I can't find any info on this. I read the discussion with ThomasB on the same question, but then my knowledge falls short.
I send some special commands to Domoticz using this type of command:

Code: Select all

SendToHTTP,192.168.1.xxx,8080,/json.htm?username= cGk= &password= UGFzc3dvcmQ= &type=command&param=switchscene&idx=4&switchcmd=On
The username (pi) and password (Password) arguments need to be Base64 encoded, with padding (Notepad++ plugin Mime tools will do that nicely for you) (don't worry, those are not my real username/password :lol:)
I put some spaces around them, to show what is exactly put there, but you will need to remove the spaces to have it work correctly!
The param, idx and other arguments depend on the device you need to control, and should be extracted from Domoticz documentation.
/Ton (PayPal.me)

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

Re: No transfer to domoticz

#14 Post by TD-er » 27 Aug 2022, 12:56

Why not use the username:password@hostname syntax?

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

Re: No transfer to domoticz

#15 Post by Ath » 27 Aug 2022, 13:20

TD-er wrote: 27 Aug 2022, 12:56 Why not use the username:password@hostname syntax?
That feature is only introduced very recent, and the unit that is running that script is already in use for a few years ;)
/Ton (PayPal.me)

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

Re: No transfer to domoticz

#16 Post by TD-er » 27 Aug 2022, 14:15

Yep but it is working (or at least supposed to work) in the build I linked.

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#17 Post by ManS-H » 27 Aug 2022, 17:42

Ath wrote: 27 Aug 2022, 12:07
ManS-H wrote: 27 Aug 2022, 11:54 ...How do I put the username and password in a rule format.
I can't find any info on this. I read the discussion with ThomasB on the same question, but then my knowledge falls short.
I send some special commands to Domoticz using this type of command:

Code: Select all

SendToHTTP,192.168.1.xxx,8080,/json.htm?username= cGk= &password= UGFzc3dvcmQ= &type=command&param=switchscene&idx=4&switchcmd=On
The username (pi) and password (Password) arguments need to be Base64 encoded, with padding (Notepad++ plugin Mime tools will do that nicely for you) (don't worry, those are not my real username/password :lol:)
I put some spaces around them, to show what is exactly put there, but you will need to remove the spaces to have it work correctly!
The param, idx and other arguments depend on the device you need to control, and should be extracted from Domoticz documentation.
Or I'm doing something wrong, but it's not working. Even with only user and password I get an error message
I use this for converting user and password, https://codebeautify.org/base64-decode

21720738: ACT : SendToHTTP,192.168.xxx.xx,8080,/json.htm?username=xxxxxx=&password=xxxxxx
21720759: HTTP : SendToHTTP 192.168.xxx.xx GET... failed HTTP code: 401

What I would like is this:
SendToHTTP,192.168.xxx.xx,8080,/json.htm?username=xxxxx=&password=xxxx and this:
SendToHTTP,192.168.178.53,8080,/json.htm?param=udevice&type=command&idx=4578&nvalue=[CO2#PPM]
in one rule

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

Re: No transfer to domoticz

#18 Post by Ath » 27 Aug 2022, 18:39

You have to include the authentication and the command in the same request, it doesn't 'stick' after the first one. My example is working like that.
/Ton (PayPal.me)

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#19 Post by ManS-H » 27 Aug 2022, 19:37

Ath wrote: 27 Aug 2022, 18:39 You have to include the authentication and the command in the same request, it doesn't 'stick' after the first one. My example is working like that.
Ik haak af. Even with your line and my ip and user,& password is get this: HTTP : SendToHTTP 192.168.xxx.xx GET... failed HTTP code: 401

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

Re: No transfer to domoticz

#20 Post by Ath » 27 Aug 2022, 19:54

TD-er wrote: 26 Aug 2022, 22:11 When sending it via rules, you must add credentials, which is only added very recently and which is also what is somewhat breaking the sendtohttp on the last build.

Can you try this build from GitHub Actions: https://github.com/letscontrolit/ESPEas ... 2925704851
Have you tried to download the build that TD-er linked? That should have the 401 errors fixed.
/Ton (PayPal.me)

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz

#21 Post by ManS-H » 27 Aug 2022, 20:01

Ath wrote: 27 Aug 2022, 19:54
TD-er wrote: 26 Aug 2022, 22:11 When sending it via rules, you must add credentials, which is only added very recently and which is also what is somewhat breaking the sendtohttp on the last build.

Can you try this build from GitHub Actions: https://github.com/letscontrolit/ESPEas ... 2925704851
Have you tried to download the build that TD-er linked? That should have the 401 errors fixed.
I wrote that before: I have installed ESP_Easy_mega_20220825_collection_C_ESP8266_4M1M but now maybe a stupid question? How do I put the username and password in a rule format.
This is the one i worked with: Build: ESP_Easy_mega_20220825_collection_C_ESP8266_4M1M Aug 25 2022
And still i have GET... failed HTTP code: 401

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

Re: No transfer to domoticz

#22 Post by TD-er » 27 Aug 2022, 20:08

sendtohttp,username:password@ip,80,.... (or whatever port you need)
Or (this is also new)
sendtohttp,http://username:password@ip/....
Or if you need to specify the port like 8080:
sendtohttp,http://username:password@ip:8080/....

With of course username and password replaced with whatever you've got
IP to be replaced by either IP or DNS hostname.

N.B. make sure you don't have characters like these in your password:

Code: Select all

: " ,

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz [Solved]

#23 Post by ManS-H » 28 Aug 2022, 11:50

TD-er wrote: 27 Aug 2022, 20:08 sendtohttp,username:password@ip,80,.... (or whatever port you need)
Or (this is also new)
sendtohttp,http://username:password@ip/....
Or if you need to specify the port like 8080:
sendtohttp,http://username:password@ip:8080/....

With of course username and password replaced with whatever you've got
IP to be replaced by either IP or DNS hostname.

N.B. make sure you don't have characters like these in your password:

Code: Select all

: " ,
The problem is solved, everything is working properly again.
Gijs and Ton thanks for the help and patience.

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

Re: No transfer to domoticz [Solved]

#24 Post by TD-er » 28 Aug 2022, 11:53

Great!
And just at the moment I was thinking about actually fixing the CO2-type to Domoticz controllers which is an outstanding issue for the last years...
This is a perfect excuse to procrastinate ;)

User avatar
ManS-H
Normal user
Posts: 281
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: No transfer to domoticz [Solved]

#25 Post by ManS-H » 28 Aug 2022, 12:08

TD-er wrote: 28 Aug 2022, 11:53 Great!
And just at the moment I was thinking about actually fixing the CO2-type to Domoticz controllers which is an outstanding issue for the last years...
This is a perfect excuse to procrastinate ;)
This works perfect now. :D
CO2-3.jpg
CO2-3.jpg (37.77 KiB) Viewed 9019 times

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 39 guests