ESPEasy P1 wifi gateway GPIO Idx

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

ESPEasy P1 wifi gateway GPIO Idx

#1 Post by DomoticaRob » 08 Dec 2018, 23:18

I can't fill in the GPIO port and Idx in Devices.

What do I do wrong?


P1_2.png
P1_2.png (21.17 KiB) Viewed 2557 times
P1_1.png
P1_1.png (25.47 KiB) Viewed 2557 times

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#2 Post by Domosapiens » 09 Dec 2018, 01:37

Suggestion to poster: what version ?

Suggestion to Dev's: Show version in white area of the header.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#3 Post by DomoticaRob » 09 Dec 2018, 06:05

I'm sorry, I forgot.

Version:

ESP_Easy_mega-20181112_normal_ESP8285_1024.bin

On a ESP8266 ESP-01.

User avatar
grovkillen
Core team member
Posts: 3284
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESPEasy P1 wifi gateway GPIO Idx

#4 Post by grovkillen » 09 Dec 2018, 08:01

We're planning on doing a issue/forum poster function that will copy all info and do the screenshots. I hope that will make the opening post better.
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 :idea: :idea: :idea:

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#5 Post by Domosapiens » 09 Dec 2018, 10:13

Here v2.0.0-dev12 running
Looks the same as your P1_1.png

P1 connected to Rx
Set Serial log level to 0
No IDX needed for Domoticz (if you use that??)
TCP Port 8088
Create "P1 Smart Meter with LAN interface" in the HW interface of Domoticz
TCP Port 8088

I use this connection diagram
P1 smart meter ser2net.JPG
P1 smart meter ser2net.JPG (196.28 KiB) Viewed 2539 times
OLED is useless for local P1 values.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#6 Post by DomoticaRob » 09 Dec 2018, 21:59

Hello Domosapiens,

Thanks for your reply.

I have made what is in your connection diagram. Instead of your Wemos I use a ESP-01 board.
When I measure with my osciloscoop on point (2) and (3) I see every second a burst of ones and zeros. At point (3) it's inverted.

Where do I set the Serial log level to 0?

If I create "P1 Smart Meter with LAN interface" I see it in the Hardware list, but not in the 'Overige' tab.

Can I use Putty to see if the ESP-01 gives characters? If yes, how do I configure Putty?

Image
Hardware.png
Hardware.png (84.95 KiB) Viewed 2526 times
Overige.png
Overige.png (73.23 KiB) Viewed 2526 times
Attachments
Putty.png
Putty.png (17.01 KiB) Viewed 2526 times

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#7 Post by Domosapiens » 09 Dec 2018, 23:19

When I measure with my oscilloscope on point (2) and (3) I see every second a burst of ones and zeros. At point (3) it's inverted.
Good!
Where do I set the Serial log level to 0?
ESP Easy, Tools, Advanced, Serial log level
Check Domoticz tab Devices, filter on P1, you should see 2 devices: Energy and Gas.
If they have a green arrow, click on it, to make it blue.
Then they should appear in the Utility Tab (refresh it!)
Can I use Putty to see if the ESP-01 gives characters? If yes, how do I configure Putty?
Yes, but one connection at the time! If Putty is connected, then no Domoticz and the other way around
Reboot the ESP in-between
Stop/Start the P1 in Domoticz to re-start the connection
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#8 Post by DomoticaRob » 10 Dec 2018, 21:38

Many thanks, it works, super.

Is there a possibility to see in Domoticz also the other data from the smart meter? For example, the cummulative data. Can I program something with lua or DZVents?


P1_3.png
P1_3.png (18.92 KiB) Viewed 2490 times
P1_4.png
P1_4.png (87.75 KiB) Viewed 2490 times

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#9 Post by Domosapiens » 10 Dec 2018, 22:11

Can I program something with lua or DZVents?

Yes you can ;)
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#10 Post by DomoticaRob » 10 Dec 2018, 22:27

Hahahahah, yes you are right.

I found something that was made by McMellow:

Code: Select all

