Pzem04t valueus splitting
Moderator: leecollings
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Pzem04t valueus splitting
Hi i've an Esp Easy conntected to Pzem04 module and works fine, but i only get te value's seperately when in make 4 devices in ESP EASY.
and for each i've created a seperate IDX, and so i've each time selected a dummy for Current/Voltage/power. But is it possible to use one idx for example idx 107 en split te values into 4 seperate dummies ?
I hope you under stand what i mean. this is what i mean when i created like this i've every index the first value on each idx.
hope someone can help me, it's working this way but i thing it's sendign to much data for i what i'll use
grtz Spike
and for each i've created a seperate IDX, and so i've each time selected a dummy for Current/Voltage/power. But is it possible to use one idx for example idx 107 en split te values into 4 seperate dummies ?
I hope you under stand what i mean. this is what i mean when i created like this i've every index the first value on each idx.
hope someone can help me, it's working this way but i thing it's sendign to much data for i what i'll use
grtz Spike
-
- Posts: 48
- Joined: Monday 10 December 2018 23:32
- Target OS: Linux
- Domoticz version:
- Location: Poland
- Contact:
Re: Pzem04t valueus splitting
Almost cried trying using Espeasy with PZEMs. So I decided to use Tasmota and Nodered Getting data by MQTT splitting parsing and sending to Domoticz
- waltervl
- Posts: 5735
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Pzem04t valueus splitting
If I read the following topic they use ESPEASY Rules to send the data to domoticz viewtopic.php?p=198863#p198863
etrubin wrote: ↑Tuesday 27 November 2018 17:14 Piacco!
1. In ESP EASY go to Tools-Advanced and enable Rules.
2. In ESP EASY go to your pzem device set name pzem1
3. In ESP EASY set Values as on pic:
ScreenClip.png
4. In ESP EASY go to Rules tab and place in text field:
do not forget to change IP, Port and IDX of each device.Code: Select all
on pzem1#Current do SendToHTTP 192.168.0.100,8080,/json.htm?type=command¶m=udevice&idx=30&nvalue=0&svalue=[pzem1#Voltage] SendToHTTP 192.168.0.100,8080,/json.htm?type=command¶m=udevice&idx=31&nvalue=0&svalue=[pzem1#Current] SendToHTTP 192.168.0.100,8080,/json.htm?type=command¶m=udevice&idx=32&nvalue=0&svalue=[pzem1#Power] endon
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
i have a username and paswoord on my mqtt broker, where can i put these in this rule ?
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
i did this but no result
on pzem1#Current_A do
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=192&nvalue=0&svalue=[pzem1#Voltage_V]
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=191&nvalue=0&svalue=[pzem1#Current]
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=192&nvalue=0&svalue=[pzem1#Power]
endon
on pzem1#Current_A do
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=192&nvalue=0&svalue=[pzem1#Voltage_V]
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=191&nvalue=0&svalue=[pzem1#Current]
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=192&nvalue=0&svalue=[pzem1#Power]
endon
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Pzem04t valueus splitting
Hello @spike318,
Can you explain a little detailed, what type of devices you want to use in Domoticz.
What do they have to show.
You wrote:
But:
Regards
Can you explain a little detailed, what type of devices you want to use in Domoticz.
What do they have to show.
You wrote:
Which rule? Normally the username/password for MQTT is set in the client request.i have a username and paswoord on my mqtt broker, where can i put these in this rule ?
But:
These are http JSON calls to Domoticz and has no relationship with MQTT.SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=192&nvalue=0&svalue=[pzem1#Voltage_V]
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=191&nvalue=0&svalue=[pzem1#Current]
SendToHTTP spike:[email protected]:8080,/json.htm?type=command¶m=udevice&idx=192&nvalue=0&svalue=[pzem1#Power]
Regards
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
i use esp easy energy , i want these values
this is my config in esp easy
esp easy sent al the value to one idx, i want to seperate these.
and afther one is working i'll use 3 pzem modules on one wemos d1.
and i have set my mqqt broker
the value screen is an example of tasmota to domoticz but i want to use esp easy because i can use more pzem modules on one Wemos d1, or else i have to use for each pzem module one Wemos D1. Dus i gues there must be a simple solution to my problem i hope

and afther one is working i'll use 3 pzem modules on one wemos d1.
and i have set my mqqt broker
the value screen is an example of tasmota to domoticz but i want to use esp easy because i can use more pzem modules on one Wemos d1, or else i have to use for each pzem module one Wemos D1. Dus i gues there must be a simple solution to my problem i hope
- Attachments
-
- devices.png (36.79 KiB) Viewed 3322 times
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Pzem04t valueus splitting
Hello @spike318
Is it possible to show a screenshot of e.g. MQTT Explorer, so that we can see how it is published to your MQTT broker?
Would be helpfull.
Regards
Is it possible to show a screenshot of e.g. MQTT Explorer, so that we can see how it is published to your MQTT broker?
Would be helpfull.
Regards
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
Grtz Spike
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
power, current, voltage, energy
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Pzem04t valueus splitting
Hello @spike318
Sorry, that I keep asking questions, but for confirmation:
You receive from your device under the topic domoticz/in:
This topic is configured in your esp easy software, I conclude.{"idx":190, "RSSI":8,"nvalue":0,"svalue":"21.80;0;236.10;0.28"}
But you do not have a suitable device who can handle these values.
I also understand that in the above message:
Power = 21.80 (in Watt or kilowatt?) I assume Watt.
Current = 0 A. This is not very accurate, as you obviously consumes power.
Voltage = 236.10 Volt
Energy =0.28 (Wh or kWh) I assume kWh
Power and Energy can be combined in one sensor Electric, but can also be separated
Current has its own sensor Ampere
Voltage has its own sensor Voltage
If I look to your picture, you want them separated.
As you are not able to use the received input directly in Domoticz, as there does not exist a widget that accept 4 values and can present the values,
you have to covert them to 3 or 4 idx in Domoticz. Node Red can do that for you.
In that case I suggest to modify your topic in the ESP Easy to something as pzem04t/device1
You can also omit the IDX, as this is specific Domoticz related.
If you can confirm, it is quite simple to create a Node Red flow.
Regards
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
these are the value that i have in esp easy, on my Rasperry Pi i have node red running, but i'm a beginner in this so if you can help me please your welcome, and thans for all the efforts you do for me i appriciate this verry much
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
T
Hello @spike318,
Sorry to say, but the more pictures you post, the more confused I get.
1. Domoticz has no sensor (widget) that can display power, current, voltage and energy in one and the same widget.
So you need separate sensors for power, current, voltage and energy, although you can combine power and energy in 1 widget.
2. It is a bad idea to publish a value to domoticz/in, which is not properly formatted for the sensor where the IDX is referring to.
Maybe and hopefully the message you send to domoticz/in is rejected by Domoticz as the part "command:udevice" is missing.
This commands contains for svalue 4 values separated by a semicolon (;). No sensor exists, that requires 4 values in the "svalue" field.
Probably you will find in the Domoticz log, a message indicating something as "MQTT bad command received".
In the last picture you send I see that you have the option (if you uncheck the box) an event for each individual value and if you check the box all values are combined in one message.
So there is no need for Node Red (or something else) to parse the message as it can be done by ESP-Easy.
But do not publish to domoticz/in!
I would suggest to create a topic for each pzem module and value, such as "pzem1/voltage, and publish that.
If the right values are published to the MQTT broker Node Red can send the right data, properly formatted, to the Domoticz sensor.
And that for each pzem module.
Can you show in MQTT Explorer, what you see if you change the topic to:
pzem1/power, pzem1/current, pzem1/voltage and pzem1/energy?
Make it simple so send just the value and their is no need for a Domoticz IDX, nvalue or svalue.
And uncheck the box.
Regards
Sorry to say, but the more pictures you post, the more confused I get.
1. Domoticz has no sensor (widget) that can display power, current, voltage and energy in one and the same widget.
So you need separate sensors for power, current, voltage and energy, although you can combine power and energy in 1 widget.
2. It is a bad idea to publish a value to domoticz/in, which is not properly formatted for the sensor where the IDX is referring to.
Maybe and hopefully the message you send to domoticz/in is rejected by Domoticz as the part "command:udevice" is missing.
This commands contains for svalue 4 values separated by a semicolon (;). No sensor exists, that requires 4 values in the "svalue" field.
Probably you will find in the Domoticz log, a message indicating something as "MQTT bad command received".
In the last picture you send I see that you have the option (if you uncheck the box) an event for each individual value and if you check the box all values are combined in one message.
So there is no need for Node Red (or something else) to parse the message as it can be done by ESP-Easy.
But do not publish to domoticz/in!
I would suggest to create a topic for each pzem module and value, such as "pzem1/voltage, and publish that.
What is the purpose of the Wemos D1?esp easy sent al the value to one idx, i want to separate these.
and after one is working i'll use 3 pzem modules on one wemos d1.
If the right values are published to the MQTT broker Node Red can send the right data, properly formatted, to the Domoticz sensor.
And that for each pzem module.
Can you show in MQTT Explorer, what you see if you change the topic to:
pzem1/power, pzem1/current, pzem1/voltage and pzem1/energy?
Make it simple so send just the value and their is no need for a Domoticz IDX, nvalue or svalue.
And uncheck the box.
Regards
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
Grz Can't i do this by a DZevent or Lua Script ?
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Pzem04t valueus splitting
Hello @spike318
I said in my previous post:
I also asked you:
Regards
I said in my previous post:
You still send the data to Domoticz with the topic domoticz/in, which is not correctly formatted.2. It is a bad idea to publish a value to domoticz/in, which is not properly formatted for the sensor where the IDX is referring to.
Maybe and hopefully the message you send to domoticz/in is rejected by Domoticz as the part "command:udevice" is missing.
This commands contains for svalue 4 values separated by a semicolon (;). No sensor exists, that requires 4 values in the "svalue" field.
Probably you will find in the Domoticz log, a message indicating something as "MQTT bad command received".
I also asked you:
You ignored this request, so I'm sorry to say, that I'm not able to help you further, as I am not a specialist in dZVents or Lua.If the right values are published to the MQTT broker Node Red can send the right data, properly formatted, to the Domoticz sensor.
And that for each pzem module.
Can you show in MQTT Explorer, what you see if you change the topic to:
pzem1/power, pzem1/current, pzem1/voltage and pzem1/energy?
Make it simple so send just the value and there is no need for a Domoticz IDX, nvalue or svalue.
And uncheck the box.
Regards
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
Hi again i'll did the next thing and this is what is sent to domoticz by an esp easy rule
but i don't receive anyting
and in my mqtt explorer i can't fint these data, i'll miss something but i don't know it ?- Attachments
-
- 2021-05-05 17_37_51-DIEPENBEEK.png (18.51 KiB) Viewed 3224 times
- waltervl
- Posts: 5735
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Pzem04t valueus splitting
You are now NOT sending to MQTT but directly to the Domoticz API: https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s
If you type the same command in a browser does it work? If yes, the rule in ESP Easy is wrong so the message becomes malformed.
The command below should set the voltage to 12V
If you type the same command in a browser does it work? If yes, the rule in ESP Easy is wrong so the message becomes malformed.
The command below should set the voltage to 12V
Code: Select all
http://192.168.1.19:8080/json.htm?type=command¶m=udevice&idx=200&nvalue=0&svalue=12
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- FireWizard
- Posts: 1863
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Pzem04t valueus splitting
You can go on with your "next thing", but I recommend to accept the support and give answers to the questions.Hi again i'll did the next thing and this is what is sent to domoticz by an esp easy rule
In this case, I see that you try to send:
Code: Select all
http://192.168.1.19,8080,/json.htm?type=command m=udevice&idx=198&nvalue=0&svalue=232
And what the character after command means? No clue.
And as said earlier and this is also clearly expressed by @waltervl, what you try to do has no relation with MQTT and you can watch for hours to your MQTT Explorer, but nothing will happen.
Regards
-
- Posts: 20
- Joined: Saturday 09 January 2021 18:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pzem04t valueus splitting
Hi when i do the code i receive te value in domoticz, but when i put it in a rule, it doesn't work, but nevermind, i m gonna try again by mqtt and send more seperate values in Esp Easy ! I hope i ll get out of my problem.
- waltervl
- Posts: 5735
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Pzem04t valueus splitting
Well, it is up to you but I think the http API/json way of working should be a lot easier. Just a matter of good ESP rule definition. There should be examples for that to find.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 1 guest