Never mind steps forwards and backwards…

Over the last couple of evenings I think I’ve been all around the houses 🙁

I pushed my new device templates into emoncms, but they just wouldn’t work properly. The various processes didn’t get set up and I kept getting errors. Tonight I decided to mount up a development partition with the templates in so I could modify them “in real time” when the Docker container was using them, but that made things even worse. Sometimes they just didn’t work at all and I was offered no device templates whatsoever.

After quite some time I discovered that the code for reading the templates isn’t really very fussy about matching names of files. Perhaps not as fussy as it should be. It was picking up my editor temporary files and assuming they were valid templates, which of course they’re not. At that point everything bombs out. But only when I had a template open in the editor 🙂 Editing the code to make things a bit more strict made life somewhat simpler and after messing about cutting down templates and moving between a working one and my own I discovered a subtle error in mine. That’s now fixed and I think this is the final form the RFXmeter template will take:

{
  "name": "single-input RFXmeter",
  "category": "RFXcom",
  "group": "Power",
  "description": "1-input RFXmeter",
  "inputs": [
    {
      "name": "count",
      "description": "CT Power 1",
      "processList": [
        {
          "process": "scale",
          "arguments": {
            "type": "ProcessArg::VALUE",
            "value": 0.001
          }
        },
        {
          "process": "kwh_accumulator",
          "arguments": {
            "type": "ProcessArg::FEEDID",
            "value": "power"
          }
        }
      ]
    }
  ],
  "feeds": [
    {
      "name": "power",
      "engine": "Engine::PHPTIMESERIES",
      "unit": "kWh"
    }
  ]
}

I am now able to create my devices and have inputs and feeds automagically set up. Go me.

Not so fast, sadly 🙁 It turns out that the accumulator processes need to have Redis running and I don’t. I don’t really want to pull it into the Docker image I’m running either, so it looks like I need another Docker image for Redis. That’s the next job then. Get the image set up, start it from systemd, then plumb it into emoncms and see what else blows up in my face 🙂

This entry was posted in Computing and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *