nakla / sbfspot

Scripts for building and running the docker container
19 stars 10 forks source link

Interval less than 60 seconds do not work #23

Open mhilcher opened 3 weeks ago

mhilcher commented 3 weeks ago

Configured 30 seconds as interval:

version: '3'

services:
    sbfspot:
        image: nakla/sbfspot:latest
        network_mode: host
        volumes:
            - /mnt/usb/docker/apps/SBFSpot/conf:/etc/sbfspot
            - /mnt/usb/docker/apps/SBFSpot/data:/var/sbfspot
        environment:
            TZ: Europe/Berlin
            ENABLE_SBFSPOT: 1
            SBFSPOT_INTERVAL: 30
            ENABLE_SBFSPOT_UPLOAD: 0
            DB_STORAGE: sqlite
            CSV_STORAGE: 1
            MQTT_ENABLE: 1
            QUIET: 0
            SBFSPOT_ARGS: -d0 -v2
            INIT_DB: 0
        restart: always

Task starts every 60 seconds:

startTime: 01/09/2024 13:00:00
Reading events: 2024-Sep-01
ExportEventsToCSV()
Tue Sep 24 17:16:59 2024: INFO: Done.
Tue Sep 24 17:16:59 CEST 2024
Sleeping 60 seconds.
nakla commented 3 weeks ago

Hello, at startup, you should have received the following message: "SBFSPOT_INTERVAL is very short. It will be set to 60 seconds." I have to add that comment in the readme... Is there a reason, you set the interval that short, or do you need polling your inverters so often? Best regards

mhilcher commented 3 weeks ago

Hi

Is there a reason, you set the interval that short, or do you need polling your inverters so often? Best regards

thx for the answer, didn't see that message. I'm sure it was there, but I overlooked it.

Yes, there is a reason. I am controlling some events in my smarthome configuration depending on how much power is produced. And I made a display which shows me the current power. One minute seemed to be long for some events to trigger, so I made a cronjob every minute where I start 2 jobs at the same time, but the second starts with "wait 30", so I have an update every 30 seconds. Now I wanted to migrate that from my rasperry pi to a docker container, that's when I found your container.

Maybe I have to rethink if a 60 sec intervall could be enough for my needs, but it would have been nice if that worked "out of the box".

Thank you for your work to bring SBFSpot to docker :)

nakla commented 3 weeks ago

Ok, I use the tool mainly to archive the data. I thought, that the inverters only provide data in a 5 minute interval. Are you sure, you inverters can show you instantaneous values that are not equal for 5 minutes? If yes, then let my know, I will then change it in the container. In your case, wouldn't it be more precise, to read out your energy meter (if that is possible)?

mhilcher commented 3 weeks ago

Are you sure, you inverters can show you instantaneous values that are not equal for 5 minutes?

Yes, I always get the current power from the inverter. Theoretically I could read it out every second.

If yes, then let my know, I will then change it in the container.

Thx, that would be great.

In your case, wouldn't it be more precise, to read out your energy meter (if that is possible)?

Not in my case. My energy meter just delivers the amount of energy that is fed into the power grid of my energy supplier. But I need the total current power from the inverter, not just the overproduction fed in.

nakla commented 3 weeks ago

Ok, I leave the issue open and inform you, when the interval is updated and tested.

mhilcher commented 3 weeks ago

Ok, I leave the issue open and inform you, when the interval is updated and tested.

Thank you