You also might be able to add the generic
scan_interval: XXX
You also might be able to add the generic
scan_interval: XXX
wouldnt that be more straight forward within the setup_platform?
Well sun has gone down so can’t test for you.
Would also be great if this could be added HACS for easy updates
I have created a test version of the sensor.py file to allow for multiple inverters.
It is available at: https://github.com/safepay/JSON/blob/cb79e5f3291749b0a0b65c7fe373b801795f5847/sensor.py
This works without any additional config for single devices.
For multiple inverters set the scope in HA config:
scope: System
It will then produce up to 4 sensors for
- ac_power
- day_energy
- year_energy
- total_energy
which can also be changed via monitored_conditions.
I would appreciate someone testing this on a real inverter please!
If you only have one inverter should still work fine set to System.
And I have changed the repository name to allow for HACS as suggested (Ta!)
I just one one Inverter an Fronius. It’s all I can test.
I would also like to understand what response is returned after sunset.
Is there no server response at all or is there no data in the response?
If someone could answer this and paste any data from after sunset it would be appreciated.
I only just loaded the new code last night so that is why there is a flat constant output up until just before 8pm, but then it appears that we just get a zero value, which seems good to me
Tested via HACS installed all ok, Updated to the new test sensor.py and restarted all working and updating correctly on single inverter using “Device” mode as default
Thanks Dave,
Do you also see “*** Error getting Fronius data” in the logs?
If you could capture the raw output of the inverter at night and post it here that would be great.
I’m not sure if it responds at all or has an alternate data structure.
Thanks Kelvin,
Would you mind setting the scope to “System” in your configuration.yaml and seeing what happens please?
I’m pretty sure it completely shuts off at night, the display goes blank. So I don’t expect that I’ll get any response from it
One note which is mentioned earlier is how to stop the error when there is no data coming back ie the inverter is set to keep wifi but I get the bellow error when no data is coming back ie night time
Update for sensor.fronius_ac_voltage fails
7:54 AM custom_components/fronius/sensor.py (ERROR) - message first occured at July 11, 2019, 5:02 PM and shows up 1728 times
Update for sensor.fronius_ac_current fails
7:54 AM custom_components/fronius/sensor.py (ERROR) - message first occured at July 11, 2019, 5:02 PM and shows up 1728 times
Update for sensor.fronius_ac_power fails
7:54 AM custom_components/fronius/sensor.py (ERROR) - message first occured at July 11, 2019, 4:57 PM and shows up 1738 times
Update for sensor.fronius_ac_frequency fails
7:54 AM custom_components/fronius/sensor.py (ERROR) - message first occured at July 11, 2019, 5:02 PM and shows up 1728 times
Info captured from inverter at night
Scope: System
"Body" : {
"Data" : {
"DAY_ENERGY" : {
"Unit" : "Wh",
"Values" : {
"1" : 0
}
},
"PAC" : {
"Unit" : "W",
"Values" : {
"1" : 0
}
},
"TOTAL_ENERGY" : {
"Unit" : "Wh",
"Values" : {
"1" : 12575019
}
},
"YEAR_ENERGY" : {
"Unit" : "Wh",
"Values" : {
"1" : 2315302
}
}
}
},
"Head" : {
"RequestArguments" : {
"DeviceClass" : "Inverter",
"Scope" : "System"
},
"Status" : {
"Code" : 0,
"Reason" : "",
"UserMessage" : ""
},
"Timestamp" : "2019-07-12T08:18:58+12:00"
}
}
Scope Device
"Body" : {
"Data" : {
"DAY_ENERGY" : {
"Unit" : "Wh",
"Value" : 0
},
"DeviceStatus" : {
"ErrorCode" : 0,
"LEDColor" : 3,
"LEDState" : 0,
"MgmtTimerRemainingTime" : -1,
"StateToReset" : false,
"StatusCode" : 2
},
"IDC" : {
"Unit" : "A",
"Value" : 0
},
"TOTAL_ENERGY" : {
"Unit" : "Wh",
"Value" : 12575019
},
"UDC" : {
"Unit" : "V",
"Value" : 241.5
},
"YEAR_ENERGY" : {
"Unit" : "Wh",
"Value" : 2315302.75
}
}
},
"Head" : {
"RequestArguments" : {
"DataCollection" : "CommonInverterData",
"DeviceClass" : "Inverter",
"DeviceId" : "1",
"Scope" : "Device"
},
"Status" : {
"Code" : 0,
"Reason" : "",
"UserMessage" : ""
},
"Timestamp" : "2019-07-12T08:20:21+12:00"
}
}
Hope that helps
Changed over to Scope: System and all works fine and I have not seen any error’s and live data working
Thanks Kelvin.
I’ll push that version out in Github.
It would be good to avoid changing that inverter setting to avoid the update errors.
I wonder if there is any way the component can handle this? I’ll look in to it.
The latest release contains a fix for handling the missing inverter data at night.
The AC data is not included in the response.
These sensors will have a value of 0 at that time.