Enphase
Moderators: leecollings, remb0
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Enphase
Is it possible to let Domoticz read Enphase solar data (just like Solar Edge?), or do I need to use
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
- gizmocuz
- Posts: 2478
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Enphase
Quality outlives Quantity!
-
- Posts: 5
- Joined: Saturday 14 February 2015 14:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enphase
Hi,
The above solution takes it from the Enphase servers.
I wrote a bash script to get the day values off my Enphase gateway. The second half of the script also calculates the actual total power consumption and daily total. (I made a quick update turning variables into English and a few cosmetic things. hope i didn't make an error, a quick test worked fine)
The above solution takes it from the Enphase servers.
I wrote a bash script to get the day values off my Enphase gateway. The second half of the script also calculates the actual total power consumption and daily total. (I made a quick update turning variables into English and a few cosmetic things. hope i didn't make an error, a quick test worked fine)
Code: Select all
#!/bin/bash
# bash script to read current and actual day power from Enphase gateway
# second part caluclates the actual total power consumption and day consumption for the whole house
# V1.3 27/09/2015
# By Koen Vanduffel
# variables
solar_idx="57"
electricitydaily_idx="58"
enphase_IP="192.168.1.143"
# Read Enphase status page and store as of Currently
DATA=`wget -q -O - $enphase_IP/production | awk '/Currently/{print $0}'`
# Extract current and currentunits, power and powerunits reported
CURRENT=`echo $DATA | awk '/Currently/{print $3}'`
CURRENTUNIT=`echo $DATA | awk '/Currently/{print substr ($4, 1, 1)}'`
kWh=`echo $DATA | awk '/Currently/{print $6}'`
kWhUNIT=`echo $DATA | awk '/Currently/{print substr ($7, 1, 1)}'`
echo $CURRENT
echo $CURRENTUNIT
echo $kWh
echo $kWhUNIT
# convert to Watt and Wh if needed
if [ "$CURRENTUNIT" == "k" ]; then
CURRENT=`awk "BEGIN {print $CURRENT * 1000}"`
fi
if [ "$kWhUNIT" == "k" ]; then
kWh=`awk "BEGIN {print $kWh * 1000}"`
fi
echo $CURRENT
echo $kWh
# Execute curl command to post current and power to Domoticz
curl -i -H "Accept: application/json" "http://localhost:8080/json.htm?type=command¶m=udevice&idx=$solar_idx&nvalue=0&svalue=$CURRENT;$kWh"
# part 2:
# now calculate the total power consumed
# get actual consumption from P1 meter reading in Domoticz and return data
# there might be an easier way than to awk is from the json output
DATA=`wget -q -O - '192.168.1.9:8080/json.htm?type=devices&rid=12' | awk '/CounterDelivToday/{print $3}'`
CURRENTRETURNTODAY=`echo $DATA | awk -F, '{gsub(/"/,"",$1); print $1}'`
DATA=`wget -q -O - '192.168.1.9:8080/json.htm?type=devices&rid=12' | awk '/CounterToday/{print $3}'`
CURRENTUSAGETODAY=`echo $DATA | awk -F, '{gsub(/"/,"",$1); print $1}'`
echo $CURRENTUSAGETODAY
echo $CURRENTRETURNTODAY
TOTALCONSUMPTION=$(python -c "print $CURRENTUSAGETODAY*1000-$CURRENTRETURNTODAY*1000+$kWh")
echo $TOTALCONSUMPTION
# when 5 min around midnight post a zero otherwise Domoticz gets confused with not restarting at zero at 0:00 hours
# probably an imporvement is possible by continuing to calculate the total power long term
time=`date +%k%M` ;
if [ $time -gt 2355 ] || [ 6 -gt $time ]
then
TOTALCONSUMPTION=0
fi
echo $time
echo $TOTALCONSUMPTION
# now do the same for current
DATA=`wget -q -O - '192.168.1.9:8080/json.htm?type=devices&rid=12' | awk '/Usage/{print $3}'`
CURRENTUSAGE=`echo $DATA | awk '{print substr ($1, 2, 4)}'`
CURRENTRETURN=`echo $DATA | awk '{print substr ($2, 2, 4)}'`
echo $CURRENTUSAGE
echo $CURRENTRETURN
TOTALCURRENT=$(python -c "print $CURRENTUSAGE-$CURRENTRETURN+$CURRENT")
echo $TOTALCURRENT
# Execute curl command to post total electricity consumption today
curl -i -H "Accept: application/json" "http://localhost:8080/json.htm?type=command¶m=udevice&idx=$electricitydaily_idx&nvalue=0&svalue=$TOTALCURRENT;$TOTALCONSUMPTION"
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Re: Enphase
Sorry for the late reply, but how do I get these Enphase data in Domoticz?
There is a API program, maybe it could be implemented in Domoticz just like solaregdge support?
https://developer.enphase.com/docs/quickstart.html
There is a API program, maybe it could be implemented in Domoticz just like solaregdge support?
https://developer.enphase.com/docs/quickstart.html
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
-
- Posts: 5
- Joined: Saturday 14 February 2015 14:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enphase
I basically do the same as in this wiki page: https://www.domoticz.com/wiki/Monitor_memory_usage
make the virtual sensors in Domoticz and note their idx
Make the basch script using your idx numbers for the variables and the local ip address of your enphase gateway and make the script executable.
setup cron to execute the script every 5 min
that should be it.
My script does not take the data from the enphase servers but direct from the local gateway
make the virtual sensors in Domoticz and note their idx
Make the basch script using your idx numbers for the variables and the local ip address of your enphase gateway and make the script executable.
setup cron to execute the script every 5 min
that should be it.
My script does not take the data from the enphase servers but direct from the local gateway
-
- Posts: 105
- Joined: Thursday 31 December 2015 15:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enphase
Used the script of Koen van Duffel to read out the production of each panel
see http://www.domoticz.com/forum/viewtopic ... 62#p191562
see http://www.domoticz.com/forum/viewtopic ... 62#p191562
-
- Posts: 84
- Joined: Sunday 18 February 2018 9:32
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Enphase
There is a possibillity to add a Enphase hardware item in Dotmoticz, what remote address and port number do i fill in?
-
- Posts: 67
- Joined: Sunday 22 March 2015 16:18
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Enphase
Mine is connected to my local lan.smaus wrote:There is a possibillity to add a Enphase hardware item in Dotmoticz, what remote address and port number do i fill in?

Domoticz| Zigbee | SONOFF
-
- Posts: 84
- Joined: Sunday 18 February 2018 9:32
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Enphase
oke but i dont see any enphase, but in my log is standing EnphaseAPI: Invalid data received!
Who is online
Users browsing this forum: No registered users and 1 guest