A first real Ezlo plugin; Solar Meter

Hi,

To get some idea of what is and is not possible at this moment for Ezlo plug in development I took the Solar Meter plugin for Vera and made an Ezlo version of it. This plugin will create just a power meter device displaying the produced Watts and daily KWh, but it is a start.

It can be found on github here https://github.com/reneboer/ezlo-SolarMeter. Installation is manual and configuration is done in a json file as there is no programmable UI (yet?).

The readme also includes some of the things I learned writing this plugin.

Cheers Rene

14 Likes

Rene

Well done on the first Ezlo plugin!

Sounds like plugin development is much different on the Ezlo platform.

Do you think eventually it might be possible to port the Harmony plugin over at some stage?

Thanks.

That sounds like good news. I currently use the plugin on my old VeraPlus. Once I receive my new test unit I will check it out.

Hi @cw-kid,

For now the Ezlo FW does not allow creation of user interface elements required for the Harmony plugin. No idea when it will be up to that level of flexibility.

Cheers Rene

Perfect timing on this. I’m testing the Ezlo Plus, and am in the process of having solar panels installed (with the Envoy) as we speak :slight_smile:

1 Like

Hi,

I posted V2.0 on github. Some enhancements, including some more scene trigger possibilities. See README for details.

Cheers Rene

Hi Rene, I’m trying to install the plugin. I have copied the files into the folder /opt/firmware/data/custom_plugins/SolarMeter. The first subfolder in this path is /opt/firmware/data/custom_plugins/SolarMeter/ezlo-SolarMeter-master.
If I run the command /opt/firmware/bin/ha-infocmd hub.extensions.custom_plugin.register SolarMeter nothing happens. I run this command from within WinSCP using the command line. I updated the SolarMeter.json file to only include the solar edge device.

Any idea?

Hi @ranneman,

All files and sub-folders must be in the SolarMeter folder, so you have to move them up from the master folder created by the unzip.

Cheers Rene

Hi Rene, thanks for your reply. I moved the files (I think I already tried this before) and I have updated the device part of the SolarMeter.json:

{
“config”: {
“label”:“Universal Solar Meter”,
“author”:“Rene Boer”,
“version”:“1.0”,
“log_level”:2,
“remove_inactive”:false
},
“devices”:
[
{
“id”: 1,
“name”: “Solar Edge”,
“active”: false,
“path”: “solar_egde”,
“poll_interval”: 900,
“config”: {
“api_key”: “XXXXXXXXXXXXXXXX…XXX”,
“system_id”: “999999”
}
}
]
}

After having uninstalled everything I rerun the the register again. The device still isn’t created.

I see this error in the ha-luad.log: 2021-01-12 16:41:07.136955 ERROR: plugin has no permissions to use the required module lpeg

any idea?

Can you set log_level to 5 and look for lines with errors or with “debug SolarMeter” in them?

The lpeg message is not relevant. (missing non-critical package on Ezlo)

Cheers Rene

I have set the log level to 5, below is what I get from various log files. I expected to see a device being created in the device overview but that still doesn’t happen

ha-extensions_manager.log
2021-01-13 07:31:30.494278 INFO : Got request to register custom plugins
2021-01-13 07:31:30.494886 INFO : Unregistering plugin: SolarMeter
2021-01-13 07:31:30.509216 INFO : Tearing down plugin: SolarMeter-1.0
2021-01-13 07:31:30.531168 INFO : Try to register plugin: SolarMeter
2021-01-13 07:31:30.532587 INFO : Registering plugin: SolarMeter-1.0
2021-01-13 07:31:30.532804 INFO : Plugin started: SolarMeter-1.0
2021-01-13 07:31:30.533270 INFO : Set scene block template: HUB:SolarMeter/scene_blocks.json
2021-01-13 07:31:30.561236 INFO : init: GatewayPlugin: the gateway (SolarMeter) got registered for the plugin (SolarMeter-1.0)
2021-01-13 07:31:30.576743 INFO : Plugin: request to start the plugin (SolarMeter-1.0, HUB:SolarMeter/scripts/startup)

ha-logd.log
2021-01-13 06:31:30.000493 INFO: [#infocmd] SYSTEM_INFO: {“message”:“SolarMeter”,“type”:“hub.extensions.custom_plugin.register”}
2021-01-13 06:31:30.000505 WARN: [#cored] bus_rx_cb: Unknown msg_class: 16, data:
{"_id":“5ffc740912d083167317877b”,“status”:“not_started”}
2021-01-13 06:31:30.000570 WARN: [#cored] bus_rx_cb: Unknown msg_class: 16, data:
{"_id":“5ffc740912d083167317877b”,“status”:“starting”}
2021-01-13 06:31:30.000626 WARN: [#cored] bus_rx_cb: Unknown msg_class: 16, data:
{"_id":“5ffc740912d083167317877b”,“status”:“ready”}

ha-luad.log
2021-01-13 07:31:30.529140 INFO : LuaAddon: a script: HUB:SolarMeter/scripts/teardown has been executed successfully
2021-01-13 07:31:30.591578 ERROR: plugin has no permissions to use the required module lpeg
2021-01-13.07:31:30 debug SolarMeter/scripts/startup: set_configuration.config={ version=“1.0”, remove_inactive=false, log_level=5, label=“Universal Solar Meter”, author=“Rene Boer” }
2021-01-13.07:31:30 debug SolarMeter/scripts/startup: create_devices.devices={ 1={ poll_interval=900, active=false, id=1, name=“Solar Edge”, config={ system_id=“999999”, api_key=“XXXXXXXXXXXX…XXXXX” }, path=“solar_egde” } }
2021-01-13.07:31:30 debug SolarMeter/scripts/startup: Hub has 7 devices
2021-01-13 07:31:30.614642 INFO : LuaAddon: a script: HUB:SolarMeter/scripts/startup has been executed successfully

Hi @ranneman,

Nothing in the log for SolarMeter after the last INFO line you show? Can you send me a PM with the SolarMeter.json you use? You have seven (7) inverters configured, is that your intend?

Cheers Rene

@reneboer,

Actually the entries are gone from the log file?? If I now check the ha-luad.log file I miss entries from 13-01-2021. As you can see from the copied lines above the entries existed but now I cannot see them anymore in the ha-luad.log. Strange… maybe this is caused by submitting a hub.Reboot command via the API tool which I was checking this morning.

I know there where no more entries, I used the search to find all “solar” lines

It is not my intention to have 7 inverters. My SolarMeter.json only contains one device.

The Ezlo log files rotate so after a while things disappear. Also after a reboot the logs are recreated. There will be a previous version with a .1 post-fix.

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules