Coder Social home page Coder Social logo

Comments (5)

matthijsvisser avatar matthijsvisser commented on June 7, 2024

Looks like you haven't specified a poll interval of the meter in the configuration file.

from kamstrup-402-mqtt.

JeroenHaringman avatar JeroenHaringman commented on June 7, 2024

All right, I added the poll interval, my config.yaml now looks like this:

mqtt:
host: 192.168.178.84
port: 1883
client: kamstrup
topic: kamstrup
qos: 0
retain: False
authentication: False
poll_interval: 1
serial_device:
com_port: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A5043WW6-if00-port0
kamstrup:
parameters:
- energy
- volume
- temp1
- temp2
- tempdiff


That COM port is the same one I use with the multical402-4-domoticz.py script.

When I run python3 daemon.py I get permission denied errors (can't quite remember if I had those last night as well, maybe I went straight for the sudo python3 daemon.py), so I run sudo python3 daemon.py, and then I get this:

pi@raspberrypi:~/kamstrup-402-mqtt $ sudo python3 daemon.py &
[5] 18746
[4]   Exit 1                  python3 daemon.py
pi@raspberrypi:~/kamstrup-402-mqtt $ Traceback (most recent call last):
  File "daemon.py", line 92, in <module>
    main()
  File "daemon.py", line 88, in main
    daemon = KamstrupDaemon()
  File "daemon.py", line 50, in __init__
    self.poll_interval = kamstrup_cfg["poll_interval"]
KeyError: 'poll_interval'

Looks like the same error. Also (obviously, but I checked anyway) nothing showed up on the kamstrup MQTT topic.

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

The poll interval attribute is part of the kamstrup object. You'll need to place it under the kamstrup parameters. Take a look at the example; config.yaml

from kamstrup-402-mqtt.

JeroenHaringman avatar JeroenHaringman commented on June 7, 2024

And that was, the solution, thank you very much! No errors when i run the script, log says it has transmitted sane values to the MQTT topic.

Now I have misconfigured the configuration.yaml of my Home Assistant and it won't start anymore 😋 but that's my problem.

from kamstrup-402-mqtt.

matthijsvisser avatar matthijsvisser commented on June 7, 2024

Nice, have fun!

from kamstrup-402-mqtt.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.