Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional mode only for receiving data from the cloud #1

Open
Neewieedo opened this issue Sep 1, 2024 · 5 comments
Open

Optional mode only for receiving data from the cloud #1

Neewieedo opened this issue Sep 1, 2024 · 5 comments

Comments

@Neewieedo
Copy link

Can the code be adapted so that it only serves to receive data?
Without automation etc.

@ai-bits
Copy link
Owner

ai-bits commented Sep 2, 2024

Guessing you want to use it to get data while there are problems / only flaky responses via tolwi's EFC?

Sure. The quickest hack would be:

  • Comment out the one put_api() call at the very bottom of the PyScript where the desired PERMANENT_WATTS get written.
  • In set_ef() there is a cluster with several calls to get_val() for essential states to calculate inverter_output_watts. Add your calls there. Look up the field names eg for the PS in EF dev docs.
  • Add a definition for the input_number.<my_val> to the input_number: cluster in configuration.yaml
  • Use input_number.<my_val> in the dashboard instead of sensor._<my_val>

The logic overhead for inverter_output_watts should be negligible.
I'm working on a version where the PyScript gets called only once and stays in a sorta event loop which should be lighter.

Hope my guess was right and that helps. Happy Labor Day if applicable!
Cheers
G.

@Neewieedo
Copy link
Author

Neewieedo commented Sep 2, 2024

Yes, that's exactly what I meant. I'm currently in the process of expanding the whole thing after making a few adjustments.
Perhaps you could set up a simple version without logic, just for sending and receiving...

Open Points:

  • Read !sercets form py-Script (variables do not work in automation if it should remain editable)
  • Def sensor.xyz not input_number.xyz for variables
  • Do not call all variables at the same time interval. Some in real time, others slower, e.g. once per minute.

@ai-bits
Copy link
Owner

ai-bits commented Sep 2, 2024

I'd rather bet at @tolwi to get this working well soon than investing too much time in a kludge. Commenting out put_api() seems fair enough.

But I just uploaded a ef_loop.py with sorta event loop in the works for a more fine grained approach and less overhead.
More frequent data and put_api() on demand.

You are welcome to draw from it or participate.
Needa run
Thanks for getting envolved!
G.

@Neewieedo
Copy link
Author

@ai-bits
I think I first have to understand what you were thinking about with the ef_loop.py... ;-)

In the meantime, I have continued with my old solution and am trying to replace the input_number with sensors.
I just don't like the input fields for read variables in the dashboard ;-)

@ai-bits
Copy link
Owner

ai-bits commented Sep 2, 2024

Whatever works (best) (for you).

The idea behind ef_loop.py:

  • Avoid the initializations with every automation call (currently every minute)
  • Stay in the PyScript in a 1-sec-event-loop to check the energy meter and set inverter_output_watts only if necessary and feasible.

Mr. Pragmatic says: At many times of the day there is not much headroom to react with this HW as our energy need is between 250 and 650W, depending on the TVs running and very limited reserve to react on energy hogs like electric oven, dishwasher, dryer,..

So my time investment will be limited.
Cheers
G.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants