SonOff POW R2 support
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: SonOff POW R2 support
For screenshots, just add them using the attachments tab below the editing box. (To the right of the options tab)
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: SonOff POW R2 support
Rien,
Try the DEV version so not the POW i run the DEV version with the CSE and all works ok for me.
Re: SonOff POW R2 support
Re: SonOff POW R2 support
What do you mean with "the CSE"
Thanks anyway for the fast response.
Thanks anyway for the fast response.
Re: SonOff POW R2 support
Hi is it possible that i have not the right POW version on the print is Ver 2.0 the measuring chip is HLW8012
With your configuration I have now no readings at all, so the measuring circuit seems not working.
Rien
With your configuration I have now no readings at all, so the measuring circuit seems not working.
Rien
Re: SonOff POW R2 support
Looks like you have the POW V2,0 where i have the new POW R2: https://www.itead.cc/sonoff-pow-r2.html
As this topic was about the R2 i assumed you had the R2 and not the V2.0
Re: SonOff POW R2 support
Hi,
I have put theESP_Easy_mega-20180615_hard_SONOFF_POW.bin in the device and now it works, no idea what was the problem.
Thanks for all the help, I keep an eye on this site the teller is of course most interesting.
I see that the voltage measuring is about 10 volt to low, is there a way to correct this?
Rien.
I have put theESP_Easy_mega-20180615_hard_SONOFF_POW.bin in the device and now it works, no idea what was the problem.
Thanks for all the help, I keep an eye on this site the teller is of course most interesting.
I see that the voltage measuring is about 10 volt to low, is there a way to correct this?
Rien.
Re: SonOff POW R2 support
Btw ... this is how Domoticz handles right now the incoming data from the POW (R2)
Keep in mind i did not set any divider yet but its clear to see its not adding but just restarting the counter.
Would say this rather might be something to fix in Domoticz wil post same graph in Domoticz forum as maybe someone has a bright idea there.
( http://www.domoticz.com/forum/viewtopic ... 14&t=23878 )
Keep in mind i did not set any divider yet but its clear to see its not adding but just restarting the counter.
Would say this rather might be something to fix in Domoticz wil post same graph in Domoticz forum as maybe someone has a bright idea there.
( http://www.domoticz.com/forum/viewtopic ... 14&t=23878 )
Re: SonOff POW R2 support
Update:
I Went to Tasmota for now as this does exactly what is required. It counts the usage internal and sends 2 values: Current Watt, Total Watt.
Might be an idea to look how its handled in Tasmota and implement similar in ESPEasy
The actual MQT message: 11:08:17 MQT: domoticz/in = {"idx":103,"nvalue":0,"svalue":"48;25.1","Battery":58,"RSSI":6}
I Went to Tasmota for now as this does exactly what is required. It counts the usage internal and sends 2 values: Current Watt, Total Watt.
Might be an idea to look how its handled in Tasmota and implement similar in ESPEasy
The actual MQT message: 11:08:17 MQT: domoticz/in = {"idx":103,"nvalue":0,"svalue":"48;25.1","Battery":58,"RSSI":6}
Re: SonOff POW R2 support
The following rules will allow the POW2 to report the data to domoticz. you create a Voltage, Amp, Watt, and Electric Counter (calculated) in domoticz as virtual devices. In addition you can add a virtual switch to toggle the relais_switch.
https://www.domoticz.com/forum/viewtopi ... 78#p187554
Devices 1: Energy (AC) - CSE7766 [TESTING] Energy
Devices 2: Switch input - Switch SW_1 GPIO-0
Devices 3: Switch input - Switch relais (idx 599) GPIO-12
Devices 4: Generic - System Info POW2_RSSI (idx 601)
Devices 5: Generic - Dummy Device Calculation
https://www.domoticz.com/forum/viewtopi ... 78#p187554
Devices 1: Energy (AC) - CSE7766 [TESTING] Energy
Devices 2: Switch input - Switch SW_1 GPIO-0
Devices 3: Switch input - Switch relais (idx 599) GPIO-12
Devices 4: Generic - System Info POW2_RSSI (idx 601)
Devices 5: Generic - Dummy Device Calculation
Code: Select all
On System#Boot do
TaskValueSet 5,1,0
TaskValueSet 5,2,0
TaskValueSet 5,3,0
EndOn
// LAMP CONTROLLING INCLUDING LED LIGHT
on lamp_on do
gpio,12,1
gpio,13,0
endon
on lamp_off do
gpio,12,0
gpio,13,1
endon
on SW_1#Switch do
if [SW_1#Switch]=1
gpio,12,1
gpio,13,0
else
gpio,12,0
gpio,13,1
endif
endon
on Energy#Voltage do
if Clock#Time=All,**:*0 do
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=600&nvalue=0&svalue=[Energy#Voltage]
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=608&nvalue=0&svalue=[Energy#Power]
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=603&nvalue=0&svalue=[Energy#Power]
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=604&nvalue=0&svalue=[Energy#Current]
endif
if [Energy#Voltage]!=[Calculation#Voltage]
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=600&nvalue=0&svalue=[Energy#Voltage] // Voltage
TaskValueSet 5,1,[Energy#Voltage]
endif
if [Energy#Power]!=[Calculation#Power]
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=603&nvalue=0&svalue=[Energy#Power] // Calculated KwH.
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=608&nvalue=0&svalue=[Energy#Power] // Watt only
TaskValueSet 5,2,[Energy#Power]
endif
if [Energy#Current]!=[Calculation#Current]
SendToHTTP 192.168.1.10,8080,/json.htm?type=command¶m=udevice&idx=604&nvalue=0&svalue=[Energy#Current] // Amp
TaskValueSet 5,3,[Energy#Current]
endif
TaskValueSet 5,4,[Energy#Pulses]
endon
Last edited by sincze on 18 Aug 2018, 13:34, edited 1 time in total.
Re: SonOff POW R2 support
This should be at the wiki I guess.
Re: SonOff POW R2 support
If it is good enough for the Wiki I can add it
Re: SonOff POW R2 support
Well it is clear enough for me, so if I install my own, I know where to look for instructions, but since I am not that well organized I am sure it will take forever to find again
So please do add it to the wiki.
Re: SonOff POW R2 support
Hi,
@sincze which version of mega do you use?
I have try mega_20180826 and mega_20180719, both correctly show values from CSE7759, but http push from rules doesn't work...
This rules work fine:
On WIFI#RSSI do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=[POW#Voltage]
endon
Confirmed by logs:
Aug 26 21:32:56 POW EspEasy: SYS : -77.00
Aug 26 21:32:56 POW EspEasy: EVENT: WIFI#RSSI=-77.00
Aug 26 21:32:56 POW EspEasy: ACT : SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=235.07
Aug 26 21:32:56 POW EspEasy: Command: sendtohttp
But this one is never triggered:
On POW#Current do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=89&nvalue=0&svalue=[POW#Power];[POW#Pulses]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=90&nvalue=0&svalue=[POW#Current]
endon
Greetings from Tahiti!
@sincze which version of mega do you use?
I have try mega_20180826 and mega_20180719, both correctly show values from CSE7759, but http push from rules doesn't work...
This rules work fine:
On WIFI#RSSI do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=[POW#Voltage]
endon
Confirmed by logs:
Aug 26 21:32:56 POW EspEasy: SYS : -77.00
Aug 26 21:32:56 POW EspEasy: EVENT: WIFI#RSSI=-77.00
Aug 26 21:32:56 POW EspEasy: ACT : SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=235.07
Aug 26 21:32:56 POW EspEasy: Command: sendtohttp
But this one is never triggered:
On POW#Current do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=89&nvalue=0&svalue=[POW#Power];[POW#Pulses]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=90&nvalue=0&svalue=[POW#Current]
endon
Greetings from Tahiti!
Re: SonOff POW R2 support
mmm strange indeed. ntp was enabled?? to have the timer work for you?Djoe wrote: ↑27 Aug 2018, 09:35 Hi,
@sincze which version of mega do you use?
I have try mega_20180826 and mega_20180719, both correctly show values from CSE7759, but http push from rules doesn't work...
This rules work fine:
On WIFI#RSSI do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=[POW#Voltage]
endon
Confirmed by logs:
Aug 26 21:32:56 POW EspEasy: SYS : -77.00
Aug 26 21:32:56 POW EspEasy: EVENT: WIFI#RSSI=-77.00
Aug 26 21:32:56 POW EspEasy: ACT : SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=235.07
Aug 26 21:32:56 POW EspEasy: Command: sendtohttp
But this one is never triggered:
On POW#Current do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=89&nvalue=0&svalue=[POW#Power];[POW#Pulses]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=90&nvalue=0&svalue=[POW#Current]
endon
Greetings from Tahiti!
Code: Select all
On System#Boot do
TaskValueSet 5,1,0
TaskValueSet 5,2,0
TaskValueSet 5,3,0
EndOn
// LAMP CONTROLLING INCLUDING LED LIGHT
on lamp_on do
gpio,12,1
gpio,13,0
endon
on lamp_off do
gpio,12,0
gpio,13,1
endon
on SW_1#Switch do
if [SW_1#Switch]=1
gpio,12,1
gpio,13,0
else
gpio,12,0
gpio,13,1
endif
endon
on Energy#Power do
if Clock#Time=All,**:*0 do
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=11&nvalue=0&svalue=[Energy#Voltage]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=18&nvalue=0&svalue=[Energy#Power]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=13&nvalue=0&svalue=[Energy#Power]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=14&nvalue=0&svalue=[Energy#Current]
endif
if [Energy#Voltage]!=[Calculation#Voltage]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=1&nvalue=0&svalue=[Energy#Voltage] // Voltage
TaskValueSet 5,1,[Energy#Voltage]
endif
if [Energy#Power]!=[Calculation#Power]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=13&nvalue=0&svalue=[Energy#Power] // Calculated KwH.
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=18&nvalue=0&svalue=[Energy#Power] // Watt only
TaskValueSet 5,2,[Energy#Power]
endif
if [Energy#Current]!=[Calculation#Current]
SendToHTTP x.x.x.x,8080,/json.htm?type=command¶m=udevice&idx=14&nvalue=0&svalue=[Energy#Current] // Amp
TaskValueSet 5,3,[Energy#Current]
endif
TaskValueSet 5,4,[Energy#Pulses]
endon
it will now be triggered if the Power value changes.. not the voltage.
Should be okay to get the data into domoticz.
Please let me know.
Re: SonOff POW R2 support
Thank you for your reply,
I don't use NTP (long time ago it was not stable and all is automated from domoticz).
But if you really want me to test with NTP I can do it (is there a link between NTP and a triggered property?)
I have tested again all properties as "trigger", here below the complete rules:
For information the "Pulses" property is configured with the formula : %value%/12530
There is no external sensor connected to this POW.
Here below the log (through syslog with "Info" level) :
Aug 27 20:46:09 POW EspEasy: SYS : -77.00
Aug 27 20:46:09 POW EspEasy: EVENT: WIFI#RSSI=-77.00
Aug 27 20:46:09 POW EspEasy: ACT : SendToHTTP 10.0.0.4,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=232.76
Aug 27 20:46:09 POW EspEasy: Command: sendtohttp
Aug 27 20:46:09 POW EspEasy: SYS : 484.00
Aug 27 20:46:09 POW EspEasy: EVENT: SONOFF#Uptime=484.00
Aug 27 20:46:10 POW EspEasy: Domoticz: Sensortype: 1 idx: 83 values: 484.00
Aug 27 20:46:10 POW EspEasy: WD : Uptime 485 ConnectFailures 0 FreeMem 14560
Aug 27 20:46:39 POW EspEasy: WD : Uptime 485 ConnectFailures 0 FreeMem 14584
Aug 27 20:47:09 POW EspEasy: WD : Uptime 486 ConnectFailures 0 FreeMem 14512
Aug 27 20:47:39 POW EspEasy: WD : Uptime 486 ConnectFailures 0 FreeMem 14512
Aug 27 20:48:09 POW EspEasy: WD : Uptime 487 ConnectFailures 0 FreeMem 14512
Aug 27 20:48:39 POW EspEasy: WD : Uptime 487 ConnectFailures 0 FreeMem 14512
Aug 27 20:49:09 POW EspEasy: WD : Uptime 488 ConnectFailures 0 FreeMem 14512
I have switch on and off 3 times the light connected to the POW... The value are correctly shown on the POW:
Voltage: 232.76
Power: 18.11
Current: 0.13
Pulses: 9949.00
Have you compile your own binary for your POW or are you using a binary delivered by a release?
My POW R2 is written V1.0 on the PCB...
Thank you gain,
Mc/
I don't use NTP (long time ago it was not stable and all is automated from domoticz).
But if you really want me to test with NTP I can do it (is there a link between NTP and a triggered property?)
I have tested again all properties as "trigger", here below the complete rules:
Code: Select all
On Button#State do
if [Relay#State]=1
gpio,12,0
else
gpio,12,1
endif
endon
On System#Boot do
gpio,12,1
endon
On WIFI#RSSI do
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=[POW#Voltage]
endon
On POW#Power do
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=89&nvalue=0&svalue=[POW#Power];[POW#Pulses]
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=90&nvalue=0&svalue=[POW#Current]
endon
On POW#Current do
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=89&nvalue=0&svalue=[POW#Power];[POW#Pulses]
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=90&nvalue=0&svalue=[POW#Current]
endon
On POW#Voltage do
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=99&nvalue=0&svalue=test_vol
endon
On POW#Pulses do
SendToHTTP xxx,8080,/json.htm?type=command¶m=udevice&idx=99&nvalue=0&svalue=test_pul
endon
There is no external sensor connected to this POW.
Here below the log (through syslog with "Info" level) :
Aug 27 20:46:09 POW EspEasy: SYS : -77.00
Aug 27 20:46:09 POW EspEasy: EVENT: WIFI#RSSI=-77.00
Aug 27 20:46:09 POW EspEasy: ACT : SendToHTTP 10.0.0.4,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=232.76
Aug 27 20:46:09 POW EspEasy: Command: sendtohttp
Aug 27 20:46:09 POW EspEasy: SYS : 484.00
Aug 27 20:46:09 POW EspEasy: EVENT: SONOFF#Uptime=484.00
Aug 27 20:46:10 POW EspEasy: Domoticz: Sensortype: 1 idx: 83 values: 484.00
Aug 27 20:46:10 POW EspEasy: WD : Uptime 485 ConnectFailures 0 FreeMem 14560
Aug 27 20:46:39 POW EspEasy: WD : Uptime 485 ConnectFailures 0 FreeMem 14584
Aug 27 20:47:09 POW EspEasy: WD : Uptime 486 ConnectFailures 0 FreeMem 14512
Aug 27 20:47:39 POW EspEasy: WD : Uptime 486 ConnectFailures 0 FreeMem 14512
Aug 27 20:48:09 POW EspEasy: WD : Uptime 487 ConnectFailures 0 FreeMem 14512
Aug 27 20:48:39 POW EspEasy: WD : Uptime 487 ConnectFailures 0 FreeMem 14512
Aug 27 20:49:09 POW EspEasy: WD : Uptime 488 ConnectFailures 0 FreeMem 14512
I have switch on and off 3 times the light connected to the POW... The value are correctly shown on the POW:
Voltage: 232.76
Power: 18.11
Current: 0.13
Pulses: 9949.00
Have you compile your own binary for your POW or are you using a binary delivered by a release?
My POW R2 is written V1.0 on the PCB...
Thank you gain,
Mc/
Re: SonOff POW R2 support
I use the following: mega-20180723. (Development)
Regarding NTP usage I once read somewhere it is needed to have the timer function trigger correctly.
However since then I enable it on all my devices. So not sure what happens if I disable it.
Regarding NTP usage I once read somewhere it is needed to have the timer function trigger correctly.
However since then I enable it on all my devices. So not sure what happens if I disable it.
Re: SonOff POW R2 support
I like the rules, but my question. Can i also used them for my first generation Sonoff Pow with the HLW8012? And if it's yes what must i change in the rules.
Re: SonOff POW R2 support
I have upgraded the POW to mega-20180723 (dev), and it's not working better...
Very strange...
I'm going to continue to push CSE7759 data through the wifi#rssi trigger, but it's not a "realtime" push, so not very good for the appliance I would like to run....
I have another POW in a box, I will get it out tomorrow and I will try with this one...
I also use timer (without NTP) on a sonoff basic, like this :
It work:
Aug 26 16:00:02 Piscine EspEasy: Command: timerset
Aug 26 16:00:04 Piscine EspEasy: EVENT: Rules#Timer=1
Aug 26 16:00:04 Piscine EspEasy: ACT : timerSet,2,21600
Aug 26 16:00:04 Piscine EspEasy: Command: timerset
Aug 26 22:00:05 Piscine EspEasy: EVENT: Rules#Timer=2
Aug 26 22:00:05 Piscine EspEasy: ACT : timerSet,3,21600
Aug 26 22:00:05 Piscine EspEasy: Command: timerset
But if the number of second is to high (I don't remember the limit), I notice some strange behavior (next timer not triggered, or triggered in a shorter time).
Since I use "small" number, it's work perfectly...
Very strange...
I'm going to continue to push CSE7759 data through the wifi#rssi trigger, but it's not a "realtime" push, so not very good for the appliance I would like to run....
I have another POW in a box, I will get it out tomorrow and I will try with this one...
I also use timer (without NTP) on a sonoff basic, like this :
Code: Select all
On Rules#Timer=1 do
timerSet,2,21600
endon
Aug 26 16:00:02 Piscine EspEasy: Command: timerset
Aug 26 16:00:04 Piscine EspEasy: EVENT: Rules#Timer=1
Aug 26 16:00:04 Piscine EspEasy: ACT : timerSet,2,21600
Aug 26 16:00:04 Piscine EspEasy: Command: timerset
Aug 26 22:00:05 Piscine EspEasy: EVENT: Rules#Timer=2
Aug 26 22:00:05 Piscine EspEasy: ACT : timerSet,3,21600
Aug 26 22:00:05 Piscine EspEasy: Command: timerset
But if the number of second is to high (I don't remember the limit), I notice some strange behavior (next timer not triggered, or triggered in a shorter time).
Since I use "small" number, it's work perfectly...
Re: SonOff POW R2 support
I don't know for certain, could be if the data is populated in the same way,
The rules are in that way quite universal to use.
However as we can see in the forum. For some people they seem to work for others they don''t. Pretty strange.
Same goes for the timer. It can be used without ntp.
I use a similar setup for my NPN watermeter where I got the idea. That one also works flawless.
Re: SonOff POW R2 support
I have try a second POW R2 I had.
I have exactly the same behavior : no SYS or EVENT log when a CSE7766 properties is changing (for instance Voltage).
I have activated NTP to be sure it's not due to this config.
And... always the same...
My first and second POW R2 have a similar behavior..
I really don't understand why, with your POW, you can trigger CSE7766 properties !
With mega-20180714 I have a new line in the syslog:
Aug 28 22:07:47 POW2 EspEasy: LoopStats: shortestLoop: 49 longestLoop: 891267 avgLoopDuration: 103.29 systemTimerDuration: 23.94 systemTimerCalls: 31 loopCounterMax: 612244 loopCounterLast: 286060 countFindPluginId: 0
Next time I will activate more debug level to try to understand a little bit better what is happening...
I have exactly the same behavior : no SYS or EVENT log when a CSE7766 properties is changing (for instance Voltage).
I have activated NTP to be sure it's not due to this config.
And... always the same...
My first and second POW R2 have a similar behavior..
I really don't understand why, with your POW, you can trigger CSE7766 properties !
With mega-20180714 I have a new line in the syslog:
Aug 28 22:07:47 POW2 EspEasy: LoopStats: shortestLoop: 49 longestLoop: 891267 avgLoopDuration: 103.29 systemTimerDuration: 23.94 systemTimerCalls: 31 loopCounterMax: 612244 loopCounterLast: 286060 countFindPluginId: 0
Next time I will activate more debug level to try to understand a little bit better what is happening...
Re: SonOff POW R2 support
Let's sync both our debug settings to find out what happens okay?Djoe wrote: ↑29 Aug 2018, 10:10 I have try a second POW R2 I had.
I have exactly the same behavior : no SYS or EVENT log when a CSE7766 properties is changing (for instance Voltage).
I have activated NTP to be sure it's not due to this config.
And... always the same...
My first and second POW R2 have a similar behavior..
I really don't understand why, with your POW, you can trigger CSE7766 properties !
With mega-20180714 I have a new line in the syslog:
Aug 28 22:07:47 POW2 EspEasy: LoopStats: shortestLoop: 49 longestLoop: 891267 avgLoopDuration: 103.29 systemTimerDuration: 23.94 systemTimerCalls: 31 loopCounterMax: 612244 loopCounterLast: 286060 countFindPluginId: 0
Next time I will activate more debug level to try to understand a little bit better what is happening...
Re: SonOff POW R2 support
I think I have understood.
My gold was to work as a "push" system.
In my CSE settings, I have put 0 (zero) in "Interval" field.
I was thinking than a trigger was coming when a value is changing (like the "Generic system info" with the RSSI or UPTIME).
It was a mistake.
When I put for instance 10 (seconds) in this "Interval" field, I receive the events:
It work like a "pull" system.
Every 10 second, I request the CSE chip to refresh all values.
So now I understand why you are using dummy device in your POW.
The goal is to store in the ESP the last value, to only send HTTP when a value is changing.
So you recreate a "push" system through a "pull" config in the ESP...
My gold was to work as a "push" system.
In my CSE settings, I have put 0 (zero) in "Interval" field.
I was thinking than a trigger was coming when a value is changing (like the "Generic system info" with the RSSI or UPTIME).
It was a mistake.
When I put for instance 10 (seconds) in this "Interval" field, I receive the events:
Code: Select all
Aug 30 22:42:33 POW EspEasy: EVENT: POW#Voltage=233.91
Aug 30 22:42:33 POW EspEasy: EVENT: POW#Power=0.00
Aug 30 22:42:33 POW EspEasy: EVENT: POW#Current=0.00
Aug 30 22:42:33 POW EspEasy: EVENT: POW#Pulses=1.79
Aug 30 22:42:49 POW EspEasy: WD : Uptime 80 ConnectFailures 0 FreeMem 14672
Aug 30 22:43:17 POW EspEasy: SYS : -72.00
Aug 30 22:43:17 POW EspEasy: EVENT: WIFI#RSSI=-72.00
Aug 30 22:43:17 POW EspEasy: SYS : 80.00
Aug 30 22:43:17 POW EspEasy: EVENT: SONOFF#Uptime=80.00
Aug 30 22:43:17 POW EspEasy: Domoticz: Sensortype: 1 idx: 83 values: 80.00
Aug 30 22:43:19 POW EspEasy: WD : Uptime 80 ConnectFailures 0 FreeMem 14672
Aug 30 22:43:33 POW EspEasy: EVENT: POW#Voltage=234.20
Aug 30 22:43:33 POW EspEasy: EVENT: POW#Power=0.00
Aug 30 22:43:33 POW EspEasy: EVENT: POW#Current=0.00
Aug 30 22:43:33 POW EspEasy: EVENT: POW#Pulses=1.79
Every 10 second, I request the CSE chip to refresh all values.
So now I understand why you are using dummy device in your POW.
The goal is to store in the ESP the last value, to only send HTTP when a value is changing.
So you recreate a "push" system through a "pull" config in the ESP...
Re: SonOff POW R2 support
Indeed I use Dummy devices to only send data to domoticz if something was changed
Could you try the following: DIVIDE AND CONQUER
Rules 1:
Rules 2
Rules 3
That should give you the result you want. and leave the interval at 10 as you discovered.
Could you try the following: DIVIDE AND CONQUER
Rules 1:
Code: Select all
On System#Boot do
TaskValueSet 5,1,0
TaskValueSet 5,2,0
TaskValueSet 5,3,0
TaskValueSet 5,4,0
TimerSet,1,30
EndOn
on Rules#Timer=1 do
if [Calculation#Voltage]!=[Energy#Voltage]
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=600&nvalue=0&svalue=[Energy#Voltage] // Voltage
TaskValueSet 5,1,[Energy#Voltage]
endif
if [Calculation#Power]!=[Energy#Power]
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=603&nvalue=0&svalue=[Energy#Power] // KwH.
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=608&nvalue=0&svalue=[Energy#Power] // Watt
TaskValueSet 5,2,[Energy#Power]
endif
if [Calculation#Current]!=[Energy#Current]
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=604&nvalue=0&svalue=[Energy#Current] // Amp
TaskValueSet 5,3,[Energy#Current]
endif
TaskValueSet 5,4,[Energy#Pulses]
TimerSet,1,30
endon
Code: Select all
// LAMP CONTROLLING INCLUDING LED LIGHT
on lamp_on do
gpio,12,1
gpio,13,0
endon
on lamp_off do
gpio,12,0
gpio,13,1
endon
on SW_1#Switch do
if [SW_1#Switch]=1
gpio,12,1
gpio,13,0
else
gpio,12,0
gpio,13,1
endif
endon
Code: Select all
on Clock#Time=All,**:*0 do
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=600&nvalue=0&svalue=[Energy#Voltage]
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=608&nvalue=0&svalue=[Energy#Power]
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=603&nvalue=0&svalue=[Energy#Power]
SendToHTTP <ipadres>,8080,/json.htm?type=command¶m=udevice&idx=604&nvalue=0&svalue=[Energy#Current]
endon
Re: SonOff POW R2 support
Yes now it's working, I have simplify the rules like this :
I trigger the Current only and not the Power because the power is changing to mush time (to avoid a JSON push every 10 sec).
The interval on the WIFI device is 300 sec.
The interval on CSE device is 10 sec.
The only last issue is that my device is rebooting regularly.
I think it's normal because the CSE code is in development / testing.
I have disabled it just now to see if the reboot continue or not for the next 48 hours.
I have never try to go in the code to debug the plugin..
I have download Visual Studio Code and PlaformIO plugin but when I load the source code I have some issue...
Have you try to go in the code to understand better how it work ?
Have a good week-end!
Code: Select all
On Button#State do // To have the local button working for ON OFF
if [Relay#State]=1
gpio,12,0
else
gpio,12,1
endif
endon
On System#Boot do // To have the relay ON after reboot
gpio,12,1
endon
On WIFI#RSSI do // To send voltage every 5 minutes
SendToHTTP ip,8080,/json.htm?type=command¶m=udevice&idx=88&nvalue=0&svalue=[POW#Voltage]
endon
On POW#Current do // To send power and current only when the current change
if [POW#Current]!=[LAST#Current]
SendToHTTP ip,8080,/json.htm?type=command¶m=udevice&idx=89&nvalue=0&svalue=[POW#Power]
SendToHTTP ip,8080,/json.htm?type=command¶m=udevice&idx=90&nvalue=0&svalue=[POW#Current]
TaskValueSet 6,1,[POW#Power]
TaskValueSet 6,2,[POW#Current]
endif
endon
The interval on the WIFI device is 300 sec.
The interval on CSE device is 10 sec.
The only last issue is that my device is rebooting regularly.
Code: Select all
Boot Manual reboot (26)
Reset Reason Hardware Watchdog
I have disabled it just now to see if the reboot continue or not for the next 48 hours.
I have never try to go in the code to debug the plugin..
I have download Visual Studio Code and PlaformIO plugin but when I load the source code I have some issue...
Have you try to go in the code to understand better how it work ?
Have a good week-end!
Re: SonOff POW R2 support
This hardware watchdog issue has been reported a lot by other users and for now I have not really a clue what is causing it.
Re: SonOff POW R2 support
I did not see the HW watchdog.
Does it stop measuring and then reboot?
Or just reboot without any notice?
As a reboot results in a system that is -off- I should have noticed.
It is monitoring my stove. So not in use daily however switched on.
To avoid red bars in domoticz I push all data every 10 minutes at least. "":"0. Can of course be modified to every hour/day or so.
Does it stop measuring and then reboot?
Or just reboot without any notice?
As a reboot results in a system that is -off- I should have noticed.
It is monitoring my stove. So not in use daily however switched on.
To avoid red bars in domoticz I push all data every 10 minutes at least. "":"0. Can of course be modified to every hour/day or so.
Re: SonOff POW R2 support
Talk of the devil.. First hardware watchdog this morning at 11:46.
Would it be the 10 sec read-out?
Unfortunately the following does not switch the relais on after the reboot .. well after a reboot it switches on for 1 sec and then back off.
So maybe it starts with the rules from there.. Don't know yet.
Same if I set the hardware GPIO to HIGH by default... it is the same result. On for 1 sec and then back off.
Would it be the 10 sec read-out?
Unfortunately the following does not switch the relais on after the reboot .. well after a reboot it switches on for 1 sec and then back off.
So maybe it starts with the rules from there.. Don't know yet.
Code: Select all
On System#Boot do // To have the relay ON after reboot
gpio,12,1
endon
Re: SonOff POW R2 support
@sincze
"well after a reboot it switches on for 1 sec and then back off"
I had a behavior like this a couple of week before, I have changed the mega version and the issue was solved.
Actually I'm testing mega-20180804 and the relay stay on after reboot.
@TD-er
The POW is my only device which have hardware watchdog.
I have try to disabled the CMS plugin : no better results.
I have deleted the CMS plugin in the device tab : no better results.
I have 2 other Sonoff Basic (with external sensors) + 1 Sonoff Touch (without external sensor) that reboot regularly (1000 to 4000 minutes uptime).
But there is no reference to a "Reset reason".. For instance:
Uptime 0 days 1 hours 38 minutes
Load 8% (LC=12409)
Free Mem 12896 (12112 - sendContentBlocking)
Boot Manual reboot (37)
I have only 1 Sonoff Basic (without external sensor) with a big uptime (more than 40000 minutes). The installed firmware is mega-20180503...
When I will have more time I will try to go in your code..... I hope it will not be a empty promise !
"well after a reboot it switches on for 1 sec and then back off"
I had a behavior like this a couple of week before, I have changed the mega version and the issue was solved.
Actually I'm testing mega-20180804 and the relay stay on after reboot.
@TD-er
The POW is my only device which have hardware watchdog.
I have try to disabled the CMS plugin : no better results.
I have deleted the CMS plugin in the device tab : no better results.
I have 2 other Sonoff Basic (with external sensors) + 1 Sonoff Touch (without external sensor) that reboot regularly (1000 to 4000 minutes uptime).
But there is no reference to a "Reset reason".. For instance:
Uptime 0 days 1 hours 38 minutes
Load 8% (LC=12409)
Free Mem 12896 (12112 - sendContentBlocking)
Boot Manual reboot (37)
I have only 1 Sonoff Basic (without external sensor) with a big uptime (more than 40000 minutes). The installed firmware is mega-20180503...
When I will have more time I will try to go in your code..... I hope it will not be a empty promise !
Re: SonOff POW R2 support
@sincze
I have found the issue about
to avoid switching on then off after 1 sec. I guest that you have a switch in domoticz to control the relay in the POW, and the issue come from domoticz in my automation. It's strange because the mega-20180808 didn't have this issue (all release after have the "issue").
You have to :
- let the "Pin mode 12" as default in "GPIO boot states"
- put 0sec interval in the relay device (gpio-12)
- untick the "send boot state" in the relay device
I saw a mix between the command from the POW to domoticz (to yes "hey I'm switched on"), and the command from domoticz to the POW (the domoticz switch, when it receive a ON state, send back the same command to the POW, so a gpio,12,1). It's not clear for me who is send the command before the real state of the POW's relay, but if you don't send the initial state to the domoticz server, it working on my side.
If you put a interval greater than 0, it's send the initial state too.
I have found the issue about
Code: Select all
On System#Boot do // To have the relay ON after reboot
gpio,12,1
endon
You have to :
- let the "Pin mode 12" as default in "GPIO boot states"
- put 0sec interval in the relay device (gpio-12)
- untick the "send boot state" in the relay device
I saw a mix between the command from the POW to domoticz (to yes "hey I'm switched on"), and the command from domoticz to the POW (the domoticz switch, when it receive a ON state, send back the same command to the POW, so a gpio,12,1). It's not clear for me who is send the command before the real state of the POW's relay, but if you don't send the initial state to the domoticz server, it working on my side.
If you put a interval greater than 0, it's send the initial state too.
Re: SonOff POW R2 support
Tnx , got it. And have implemented your suggestions 1,2,3. DId not try the interval > 0 yet.
Issued a: Tools -> Reboot ESP.
The Relais Switch value stays 0, i would expect 1. Will have to walk to the machine to view the actual state.
By the way all Sonoff would have a 1024 Flash I believe. Preventing OTA update, so that is what I thought.
Playing around with your suggestions. I noticed:
Code: Select all
Flash Chip ID Vendor: 0xEF Device: 0x4016
Flash Chip Real Size: 4096 kB
Flash IDE Size: 1024 kB
Flash IDE speed: 40 MHz
Flash IDE mode: DOUT
Re: SonOff POW R2 support
If that one really has a 4 MB flash, it would be worth to flash to 4M version.
Only thing is, you will have to flash it either using a 2-step OTA or via serial.
You will also loose the settings.
In short, the flash layout is:
Active sketch => free space for OTA => SPIFFS (filesystem for settings) => end of flash-space.
There is more, but generally speaking, the flash has this layout.
So changing from 1M to 4M will erase the SPIFFS and thus your settings.
Also, for an OTA update there is simply no room when it is setup for 1M flash.
Only thing is, you will have to flash it either using a 2-step OTA or via serial.
You will also loose the settings.
In short, the flash layout is:
Active sketch => free space for OTA => SPIFFS (filesystem for settings) => end of flash-space.
There is more, but generally speaking, the flash has this layout.
So changing from 1M to 4M will erase the SPIFFS and thus your settings.
Also, for an OTA update there is simply no room when it is setup for 1M flash.
Re: SonOff POW R2 support
All my sonoff basic have 1024 flash (v1.1 and R2).
All my sonoff pow have 4096 flash (only R2).
I always update my POW through OTA without any issue (I use the dev-4096 release).
About sonoff basic, I only update through serial connection.
The 2-step OTA firmware is too big to be store in the free space of a 1024 flash (if we use the "ready to use" firmware in each the release) :
- Sketch Size 660 kB (212 kB free)
- we need 276848 free space for the ESPEasyUploaderMega
But I haven't yet compile my own firmware, perhaps it's the better solution to reduce the size of the firmware..
I will do... when I will have time... Like everybody
All my sonoff pow have 4096 flash (only R2).
I always update my POW through OTA without any issue (I use the dev-4096 release).
About sonoff basic, I only update through serial connection.
The 2-step OTA firmware is too big to be store in the free space of a 1024 flash (if we use the "ready to use" firmware in each the release) :
- Sketch Size 660 kB (212 kB free)
- we need 276848 free space for the ESPEasyUploaderMega
But I haven't yet compile my own firmware, perhaps it's the better solution to reduce the size of the firmware..
I will do... when I will have time... Like everybody
Re: SonOff POW R2 support
Ota update possible from 1024 version to 4096 release?
Re: SonOff POW R2 support
I moved the Sonoff from powering stove + led strip to just the Stove.
It has now been running for several days without a hardware watchdog reset
It has now been running for several days without a hardware watchdog reset
Re: SonOff POW R2 support
Strange..
I continue to have hardware watchdog (every day)..
I have read a little bit more about it, it's triggered when the watchdog timer is not reset during 8 sec.
So that mean that the code is in a deadlock somewhere (probably)..
I just arrive this evening to compile the firmware..
Investigation is continuing...
I continue to have hardware watchdog (every day)..
I have read a little bit more about it, it's triggered when the watchdog timer is not reset during 8 sec.
So that mean that the code is in a deadlock somewhere (probably)..
I just arrive this evening to compile the firmware..
Investigation is continuing...
Re: SonOff POW R2 support
A lot of people have reported these and it is well on my radar.Djoe wrote: ↑15 Sep 2018, 07:29 Strange..
I continue to have hardware watchdog (every day)..
I have read a little bit more about it, it's triggered when the watchdog timer is not reset during 8 sec.
So that mean that the code is in a deadlock somewhere (probably)..
I just arrive this evening to compile the firmware..
Investigation is continuing...
If you found something, please open a new topic about it here on the forum.
My suspicion is something network related since updating to core library 2.4.2: https://github.com/esp8266/Arduino/releases/tag/2.4.2
Re: SonOff POW R2 support
Mmm I guess @TD'er is looking in the right direction. My POW R2 works fine..TD-er wrote: ↑16 Sep 2018, 10:48
A lot of people have reported these and it is well on my radar.
If you found something, please open a new topic about it here on the forum.
My suspicion is something network related since updating to core library 2.4.2: https://github.com/esp8266/Arduino/releases/tag/2.4.2
However when I make WIFI changes (as I just bought UnifI stuff for the complete house) and do something with the WIFI (restart, enable functionalities) the POW R2 watchdog kicks is.. If I leave the WIFI network alone... it runs fine for at least 6 days...
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: SonOff POW R2 support
We really need to test how different WiFi environments is working with our firmware. We suspect that it has more impact on the system then previously thought.
A great deal is happening behind the scenes now that we're turning this initiative into a company but we hope to pick up the speed soon.
A great deal is happening behind the scenes now that we're turning this initiative into a company but we hope to pick up the speed soon.
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: SonOff POW R2 support
Excellent, just some more things I noticed:grovkillen wrote: ↑20 Sep 2018, 20:39 We really need to test how different WiFi environments is working with our firmware. We suspect that it has more impact on the system then previously thought.
A great deal is happening behind the scenes now that we're turning this initiative into a company but we hope to pick up the speed soon.
I've been using this ESPEasy on several devices from the reliable 1.xx versions (uptime 23908 minutes) to the latest development builds..
After reading some more about my Unifi hardware it seems that every changes where my AP's are involved will result in a restart (reboot) of the specific AP. All clients will lose communication.
For version 1.x this does not seem to matter. (uptime 23908 minutes)- When you make a configuration change, all involved AP's will reboot. So changes have to be done outside office hours if you don't want unhappy users.
For the later ESP versions after AP reboot:
WEMOS: ESP_Easy_mega-20180606_normal_ESP8266_4096.bin -> Reset Reason Hardware Watchdog -> (201) No AP found
POW2: ESP_Easy_mega-20180723_dev_ESP8266_1024.bin -> Reset Reason Hardware Watchdog -> Last Disconnect Reason (1) Unspecified
I never noticed an error before as they just reconnect fine and continue to work.
However downside for the POW2 is that the relais switches off,and it seems I am unable to tell it to automatically go back on after a reboot.
Ah and indeed a watchdog kick in for a temporarily wifi loss... seems a bit of an overkill. Hope you guys can fix it..
Re: SonOff POW R2 support
After not touching my wifi settings and leaving them as is. that means working the ESP is still online.
So I guess we are looking in the right direction regarding the wifi being the root cause of the watchdog resets.Re: SonOff POW R2 support
Hi all,
On my side I'm in the same situation..
My pow, without changing the firmware version, have a 59165 minutes uptime...
And, or course, if I have changed a config somewhere, I don't remember what...
Have a good day !
On my side I'm in the same situation..
My pow, without changing the firmware version, have a 59165 minutes uptime...
And, or course, if I have changed a config somewhere, I don't remember what...
Have a good day !
Re: SonOff POW R2 support
Hello to everyone,
I saw that you are using espeasy in sonoff pow. I have 4 sonoff pow and would like to add espeasy. Which bin file are you using?
thanks
I saw that you are using espeasy in sonoff pow. I have 4 sonoff pow and would like to add espeasy. Which bin file are you using?
thanks
Re: SonOff POW R2 support
I'am using
POW2: ESP_Easy_mega-20180723_dev_ESP8266_1024.bin
But maybe I can flash it somehow to a 4096 version..
POW2: ESP_Easy_mega-20180723_dev_ESP8266_1024.bin
But maybe I can flash it somehow to a 4096 version..
Re: SonOff POW R2 support
Hi all,
I have just successfully flashed my 1st Sonoff POW R2 with EasyESP but seem to be stuck at one step.
On my iPhone I have selected the ESP_0 WiFi network & entered configesp as the password, opened up a browser page on my iPhone & have been confronted by the Log In ESP_0 screen.
So, I can see my home network SSID in the list which I select but here is where I am stuck.
Where the input box is for password, is this the WiFi Key for my home network that I should be entering here, I think that possibly it is.
If it is then there is an issue because I keep on entering my WiFi Key and it counts down from 20 seconds but does not display an IP address for the Sonoff but only a page with a link back to the the setup page.
Any help would be appreciated
By the way, I am flashing using R120 & have tried 1024 & 4096 bin
Kirk
I have just successfully flashed my 1st Sonoff POW R2 with EasyESP but seem to be stuck at one step.
On my iPhone I have selected the ESP_0 WiFi network & entered configesp as the password, opened up a browser page on my iPhone & have been confronted by the Log In ESP_0 screen.
So, I can see my home network SSID in the list which I select but here is where I am stuck.
Where the input box is for password, is this the WiFi Key for my home network that I should be entering here, I think that possibly it is.
If it is then there is an issue because I keep on entering my WiFi Key and it counts down from 20 seconds but does not display an IP address for the Sonoff but only a page with a link back to the the setup page.
Any help would be appreciated
By the way, I am flashing using R120 & have tried 1024 & 4096 bin
Kirk
Re: SonOff POW R2 support
Right I have finally got somewhere after hours of messing around.1CM69 wrote: ↑03 Apr 2019, 12:31 Hi all,
I have just successfully flashed my 1st Sonoff POW R2 with EasyESP but seem to be stuck at one step.
On my iPhone I have selected the ESP_0 WiFi network & entered configesp as the password, opened up a browser page on my iPhone & have been confronted by the Log In ESP_0 screen.
So, I can see my home network SSID in the list which I select but here is where I am stuck.
Where the input box is for password, is this the WiFi Key for my home network that I should be entering here, I think that possibly it is.
If it is then there is an issue because I keep on entering my WiFi Key and it counts down from 20 seconds but does not display an IP address for the Sonoff but only a page with a link back to the the setup page.
Any help would be appreciated
By the way, I am flashing using R120 & have tried 1024 & 4096 bin
Kirk
I eventually found and downloaded ESPEasy Mega & by a process of elimination I have found that I have two working Sonoff POW R2 switches by flashing with 20190315_normal_ESP8266_1M.bin & choosing the 'force DOUT' option
What I would now like to be able to do is PING each switch to check whether it is connected via a python script running on my Raspberry Pi, any pointers here
Kirk
Re: SonOff POW R2 support
Made a little more headway.1CM69 wrote: ↑03 Apr 2019, 18:57Right I have finally got somewhere after hours of messing around.1CM69 wrote: ↑03 Apr 2019, 12:31 Hi all,
I have just successfully flashed my 1st Sonoff POW R2 with EasyESP but seem to be stuck at one step.
On my iPhone I have selected the ESP_0 WiFi network & entered configesp as the password, opened up a browser page on my iPhone & have been confronted by the Log In ESP_0 screen.
So, I can see my home network SSID in the list which I select but here is where I am stuck.
Where the input box is for password, is this the WiFi Key for my home network that I should be entering here, I think that possibly it is.
If it is then there is an issue because I keep on entering my WiFi Key and it counts down from 20 seconds but does not display an IP address for the Sonoff but only a page with a link back to the the setup page.
Any help would be appreciated
By the way, I am flashing using R120 & have tried 1024 & 4096 bin
Kirk
I eventually found and downloaded ESPEasy Mega & by a process of elimination I have found that I have two working Sonoff POW R2 switches by flashing with 20190315_normal_ESP8266_1M.bin & choosing the 'force DOUT' option
What I would now like to be able to do is PING each switch to check whether it is connected via a python script running on my Raspberry Pi, any pointers here
Kirk
A very small Python script running via scheduled CRON jobs at set intervals on my Raspberry Pi:
Code: Select all
from urllib2 import urlopen
from BME280 import cTemp
if cTemp < 6:
urlopen('http://[my-ip-address]/control?cmd=GPIO,12,1')
else:
urlopen('http://[my-ip-address]/control?cmd=GPIO,12,0')
All I need to be able to do now is communicate from my Raspberry Pi to the Sonoff POW R2 to make sure that it is powered on prior to running the above script.
Kirk
Re: SonOff POW R2 support
Made a slight tweak to the Python script because I have two POW R2 switches.1CM69 wrote: ↑03 Apr 2019, 20:50Made a little more headway.1CM69 wrote: ↑03 Apr 2019, 18:57Right I have finally got somewhere after hours of messing around.1CM69 wrote: ↑03 Apr 2019, 12:31 Hi all,
I have just successfully flashed my 1st Sonoff POW R2 with EasyESP but seem to be stuck at one step.
On my iPhone I have selected the ESP_0 WiFi network & entered configesp as the password, opened up a browser page on my iPhone & have been confronted by the Log In ESP_0 screen.
So, I can see my home network SSID in the list which I select but here is where I am stuck.
Where the input box is for password, is this the WiFi Key for my home network that I should be entering here, I think that possibly it is.
If it is then there is an issue because I keep on entering my WiFi Key and it counts down from 20 seconds but does not display an IP address for the Sonoff but only a page with a link back to the the setup page.
Any help would be appreciated
By the way, I am flashing using R120 & have tried 1024 & 4096 bin
Kirk
I eventually found and downloaded ESPEasy Mega & by a process of elimination I have found that I have two working Sonoff POW R2 switches by flashing with 20190315_normal_ESP8266_1M.bin & choosing the 'force DOUT' option
What I would now like to be able to do is PING each switch to check whether it is connected via a python script running on my Raspberry Pi, any pointers here
Kirk
A very small Python script running via scheduled CRON jobs at set intervals on my Raspberry Pi:
There's probably a neater way to do this but it does work.Code: Select all
from urllib2 import urlopen from BME280 import cTemp if cTemp < 6: urlopen('http://[my-ip-address]/control?cmd=GPIO,12,1') else: urlopen('http://[my-ip-address]/control?cmd=GPIO,12,0')
All I need to be able to do now is communicate from my Raspberry Pi to the Sonoff POW R2 to make sure that it is powered on prior to running the above script.
Kirk
Each switch controls an electric heater that is connected via a dual rate Economy 7 meter which is only powered between certain hours through the night for cheap rate electricity.
I initially had the switches to default to on in case of a power outage but quickly realised this would be no good as they would be energised irrespective of the outside temperature.
My script is run every 15 mins via CRON on my Raspberry Pi during these cheap rate hours and if the temp that my BME280 sensor from my attached weather station registers below 6°C during a script run the switches will power on until the next script run cycle where again it will check the temp and either stay powered on or power down the switches etc...
Here's the script:
Code: Select all
from urllib2 import urlopen
from BME280 import cTemp
#cTemp = 5.9 #TEST TEMP SETTING
if cTemp < 6:
try:
urlopen('http://[SWITCH1 IP]/control?cmd=GPIO,12,1')
urlopen('http://[SWITCH2 IP]/control?cmd=GPIO,12,1')
except:
pass
print('POWER ON')
else:
try:
urlopen('http://[SWITCH1 IP]/control?cmd=GPIO,12,0')
urlopen('http://[SWITCH2 IP]/control?cmd=GPIO,12,0')
except:
pass
print('POWER OFF')
For now though I added a TRY, EXCEPT just to catch the exception if a switch is not connected.
Kirk
Re: SonOff POW R2 support
Hi all,
I am using "ESP_Easy_mega-20190315_hard_SONOFF_POW_4M" which looked like the version I had to use (other versions didn't have the energy device).
The "Energy (AC) - CSE7766 (POW r2) [TESTING]" device shows Voltage, Power, Current and Pulses just fine and I can send it to my Domotica software (HS2).
I was trying to use EmonCMS though to track power and such (like I do with Temp and Humidity on a TH10), but as soon as I add the Controller to the Device, logging will show the following error:
In my PHP server which hosts emoncms it looks like nothing is coming into the webserver, so I guess the PowR2 is not even sending the data?
Any thoughts?
Regards,
Nika.
I am using "ESP_Easy_mega-20190315_hard_SONOFF_POW_4M" which looked like the version I had to use (other versions didn't have the energy device).
The "Energy (AC) - CSE7766 (POW r2) [TESTING]" device shows Voltage, Power, Current and Pulses just fine and I can send it to my Domotica software (HS2).
I was trying to use EmonCMS though to track power and such (like I do with Temp and Humidity on a TH10), but as soon as I add the Controller to the Device, logging will show the following error:
Code: Select all
emoncms : Unknown sensortype or too many sensor values
Any thoughts?
Regards,
Nika.
Who is online
Users browsing this forum: No registered users and 45 guests