Open ASomerN opened 2 years ago
Hi,
I've forked this to build and do some testing: https://github.com/ASomerN/node-red-contrib-tesla/tree/try-catch-outputs
Example working flow (had to wait for the vehicle to sleep):
Everything is working as intended, it outputs either success or fails, some minor changes are required but need to test the upgrade to see if it causes anything to break. Changed colour of the node to match the logo but this was more to differentiate locally.
The only change required is in the tesla.js send call and function, and setting outputs to 2 in the html.
Hi,
Great API in NodeRed and I've been able to completely automate charging of the car using solar power, modulating in real time for cloud cover and so on, and auto-shut-off if it exceeds charge and starts using too much house battery.
I've encountered an issue where Nodered can't easily capture failures on the API (i set the car to use my own wifi and opened a can of worms of mesh network but that's a different issue and resulted in me finding a potential improvement). As it stands it appears any error is stuck within the API request. Would it be possible to update so there are two outputs from the API, in essence (excuse the pseudo-code):
This ought not to be a breaking change, as currently success is returned in the first instance anyway, but not the error. This would allow us to handle some rejected responses, instead of creating a mechanism in Nodered to detect a failed request based on nothing happening.
If the error included details we can map specific flows based on the error type.
Thanks for all the really great work you have done.