AnotherDaniel / smahub

SMAHub is a flexible and modular solution for collecting data from SMA photovoltaic (PV) products and publishing it to various output channels, such as MQTT.
GNU General Public License v2.0
31 stars 11 forks source link

Publish Interval not respected #53

Closed daserra23 closed 6 days ago

daserra23 commented 3 weeks ago

I am running smahub in docker and all works well but it ignores the publish interval set in the docker-compose.yml and also in the individual conf files for the sinks (updatefreq = 60).

This is overloading my Domoticz instance so I made a little python script to republish to another topic and disabled the HA_mqtt sink and this works adequately for me.

I wonder if there is something misconfigured.

My docker-compose.yml is

version: '3' services: smahub: image: ghcr.io/anotherdaniel/smahub:latest container_name: smahub network_mode: host restart: unless-stopped

useful if you manage the MQTT broker from this same docker-compose file

depends_on:

- mosquitto

environment:
  -  SMAHUB_VERBOSE=false
  -  TRIPOWERX_ENABLED=false
  -  TRIPOWERX_ADDRESS=192.0.2.1
  -  TRIPOWERX_USER=user
  -  TRIPOWERX_PASSWORD=password
  -  TRIPOWERX_PROTOCOL=https
  -  TRIPOWERX_VERIFYTLS=false
  -  MQTT_ENABLED=true
  -  MQTT_ADDRESS=192.168.2.9
  -  MQTT_PORT=1883
  -  MQTT_USER=user
  -  MQTT_PASSWORD=password
  -  SHM2_ENABLED=true
  -  GENHASENSORS_ENABLED=false
  -  GENHASENSORS_GENERATEFREQ=600
  -  GENHASENSORS_FILEPREFIX=hasensors_
  -  GENHASENSORS_SHM2=mdi:camera-switch
  -  GENHASENSORS_TRIPOWERX=mdi:border-all
  -  HA_MQTT_ENABLED=false
  -  HA_MQTT_ADDRESS=192.168.2.9
daserra23 commented 3 weeks ago

I really don't know why github reformats that text.

daserra23 commented 1 week ago

Anyone ? I've also changed the frequency to 60 in shm2.conf and mqtt.conf but I am still getting updates every 2 seconds which is putting a drag on my pi CPU.

daserra23 commented 6 days ago

Maybe my volumes aren't set correctly and the changes I make on the host aren't being reflected in the container...

version: '3' services: smahub: image: ghcr.io/anotherdaniel/smahub:latest container_name: smahub network_mode: host restart: unless-stopped environment:

daserra23 commented 6 days ago

OK, I resolved this. The volumes weren't being mapped by the docker-compose.yml file so I added the mapping and now the conf's have an effect. The docker-compose instructions/code could do with streamlining so you can simply clone into a directory, change variables in the docker-compose and conf files and then start the container. As it was I had to enter the container and make settings there.

AnotherDaniel commented 5 days ago

Glad to hear you could solve this, and I do apologize for not being very response here atm - many other things that want attention... If you want to, I'd welcome you creating an issue describing the changes you'd like to see. I admit I haven't worked with a setup like you describe - I'm simply setting all config values via docker-compose.yml

daserra23 commented 5 days ago

So I added the lines ` volumes:

It just means I can change settings without "entering" the running container , and also they will survive an upgrade.