--https://www.domoticz.com/forum/viewtopic.php?f=59&t=20382&p=158563&sid=3f9e4bd3012129d745aa0c1900b53461#p158563

--[[  dzVents script to Parse P1 Smart Meter Electricity value into seperated Meter Readings.

]]--  The following need updated for your environment get the 'Idx' or 'Name' of the Device tab.

local fetchIntervalMins = 1                 -- (Integer) (Minutes, Range 5-60) How often SE file is fetched
local P1data = 33                           -- Electra, P1 Smart Meter device
local idxu1 = 42                            -- Meter Usage low, Virtual device, counter incremental
local idxu2 = 43                            -- Meter Usage High, Virtual device, counter incremental
local idxr1 = 44                            -- Meter Return Low, Virtual device, counter incremental
local idxr2 = 45                            -- Meter Return High, Virtual device, counter incremental
local idxcons = 74                          -- Meter Actual Usage, Virtual device, counter incremental
local idxprod = 75                          -- Meter Actual Production, Virtual device, counter incremental

local ScriptVersion = '0.1.6'

return {
    active = true,
	logging = {
	    -- level = domoticz.LOG_DEBUG,    -- Uncomment this line to override the dzVents global logging setting
		marker = 'SME '.. ScriptVersion
	},
	on = {
		devices = { P1data }
	},
	
	execute = function(domoticz, triggerItem)
	    if (triggerItem.isDevice) then
	    
        -- Get values from device P1Data of the Smart Meter
	    local SMdata = domoticz.devices(P1data).rawData
	    
	    -- Update the device and Debug meassages with the accessory values from table SMdata
        domoticz.devices(idxu1).updateCounter(SMdata[1])
        domoticz.log('Gebruik laag  = '.. SMdata[1], domoticz.LOG_DEBUG)
        domoticz.devices(idxu2).updateCounter(SMdata[2])
	    domoticz.log('Gebruik hoog  = '.. SMdata[2], domoticz.LOG_DEBUG)
        domoticz.devices(idxr1).updateCounter(SMdata[3])
	    domoticz.log('Levering laag = '.. SMdata[3], domoticz.LOG_DEBUG)
        domoticz.devices(idxr2).updateCounter(SMdata[4])
        domoticz.log('Levering hoog = '.. SMdata[4], domoticz.LOG_DEBUG)
        domoticz.devices(idxcons).updateCounter(SMdata[5])
	    domoticz.log('Actuele Gebruik = '.. SMdata[5], domoticz.LOG_DEBUG)
	    domoticz.devices(idxprod).updateCounter(SMdata[6])
        domoticz.log('Actuele Levering = '.. SMdata[6], domoticz.LOG_DEBUG)
        end
    end -- execute
}

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#11 Post by DomoticaRob » 10 Dec 2018, 22:34

P1_5.png
P1_5.png (58.28 KiB) Viewed 2485 times

Domosapiens
Normal user
Posts: 291
Joined: 06 Nov 2016, 13:45

Re: ESPEasy P1 wifi gateway GPIO Idx

#12 Post by Domosapiens » 10 Dec 2018, 23:51

Good find Rob!
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

gert3d
Normal user
Posts: 8
Joined: 12 Nov 2017, 21:46

Re: ESPEasy P1 wifi gateway GPIO Idx

#13 Post by gert3d » 11 Oct 2019, 22:27

I followed the advices above and got readings using Putty from the P1 port of the smart meter: T210-D ESMR5

ESP-Easy version ESP_Easy_mega-20191003_normal_ESP8266_4M1M.bin on a node-MCU, circuit and parameters as shown by Domosapiens and DomoticaRob, Domoticz (running on a Synology DS212J) : P1 Smart Meter with LAN interface with parameters as shown
Runs perfectly

But have a queston about DZVents script: how to use this?

DomoticaRob
Normal user
Posts: 38
Joined: 17 Jan 2018, 18:43

Re: ESPEasy P1 wifi gateway GPIO Idx

#14 Post by DomoticaRob » 12 Oct 2019, 17:05

What do you mean with 'How to use this'?

What is your purpose?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests