I’m new to Lua and writing edge drivers (although a professional developer otherwise) and have taken a stab at writing one to control a Pecron solar generator, since the official android app is pretty poor and doesn’t allow much automation.
I plan to set up automation to do peak shaving using the battery, charging off peak/solar and using during peak pricing.
I’ve got my driver mostly functional, it does LAN discovery and can read various properties (power in/out, battery%, temp etc) and control ac/dc output enable.
However the biggest issue I’ve been unable to overcome is that using the smartthings android app, when a device is discovered and the device tile appears, clicking on it just pops us a “Loading” toast message, the device details page doesn’t appear.
If I wait about 20 mins after discovery, clicking it works fine.
I assume I’m missing something in the device properties and there’s some sort of timeout period happening, but despite a lot of experimentation and googling I’ve been unable to resolve it.
It’s not the end of the world since it works fine after that startup period, but it’d be nice to fix it, especially during testing changes when I need to rediscover frequently.
Hi, @winfij
I’ve seen that before, but not constantly. And, based on your description, this happens every time you discover the device, correct?
So, after the 20 minutes you mention, you don’t get the error again even if you re-open the app, right?
Can you share your profile’s definition so I can test the same config on my side and check if I get the same error, please?
Yep - if I delete the device and rediscover, I get the same thing every time.
Works fine after that initial problem period.
The odd thing is that the device is working fine during that period - on the device tile I can see the correct battery charge level being displayed, I just can’t open the detail panel.
Hi, @winfij
Thank you for this info.
It’s weird, I could open the detail view without issues. I thought it could be related to the plugin not being able to load something in your configuration.
But unless you’re setting strange values for the capabilities, I’m not sure that’s the issue.
Since I’m not able to reproduce, please help me collect this info:
Reinstall the device
Start recording your screen before clicking on it. Then try to open it so we can see what the app tries to do and the final error.